nvim-config

Log | Files | Refs | Submodules | README

commit 44314434b54fb8ea3a9302055773c341291ca691
parent 252e34514e007faec7479a695e9ef28fb5a081b4
Author: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
Date:   Wed, 18 May 2022 09:17:39 +0200

Update to latest APIs

Diffstat:
Mafter/ftplugin/gitcommit.vim | 3+--
Mafter/plugin/statusline.vim | 42+++++++++++++++++++++---------------------
Mlua/lsp_config.lua | 4++--
Mlua/neogit-config.lua | 4++--
4 files changed, 26 insertions(+), 27 deletions(-)

diff --git a/after/ftplugin/gitcommit.vim b/after/ftplugin/gitcommit.vim @@ -1,4 +1,3 @@ -" Last Change: 2022 Apr 14 +" Last Change: 2022 Apr 27 -autocmd InsertLeave <buffer> exit startinsert diff --git a/after/plugin/statusline.vim b/after/plugin/statusline.vim @@ -1,27 +1,27 @@ -" Last Change: 2021 Sep 08 +" Last Change: 2022 May 03 -function! StatusLineActive() - let l:status = "%-6.{mode(6)}\ " - let l:status .= "%<%.50f%m\ " - let l:status .= "%y%q%w" - let l:status .= "%=" - let l:status .= "%-20.(%8.{get(b:,'gitsigns_head','')}%12.{get(b:,'gitsigns_status','')}%)\ " - let l:status .= "%16.(%10.(%l/%LL%),\ %-5.(%c%V%)%)" - let l:status .= "\ %10.P" +" function! StatusLineActive() +" let l:status = "%-6.{mode(6)}\ " +" let l:status .= "%<%.50f%m\ " +" let l:status .= "%y%q%w" +" let l:status .= "%=" +" let l:status .= "%-20.(%8.{get(b:,'gitsigns_head','')}%12.{get(b:,'gitsigns_status','')}%)\ " +" let l:status .= "%16.(%10.(%l/%LL%),\ %-5.(%c%V%)%)" +" let l:status .= "\ %10.P" - return l:status -endfunction +" return l:status +" endfunction -function! StatusLineInactive() - return "\ \ \ \ \ \ \ %<%.50f%m\ %y%q%w" -endfunction +" function! StatusLineInactive() +" return "\ \ \ \ \ \ \ %<%.50f%m\ %y%q%w" +" endfunction -augroup Wins - autocmd! - autocmd WinEnter * setlocal statusline=%!StatusLineActive() - autocmd WinLeave * setlocal statusline=%!StatusLineInactive() -augroup END +" augroup Wins +" autocmd! +" autocmd WinEnter * setlocal statusline=%!StatusLineActive() +" autocmd WinLeave * setlocal statusline=%!StatusLineInactive() +" augroup END -" Pour avoir un bon defaut -set statusline=%!StatusLineActive() +" " Pour avoir un bon defaut +" set statusline=%!StatusLineActive() diff --git a/lua/lsp_config.lua b/lua/lsp_config.lua @@ -30,7 +30,7 @@ local function on_attach(client, bufnr) buf_set_keymap(']d', 'vim.diagnostic.goto_next()') buf_set_keymap('<Leader>l', 'vim.diagnostic.setloclist()') buf_set_keymap('<Leader>q', 'vim.diagnostic.setqflist()') - buf_set_keymap('<Leader>=', 'vim.lsp.buf.formatting()') + buf_set_keymap('<Leader>=', 'vim.lsp.buf.format { async = true }') buf_set_keymap('gR', 'require"telescope.builtin".lsp_references()') buf_set_keymap('<Leader>s', 'require"telescope.builtin".lsp_dynamic_workspace_symbols()') @@ -180,7 +180,7 @@ local lsps = { forwardSearch = { executable = "zathura", args = { "--synctex-forward", "%l:1:%f", "%p" } - } + }, } }, }, diff --git a/lua/neogit-config.lua b/lua/neogit-config.lua @@ -7,8 +7,8 @@ gitsigns.setup { delay = 1000, }, on_attach = function(bufnr) - vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-S>', ':Gitsigns stage_hunk<CR>', {}) - vim.api.nvim_buf_set_keymap(bufnr, 'v', '<C-S>', ':Gitsigns stage_hunk<CR>', {}) + vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-S>', ':Gitsigns stage_hunk<CR>', { silent = true}) + vim.api.nvim_buf_set_keymap(bufnr, 'v', '<C-S>', ':Gitsigns stage_hunk<CR>', { silent = true}) end }