feat: add better bindings

This commit is contained in:
Fabio Lenherr / DashieTM 2023-01-08 22:58:43 +01:00
parent a4cff9fca7
commit 6cbea80685
5 changed files with 37 additions and 5 deletions

View file

@ -1,5 +1,9 @@
{ {
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"Lua.diagnostics.globals": [
"termid",
"global"
],
"Lua.workspace.library": [ "Lua.workspace.library": [
"${3rd}/luassert/library" "${3rd}/luassert/library"
] ]

View file

@ -1,3 +1,6 @@
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
require("settings.plugins") require("settings.plugins")
require("settings.options") require("settings.options")
require("settings.cmp") require("settings.cmp")
@ -23,4 +26,7 @@ require("feline").setup()
require("impatient").enable_profile() require("impatient").enable_profile()
require("nightfox") require("nightfox")
require('Comment').setup() require('Comment').setup()
require("toggleterm").setup() require("toggleterm").setup({
autochdir = true,
})
require('leap').add_default_mappings()

View file

@ -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) keymap("n", "<F10>", ':lua require("dap").close()<CR> :lua require("dapui").toggle()<CR>', opts)
-- file tree -- file tree
keymap("n", "t", ":ToggleTerm<CR>", opts)
keymap("n", "f", ':lua require("nvim-tree").toggle()<CR>', opts) keymap("n", "f", ':lua require("nvim-tree").toggle()<CR>', opts)
-- toggle terminal
keymap('n', '<C-d>', ':ToggleTerm ZSH<CR>', opts)
-- tab switching -- tab switching
keymap("n", "<F1>", ":BufferPrev<CR>", opts) keymap("n", "<F1>", ":BufferPrev<CR>", opts)
keymap("n", "<F2>", ":BufferNext<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>gr", ":lua require('telescope.builtin').git_status()<CR>", opts)
keymap("n", "<leader>ga", ":lua require('telescope.builtin').git_stash()<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 -- harpoon man

View file

@ -26,9 +26,9 @@ nvim_tree.setup { -- BEGIN_DEFAULT_OPTS
sort_by = "name", sort_by = "name",
root_dirs = {}, root_dirs = {},
prefer_startup_root = false, prefer_startup_root = false,
sync_root_with_cwd = false, sync_root_with_cwd = true,
reload_on_bufenter = false, 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 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) remove_keymaps = false, -- boolean (disable totally or not) or list of key (lhs)
view = { view = {
@ -124,6 +124,7 @@ nvim_tree.setup { -- BEGIN_DEFAULT_OPTS
}, },
update_focused_file = { update_focused_file = {
enable = true, enable = true,
-- update_cwd = true,
update_root = false, update_root = false,
ignore_list = {}, ignore_list = {},
}, },

View file

@ -23,7 +23,8 @@ local options = {
syntax = "off", syntax = "off",
spelllang = "en_us", spelllang = "en_us",
mousemodel = "popup_setpos", mousemodel = "popup_setpos",
shell = "/usr/bin/zsh" shell = "/usr/bin/zsh",
autochdir = true,
} }
vim.g.mkdp_browser = '/usr/bin/firefox' vim.g.mkdp_browser = '/usr/bin/firefox'