feat: add better bindings
This commit is contained in:
parent
a4cff9fca7
commit
6cbea80685
5 changed files with 37 additions and 5 deletions
|
|
@ -11,9 +11,11 @@ keymap("n", "<F9>", ':lua require("dap").continue()<CR>', opts)
|
|||
keymap("n", "<F10>", ':lua require("dap").close()<CR> :lua require("dapui").toggle()<CR>', opts)
|
||||
|
||||
-- file tree
|
||||
keymap("n", "t", ":ToggleTerm<CR>", opts)
|
||||
keymap("n", "f", ':lua require("nvim-tree").toggle()<CR>', opts)
|
||||
|
||||
-- toggle terminal
|
||||
keymap('n', '<C-d>', ':ToggleTerm ZSH<CR>', opts)
|
||||
|
||||
-- tab switching
|
||||
keymap("n", "<F1>", ":BufferPrev<CR>", opts)
|
||||
keymap("n", "<F2>", ":BufferNext<CR>", opts)
|
||||
|
|
@ -34,6 +36,24 @@ keymap("n", "<leader>ge", ":lua require('telescope.builtin').git_branches()<CR>"
|
|||
keymap("n", "<leader>gr", ":lua require('telescope.builtin').git_status()<CR>", opts)
|
||||
keymap("n", "<leader>ga", ":lua require('telescope.builtin').git_stash()<CR>", opts)
|
||||
|
||||
-- window switching
|
||||
function _G.set_terminal_keymaps()
|
||||
local opts = {buffer = 0}
|
||||
vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts)
|
||||
vim.keymap.set('t', 'jk', [[<C-\><C-n>]], opts)
|
||||
vim.keymap.set('t', '<A-h>', [[<Cmd>wincmd h<CR>]], opts)
|
||||
vim.keymap.set('t', '<A-j>', [[<Cmd>wincmd j<CR>]], opts)
|
||||
vim.keymap.set('t', '<A-k>', [[<Cmd>wincmd k<CR>]], opts)
|
||||
vim.keymap.set('t', '<A-l>', [[<Cmd>wincmd l<CR>]], opts)
|
||||
end
|
||||
|
||||
-- if you only want these mappings for toggle term use term://*toggleterm#* instead
|
||||
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
|
||||
keymap("n", "<A-h>", ":wincmd h<CR>", opts)
|
||||
keymap("n", "<A-j>", ":wincmd j<CR>", opts)
|
||||
keymap("n", "<A-K>", ":wincmd k<CR>", opts)
|
||||
keymap("n", "<A-l>", ":wincmd l<CR>", opts)
|
||||
|
||||
|
||||
-- harpoon man
|
||||
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@ nvim_tree.setup { -- BEGIN_DEFAULT_OPTS
|
|||
sort_by = "name",
|
||||
root_dirs = {},
|
||||
prefer_startup_root = false,
|
||||
sync_root_with_cwd = false,
|
||||
sync_root_with_cwd = true,
|
||||
reload_on_bufenter = false,
|
||||
respect_buf_cwd = false,
|
||||
respect_buf_cwd = true,
|
||||
on_attach = "disable", -- function(bufnr). If nil, will use the deprecated mapping strategy
|
||||
remove_keymaps = false, -- boolean (disable totally or not) or list of key (lhs)
|
||||
view = {
|
||||
|
|
@ -124,6 +124,7 @@ nvim_tree.setup { -- BEGIN_DEFAULT_OPTS
|
|||
},
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
-- update_cwd = true,
|
||||
update_root = false,
|
||||
ignore_list = {},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@ local options = {
|
|||
syntax = "off",
|
||||
spelllang = "en_us",
|
||||
mousemodel = "popup_setpos",
|
||||
shell = "/usr/bin/zsh"
|
||||
shell = "/usr/bin/zsh",
|
||||
autochdir = true,
|
||||
}
|
||||
|
||||
vim.g.mkdp_browser = '/usr/bin/firefox'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue