add rooter, more shortcuts
This commit is contained in:
parent
267b79def8
commit
4a463a81fb
12
init.lua
12
init.lua
@ -33,6 +33,7 @@ vim.api.nvim_set_keymap('n', '<leader>d', ':FzfLua diagnostics_document<CR>', {
|
||||
vim.api.nvim_set_keymap('n', ']g', ':Gitsigns next_hunk<CR>', { noremap = true })
|
||||
vim.api.nvim_set_keymap('n', '[g', ':Gitsigns prev_hunk<CR>', { noremap = true })
|
||||
vim.api.nvim_set_keymap('n', 'gs', ':Gitsigns preview_hunk_inline<CR>', { noremap = true })
|
||||
vim.api.nvim_set_keymap('n', 'gu', ':Gitsigns reset_hunk<CR>', { noremap = true })
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<leader>DD', ':DiffviewOpen<CR>', { noremap = true })
|
||||
vim.api.nvim_set_keymap('n', '<leader>DF', ':DiffviewFileHistory<CR>', { noremap = true })
|
||||
@ -120,6 +121,17 @@ vim.api.nvim_set_keymap('v', ',t', ':tab drop<Space>', { noremap = true })
|
||||
vim.api.nvim_set_keymap('n', '<leader>q', ':tabclose<CR>', { noremap = true })
|
||||
|
||||
|
||||
vim.cmd [[
|
||||
set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<
|
||||
]]
|
||||
|
||||
vim.cmd [[
|
||||
let g:rooter_manual_only = 0
|
||||
let g:rooter_silent_chdir = 1
|
||||
let g:rooter_patterns = ['.git']
|
||||
let g:rooter_change_directory_for_non_project_files = 'current'
|
||||
]]
|
||||
|
||||
-- vim.opt.shada = "/100,'10,\"100,:20,%"
|
||||
-- vim.opt.shadafile = "/home/pfs/.config/nvpunk/lua/user/nviminfo"
|
||||
-- autocmd BufWinLeave * if expand("%") != "" | silent! mkview | endif
|
||||
|
60
nvpunk.patch
Normal file
60
nvpunk.patch
Normal file
@ -0,0 +1,60 @@
|
||||
diff --git a/lua/nvpunk/keymaps.lua b/lua/nvpunk/keymaps.lua
|
||||
index d4a0339..8eccb86 100644
|
||||
--- a/lua/nvpunk/keymaps.lua
|
||||
+++ b/lua/nvpunk/keymaps.lua
|
||||
@@ -16,20 +16,20 @@ M.set_keymaps = function()
|
||||
km.vkeymap('>', '>gv')
|
||||
|
||||
-- move selection
|
||||
- km.vkeymap('<A-k>', ":m '<-2<CR>gv=gv")
|
||||
- km.vkeymap('<A-j>', ":m '>+1<CR>gv=gv")
|
||||
+ -- km.vkeymap('<C-S-k>', ":m '<-2<CR>gv=gv")
|
||||
+ -- km.vkeymap('<C-S-j>', ":m '>+1<CR>gv=gv")
|
||||
|
||||
-- pasting in visual mode doesn't overwrite the clipboard content
|
||||
- km.vkeymap('p', '"_dP')
|
||||
+ -- km.vkeymap('p', '"_dP')
|
||||
|
||||
-- pressing esc twice goes to normal mode in terminal windows
|
||||
- km.tkeymap('<Esc><Esc>', '<C-\\><C-n>')
|
||||
+ -- km.tkeymap('<Esc><Esc>', '<C-\\><C-n>')
|
||||
|
||||
-- wrapped text movement
|
||||
- km.nkeymap('<A-j>', 'gj')
|
||||
- km.nkeymap('<A-k>', 'gk')
|
||||
- km.nkeymap('<A-Down>', 'gj')
|
||||
- km.nkeymap('<A-Up>', 'gk')
|
||||
+ -- km.nkeymap('<A-j>', 'gj')
|
||||
+ -- km.nkeymap('<A-k>', 'gk')
|
||||
+ -- km.nkeymap('<A-Down>', 'gj')
|
||||
+ -- km.nkeymap('<A-Up>', 'gk')
|
||||
|
||||
-- Terminal splitter
|
||||
km.nkeymap('<leader>/s', '<cmd>vs<cr><cmd>terminal<cr>',
|
||||
diff --git a/lua/nvpunk/lsp/base_conf.lua b/lua/nvpunk/lsp/base_conf.lua
|
||||
index 46dc71f..72314fb 100644
|
||||
--- a/lua/nvpunk/lsp/base_conf.lua
|
||||
+++ b/lua/nvpunk/lsp/base_conf.lua
|
||||
@@ -37,6 +37,7 @@ vim.g.rustaceanvim = {
|
||||
['rust-analyzer'] = {
|
||||
telemetry = { enable = false },
|
||||
offset_encoding = 'utf-8',
|
||||
+ check = { command = 'clippy' },
|
||||
}
|
||||
}
|
||||
},
|
||||
diff --git a/lua/nvpunk/lsp/keymaps.lua b/lua/nvpunk/lsp/keymaps.lua
|
||||
index 01af280..4915b00 100644
|
||||
--- a/lua/nvpunk/lsp/keymaps.lua
|
||||
+++ b/lua/nvpunk/lsp/keymaps.lua
|
||||
@@ -63,8 +63,8 @@ M.set_lsp_keymaps = function(client, bufnr, extra_keymaps)
|
||||
'List folders'
|
||||
)
|
||||
-- bm.nkeymap('<leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', 'Open definition')
|
||||
- bm.nkeymap('<leader>rn', vim.lsp.buf.rename, 'Rename')
|
||||
- bm.nkeymap('gr', vim.lsp.buf.references, 'References')
|
||||
+ --bm.nkeymap('<leader>rn', vim.lsp.buf.rename, 'Rename')
|
||||
+ --bm.nkeymap('gr', vim.lsp.buf.references, 'References')
|
||||
bm.nkeymap('<leader>e', vim.diagnostic.open_float, 'Show diagnostics')
|
||||
bm.nkeymap('[d', vim.diagnostic.goto_prev, 'Prev diagnostic')
|
||||
bm.nkeymap(']d', vim.diagnostic.goto_next, 'Next diagnostic')
|
@ -1,4 +1,5 @@
|
||||
return {
|
||||
{ 'tpope/vim-fugitive' },
|
||||
{ 'ibhagwan/fzf-lua' }
|
||||
{ 'ibhagwan/fzf-lua' },
|
||||
{ 'airblade/vim-rooter' },
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user