nvim-config

Log | Files | Refs | Submodules | README

commit 638d056658c267b211f7af05b178e35fb79479f0
parent 796d6405e92196e0b8d0746391536ee9e1335b33
Author: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
Date:   Thu, 14 Apr 2022 10:14:45 +0200

Update C mappings

Diffstat:
Mafter/ftplugin/c.vim | 10++--------
Mlua/neogit-config.lua | 11++++++++++-
2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/after/ftplugin/c.vim b/after/ftplugin/c.vim @@ -1,4 +1,4 @@ -" Last Change: 2022 Mar 31 +" Last Change: 2022 Apr 14 setlocal expandtab setlocal textwidth=80 " Nvim uses this @@ -14,10 +14,4 @@ if !empty(findfile('.clang-format', ';')) setlocal formatprg=clang-format\ -style=file endif -if expand("%:e") == "c" - let b:ext = "h" -else - let b:ext = "c" -end - -nnoremap <buffer> <Leader>c <cmd>ClangdSwitchSourceHeader<CR> +nnoremap <buffer> <Leader><Leader> <cmd>ClangdSwitchSourceHeader<CR> diff --git a/lua/neogit-config.lua b/lua/neogit-config.lua @@ -5,11 +5,18 @@ gitsigns.setup { current_line_blame = true, current_line_blame_opts = { delay = 1000, - } + }, + on_attach = function(bufnr) + vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-S>', '<cmd>Gitsigns stage_hunk<CR>', {}) + vim.api.nvim_buf_set_keymap(bufnr, 'v', '<C-S>', '<cmd>Gitsigns stage_hunk<CR>', {}) + end } neogit.setup { disable_commit_confirmation = true, + commit_popup = { + kind = 'floating', + }, integrations = { diffview = true }, @@ -19,3 +26,5 @@ neogit.setup { } } } + +vim.keymap.set('n', '<Leader>c', function() neogit.open{ 'commit' } end)