From 5a077eb43453acfdcd6252970ffc9a8b0dceeecc Mon Sep 17 00:00:00 2001 From: Henrik Bakken Date: Sun, 29 Aug 2021 22:47:21 +0200 Subject: [PATCH] updates --- nvim/init.lua | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/nvim/init.lua b/nvim/init.lua index dc52f80..589befe 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -51,7 +51,7 @@ opt.shiftwidth = 2 -- Size of an indent -- search opt.ignorecase = true -- Ignore case opt.smartcase = true -- Do not ignore case with capitals -opt.wildmode = {"list:longest"} -- Command-line completion mode +opt.wildmode = {"full"} -- Command-line completion mode opt.wildignorecase = true opt.wildignore = opt.wildignore + {"*swp", "*.class", "*.pyc", "*.png", "*.jpg", "*.gif", "*.zip", "*/tmp/*", "*.o", ".obj", "*.so"} @@ -84,8 +84,8 @@ local cmd = vim.cmd vim.api.nvim_command [[augroup MYAU]] vim.api.nvim_command [[autocmd!]] -vim.api.nvim_command [[autocmd BufWritePre * %s/\s\+$//e]] -vim.api.nvim_command [[autocmd BufWritePre *.py silent! execute ':Black']] +vim.api.nvim_command [[autocmd BufWritePost * %s/\s\+$//e]] +vim.api.nvim_command [[autocmd BufWritePost *.py silent! execute ':Black']] vim.api.nvim_command [[autocmd BufReadPost quickfix nmap ]] vim.api.nvim_command [[autocmd TextYankPost * "lua vim.highlight.on_yank {on_visual = false}"]] vim.api.nvim_command [[augroup END]] @@ -147,7 +147,7 @@ map("n", "", ":cn", { noremap = true }) -- remove buffer map("n", "", ":bprev:bd#", { noremap = true }) map("n", "", ":bprev:bd!#", { noremap = true }) -map("n", "", ":checkt", { noremap = true }) +map("n", "", ":checkt", { noremap = true }) -- ---------------------------------------- -- PACKER @@ -181,8 +181,8 @@ require("packer").startup {function(use) config = function() local map = vim.api.nvim_set_keymap map("", "", ":vertical Git:vertical resize 60", {}) - map("", "gg", ":vertical Gclog!:vertical resize 60", {}) - map("", "gc", ":vertical 0Gclog!:vertical resize 60", {}) + map("", "gg", ":vertical Gclog!", {}) + map("", "gc", ":vertical 0Gclog!", {}) end } @@ -641,6 +641,14 @@ use {"nvim-treesitter/nvim-treesitter", if client.resolved_capabilities.rename then bmap(bufnr, "n", "", ":Lspsaga rename", opts) end + if client.resolved_capabilities.document_formatting or client.resolved_capabilities.document_range_formatting then + vim.api.nvim_command [[augroup Format]] + vim.api.nvim_command [[autocmd! * ]] + vim.api.nvim_command [[autocmd BufWritePost *.py lua vim.lsp.buf.formatting_seq_sync()]] + vim.api.nvim_command [[autocmd BufWritePost *.md lua vim.lsp.buf.formatting_seq_sync()]] + vim.api.nvim_command [[autocmd BufWritePost *.yaml lua vim.lsp.buf.formatting_seq_sync()]] + vim.api.nvim_command [[augroup END]] + end end use_saga_diagnostic_sign = true require("lspsaga").init_lsp_saga {