From be7fc9fff0c35dd35f7494e1b5b4b835b4c5f223 Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 4 Sep 2023 18:36:22 +0200 Subject: up --- .config/nvim/bindings.vim | 62 -------------------------------------- .config/nvim/init.lua | 2 +- .config/nvim/lua/bindings.lua | 69 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 63 deletions(-) delete mode 100644 .config/nvim/bindings.vim create mode 100644 .config/nvim/lua/bindings.lua (limited to '.config') diff --git a/.config/nvim/bindings.vim b/.config/nvim/bindings.vim deleted file mode 100644 index c54e82b..0000000 --- a/.config/nvim/bindings.vim +++ /dev/null @@ -1,62 +0,0 @@ -call which_key#register('\', "g:which_key_map") -let g:which_key_map = {} -nnoremap c "_c -nnoremap :call nerdcommenter#Comment(0,"toggle") -nnoremap : -nnoremap :bprevious -nnoremap :bnext -nnoremap h -nnoremap j -nnoremap k -nnoremap l -nnoremap o -nnoremap q -nnoremap zz -nnoremap zz -nnoremap :WhichKey '\' -nnoremap b :Buffers -nnoremap d :bd -nnoremap e :Files -nnoremap ga :Ag -nnoremap gg :Grep -nnoremap gr :Rg -nnoremap G :FloatermNew lazygit -nnoremap h :Startify -nnoremap k :w:bp:bd # -nnoremap p :CocList -A --normal yank -nnoremap v :FloatermNew vifm -nnoremap w :w -nnoremap x :w:bp:bd # -let g:which_key_map.b = 'buffers' -let g:which_key_map.c = { 'name': '+nerd-commenter' } -let g:which_key_map.d = 'close-buffer' -let g:which_key_map.e = 'files' -let g:which_key_map.g = { 'name': '+grep' } -let g:which_key_map.g.a = 'the_silver_searcher' -let g:which_key_map.g.g = 'grep' -let g:which_key_map.g.r = 'ripgrep' -let g:which_key_map.G = 'lazygit' -let g:which_key_map.h = 'startify' -let g:which_key_map.k = 'write-and-close-buffer' -let g:which_key_map.p = 'coc-paste' -let g:which_key_map.q = { 'name': '+coc-fix-current' } -let g:which_key_map.r = { 'name': '+coc-rename' } -let g:which_key_map.v = 'vifm' -let g:which_key_map.w = 'write-buffer' -let g:which_key_map.x = 'write-and-close-buffer' -nmap AirlineSelectTab1 -nmap AirlineSelectTab2 -nmap AirlineSelectTab3 -nmap AirlineSelectTab4 -nmap AirlineSelectTab5 -nmap AirlineSelectTab6 -nmap AirlineSelectTab7 -nmap AirlineSelectTab8 -nmap AirlineSelectTab9 -nmap AirlineSelectTab10 -inoremap pumvisible() ? "" : "" -inoremap pumvisible() ? "" : "" -inoremap pumvisible() ? asyncomplete#close_popup() : "\" -let g:floaterm_keymap_toggle = '' -let g:floaterm_keymap_prev = '' -let g:floaterm_keymap_next = '' diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 739cd29..1940060 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -17,8 +17,8 @@ vim.cmd('set runtimepath^=/home/r_bousset/.config/nvim runtimepath+=/home/jozan/ vim.cmd('let &packpath = &runtimepath') require('plug') require('settings') +require('bindings') require('plugs-config/treesitter') -vim.cmd('source ' .. confdir .. '/nvim/bindings.vim') vim.cmd('source ' .. confdir .. '/nvim/sidebars.vim') vim.cmd('source ' .. confdir .. '/nvim/langs.vim') vim.cmd('source ' .. confdir .. '/nvim/plug-config/airline.vim') diff --git a/.config/nvim/lua/bindings.lua b/.config/nvim/lua/bindings.lua new file mode 100644 index 0000000..08d72e1 --- /dev/null +++ b/.config/nvim/lua/bindings.lua @@ -0,0 +1,69 @@ +vim.call('which_key#register', '\\', 'g:which_key_map') +vim.g.which_key_map = {} +vim.keymap.set('n', 'c', '"_c', { noremap = true, silent = false }) +vim.keymap.set('n', 'M-;', ':call nerdcommenter#Comment(0,"toggle")', { noremap = true, silent = false }) +vim.keymap.set('n', 'M-x', ':', { noremap = true, silent = false }) +vim.keymap.set('n', '', ':bprevious', { noremap = true, silent = true }) +vim.keymap.set('n', '', ':bnext', { noremap = true, silent = true }) +vim.keymap.set('n', '', 'h', { noremap = true, silent = false }) +vim.keymap.set('n', '', 'j', { noremap = true, silent = false }) +vim.keymap.set('n', '', 'k', { noremap = true, silent = false }) +vim.keymap.set('n', '', 'l', { noremap = true, silent = false }) +vim.keymap.set('n', '', 'o', { noremap = true, silent = false }) +vim.keymap.set('n', '', 'q', { noremap = true, silent = false }) +vim.keymap.set('n', '*', '*zz', { noremap = true, silent = false }) +vim.keymap.set('n', '', 'zz', { noremap = true, silent = false }) +vim.keymap.set('n', '', 'zz', { noremap = true, silent = false }) +vim.keymap.set('n', '', ":WhichKey '\\'", { noremap = true, silent = true }) +vim.keymap.set('n', 'b', ':Buffers', { noremap = true, silent = true }) +vim.keymap.set('n', 'd', ':bd', { noremap = true, silent = false }) +vim.keymap.set('n', 'e', ':Files', { noremap = true, silent = true }) +vim.keymap.set('n', 'ga', ':Ag', { noremap = true, silent = true }) +vim.keymap.set('n', 'gg', ':Grep', { noremap = true, silent = false }) +vim.keymap.set('n', 'gr', ':Rg', { noremap = true, silent = true }) +vim.keymap.set('n', 'G', ':FloatermNew lazygit', { noremap = true, silent = true }) +vim.keymap.set('n', 'h', ':Startify', { noremap = true, silent = true }) +vim.keymap.set('n', 'k', ':w:bp:bd #', { noremap = true, silent = false }) +vim.keymap.set('n', 'p', ':CocList -A --normal yank', { noremap = true, silent = true }) +vim.keymap.set('n', 'v', ':FloatermNew vifm', { noremap = true, silent = true }) +vim.keymap.set('n', 'w', ':w', { noremap = true, silent = false }) +vim.keymap.set('n', 'x', ':w:bp:bd #', { noremap = true, silent = false }) +vim.keymap.set('n', '', 'AirlineSelectTab1') +vim.keymap.set('n', '', 'AirlineSelectTab2') +vim.keymap.set('n', '', 'AirlineSelectTab3') +vim.keymap.set('n', '', 'AirlineSelectTab4') +vim.keymap.set('n', '', 'AirlineSelectTab5') +vim.keymap.set('n', '', 'AirlineSelectTab6') +vim.keymap.set('n', '', 'AirlineSelectTab7') +vim.keymap.set('n', '', 'AirlineSelectTab8') +vim.keymap.set('n', '', 'AirlineSelectTab9') +vim.keymap.set('n', '', 'AirlineSelectTab10') +vim.keymap.set('i', ' ', 'pumvisible() ? "" : ""') +vim.keymap.set('i', ' ', 'pumvisible() ? "" : ""') +vim.keymap.set('i', ' ', 'pumvisible() ? asyncomplete#close_popup() : "\\"') +vim.g.floaterm_keymap_toggle = '' +vim.g.floaterm_keymap_prev = '' +vim.g.floaterm_keymap_next = '' +vim.cmd [[ +let g:which_key_map = { +\ 'b': 'buffers', +\ 'c': { 'name': '+nerd-commenter' }, +\ 'd': 'close-buffer', +\ 'e': 'files', +\ 'G': 'lazygit', +\ 'h': 'startify', +\ 'k': 'write-and-close-buffer', +\ 'p': 'coc-paste', +\ 'q': { 'name': '+coc-fix-current' }, +\ 'r': { 'name': '+coc-rename' }, +\ 'v': 'vifm', +\ 'w': 'write-buffer', +\ 'x': 'write-and-close-buffer', +\ 'g': { 'name': '+grep' } +\ } +let g:which_key_map.g = { +\ 'a': 'the_silver_searcher', +\ 'g': 'grep', +\ 'r': 'ripgrep' +\ } +]] -- cgit v1.2.3