aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lua21
1 files changed, 19 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index 7b390bc..c8a1927 100644
--- a/init.lua
+++ b/init.lua
@@ -127,6 +127,7 @@ vim.api.nvim_set_keymap('n', '<c-w><c-]>', '<c-w>v<c-]><c-w>T', { noremap = true
vim.api.nvim_set_keymap('n', '<c-w><c-t>', '<c-w>v<c-w>T', { noremap = true })
vim.api.nvim_set_keymap('n', '<c-w><c-w>', '<cmd>w<cr>', { noremap = true })
vim.api.nvim_set_keymap('n', '<c-w><c-a>', '<cmd>wa<cr>', { noremap = true })
+vim.api.nvim_set_keymap('n', '<c-q><c-a>', '<cmd>qa!<cr>', { noremap = true })
vim.api.nvim_set_keymap('n', '<leader>ee', '<cmd>e!<cr>', { noremap = true })
vim.api.nvim_set_keymap('n', '<expr> k', [[(v:count > 1 ? "m'" . v:count : '') . 'k']], { noremap = true })
vim.api.nvim_set_keymap('n', '<expr> j', [[(v:count > 1 ? "m'" . v:count : '') . 'j']], { noremap = true })
@@ -271,12 +272,28 @@ cmp.setup {
}
-- nvim-fzf
-vim.api.nvim_set_keymap('n', '<leader>ff', "<cmd>Files<cr>", { noremap = true })
-vim.api.nvim_set_keymap('n', '<leader>fb', "<cmd>Buffers<cr>", { noremap = true })
+vim.api.nvim_set_keymap('n', '<leader>fb', "<cmd>let g:fzf_buffers_jump = 0<cr><cmd>Buffers<cr>", { noremap = true })
vim.api.nvim_set_keymap('n', '<leader>ft', "<cmd>Tags<cr>", { noremap = true })
vim.api.nvim_set_keymap('n', '<leader>fm', "<cmd>Marks<cr>", { noremap = true })
vim.api.nvim_set_keymap('n', '<leader>fg', "<cmd>GF?<cr>", { noremap = true })
vim.cmd([[let $FZF_DEFAULT_COMMAND = 'find . -type f -not -path "*/\.git/*" -not -path "*/\.mypy_cache/*" -not -path "*/\.venv/*" -not -path "*/\node_modules/*" ']])
+vim.cmd([[
+nnoremap <leader>ff :call FilesDefault()<cr>
+function! FilesDefault()
+ if exists('g:fzf_action')
+ " I don't set fzf_action except for the FilesNew thing so unset it for
+ " default behaviour in files
+ unlet g:fzf_action
+ endif
+ execute 'Files'
+endfunction
+nnoremap <leader>fn :let g:fzf_action = { 'enter': 'tab split' }<cr>:Files<cr>
+nnoremap <leader>fo :call BufferTabJump()<CR>
+function! BufferTabJump()
+ let g:fzf_buffers_jump = 1
+ execute 'Buffers'
+endfunction
+]])
-- vim-argwrap
vim.api.nvim_set_keymap('n', '<leader>ew', '<cmd>ArgWrap<cr>', { noremap = true })