diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index 7b3c439..ce5fa5f 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -10,10 +10,11 @@ size = 11.0 family = "Input Mono" style = "Regular" + [font.offset] x = 0 y = 4 [window.padding] -x = 10 +x = 30 y = 10 diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 73851cd..0f0d3ff 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -11,15 +11,17 @@ require("user.blank_indent_highlight") require("user.autopairs") require("user.telescope") require("user.lsp_format") +require("user.neoscroll") +require("user.dropbar") require("user.bufferline") -require("user.null_ls") require("user.nvim_scrollbar") -require("user.onedark_config") require("user.gitsigns") require("user.lualine") require("user.dap.dap") require("user.dap.dapui") require("user.neotree") +require("user.which_key") +require("user.harpoon") vim.cmd("set cursorline") vim.cmd("colorscheme kanagawa") diff --git a/.config/nvim/lua/user/bufferline.lua b/.config/nvim/lua/user/bufferline.lua index 838efdb..ee9d19f 100644 --- a/.config/nvim/lua/user/bufferline.lua +++ b/.config/nvim/lua/user/bufferline.lua @@ -1,14 +1,18 @@ local status_ok, bufferline = pcall(require, "bufferline") + if not status_ok then return end + bufferline.setup({ options = { + mode = "tabs", offsets = { { filetype = "NvimTree", text = "", padding = 1 }, { filetype = "neo-tree", text = "", padding = 1 }, - { filetype = "Outline", text = "", padding = 1 }, + { filetype = "Outline", text = "", padding = 1 }, }, + style_preset = bufferline.style_preset.no_italic, buffer_close_icon = "", modified_icon = "", close_icon = "", diff --git a/.config/nvim/lua/user/cmp.lua b/.config/nvim/lua/user/cmp.lua index 7a8e650..be1345e 100644 --- a/.config/nvim/lua/user/cmp.lua +++ b/.config/nvim/lua/user/cmp.lua @@ -42,7 +42,6 @@ local kind_icons = { Operator = "", TypeParameter = "", } --- find more here: https://www.nerdfonts.com/cheat-sheet cmp.setup { snippet = { diff --git a/.config/nvim/lua/user/dap/dap.lua b/.config/nvim/lua/user/dap/dap.lua index d40edf2..f70ef13 100644 --- a/.config/nvim/lua/user/dap/dap.lua +++ b/.config/nvim/lua/user/dap/dap.lua @@ -25,14 +25,6 @@ dap.configurations.cs = { }, } -vim.keymap.set('n', 'dr', dap.continue) -vim.keymap.set('n', 'dj', dap.step_into) -vim.keymap.set('n', 'dl', dap.step_over) -vim.keymap.set('n', 'dk', dap.step_out) -vim.keymap.set('n', 'db', dap.toggle_breakpoint) -vim.keymap.set('n', 'ds', dap.terminate) - - --Autostart ui when debugging dap.listeners.after.event_initialized["dapui_config"] = function() dapui.open() diff --git a/.config/nvim/lua/user/dropbar.lua b/.config/nvim/lua/user/dropbar.lua new file mode 100644 index 0000000..4fcaff7 --- /dev/null +++ b/.config/nvim/lua/user/dropbar.lua @@ -0,0 +1,6 @@ +local null_ls_status_ok, breadcrumbs = pcall(require, "breadcrumbs") +if not null_ls_status_ok then + return +end + +breadcrumbs.setup() diff --git a/.config/nvim/lua/user/gitsigns.lua b/.config/nvim/lua/user/gitsigns.lua index f1e8524..21cca80 100644 --- a/.config/nvim/lua/user/gitsigns.lua +++ b/.config/nvim/lua/user/gitsigns.lua @@ -1,42 +1,42 @@ -require('gitsigns').setup { - signs = { - add = { hl = 'GitSignsAdd' , text = '│', numhl='GitSignsAddNr' , linehl='GitSignsAddLn' }, - change = { hl = 'GitSignsChange', text = '│', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn' }, - delete = { hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn' }, - topdelete = { hl = 'GitSignsDelete', text = '‾', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn' }, - changedelete = { hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn' }, - untracked = { hl = 'GitSignsAdd' , text = '┆', numhl='GitSignsAddNr' , linehl='GitSignsAddLn' }, - }, - signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` - numhl = false, -- Toggle with `:Gitsigns toggle_numhl` - linehl = false, -- Toggle with `:Gitsigns toggle_linehl` - word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` - watch_gitdir = { - interval = 1000, - follow_files = true - }, - attach_to_untracked = true, - current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` - current_line_blame_opts = { - virt_text = true, - virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' - delay = 1000, - ignore_whitespace = false, - }, - current_line_blame_formatter = ', - ', - sign_priority = 6, - update_debounce = 100, - status_formatter = nil, -- Use default - max_file_length = 40000, -- Disable if file is longer than this (in lines) - preview_config = { - -- Options passed to nvim_open_win - border = 'single', - style = 'minimal', - relative = 'cursor', - row = 0, - col = 1 - }, - yadm = { - enable = false - }, -} +require("gitsigns").setup({ + signs = { + add = { hl = "GitSignsAdd", text = "│", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, + change = { hl = "GitSignsChange", text = "│", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, + delete = { hl = "GitSignsDelete", text = "_", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, + topdelete = { hl = "GitSignsDelete", text = "‾", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, + changedelete = { hl = "GitSignsChange", text = "~", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, + untracked = { hl = "GitSignsAdd", text = "┆", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, + }, + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = false, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + watch_gitdir = { + interval = 1000, + follow_files = true, + }, + attach_to_untracked = true, + current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` + current_line_blame_opts = { + virt_text = true, + virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + ignore_whitespace = false, + }, + current_line_blame_formatter = ", - ", + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, -- Disable if file is longer than this (in lines) + preview_config = { + -- Options passed to nvim_open_win + border = "single", + style = "minimal", + relative = "cursor", + row = 0, + col = 1, + }, + yadm = { + enable = false, + }, +}) diff --git a/.config/nvim/lua/user/harpoon.lua b/.config/nvim/lua/user/harpoon.lua new file mode 100644 index 0000000..a4fe33e --- /dev/null +++ b/.config/nvim/lua/user/harpoon.lua @@ -0,0 +1,40 @@ +local null_ls_status_ok, harpoon = pcall(require, "harpoon") +if not null_ls_status_ok then + return +end + +-- REQUIRED +harpoon:setup() +-- REQUIRED + +vim.keymap.set("n", "a", function() harpoon:list():append() end) +vim.keymap.set("n", "hm", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) + +vim.keymap.set("n", "", function() harpoon:list():select(1) end) +vim.keymap.set("n", "", function() harpoon:list():select(2) end) +vim.keymap.set("n", "", function() harpoon:list():select(3) end) +vim.keymap.set("n", "", function() harpoon:list():select(4) end) + +-- Toggle previous & next buffers stored within Harpoon list +vim.keymap.set("n", "hp", function() harpoon:list():prev() end) +vim.keymap.set("n", "hn", function() harpoon:list():next() end) + +local conf = require("telescope.config").values +local function toggle_telescope(harpoon_files) + local file_paths = {} + for _, item in ipairs(harpoon_files.items) do + table.insert(file_paths, item.value) + end + + require("telescope.pickers").new({}, { + prompt_title = "Harpoon", + finder = require("telescope.finders").new_table({ + results = file_paths, + }), + previewer = conf.file_previewer({}), + sorter = conf.generic_sorter({}), + }):find() +end + +vim.keymap.set("n", "", function() toggle_telescope(harpoon:list()) end, + { desc = "Open harpoon window" }) diff --git a/.config/nvim/lua/user/keymaps.lua b/.config/nvim/lua/user/keymaps.lua index 35c0a68..049c011 100644 --- a/.config/nvim/lua/user/keymaps.lua +++ b/.config/nvim/lua/user/keymaps.lua @@ -29,7 +29,6 @@ keymap("v", "p", '"_dP', opts) keymap("v", "<", "", ">gv", opts) - -- center view for different commands keymap("n", "n", "nzz", opts) keymap("n", "N", "Nzz", opts) @@ -45,22 +44,9 @@ keymap("x", "K", ":move '<-2gv-gv", opts) keymap("x", "", ":move '>+1gv-gv", opts) keymap("x", "", ":move '<-2gv-gv", opts) --- Navigate buffers -keymap("n", "", ":bnext", opts) -keymap("n", "", ":bprevious", opts) +-- Navigate tabs +keymap("n", "", ":tabnext", opts) +keymap("n", "", ":tabprevious", opts) --Close buffer -keymap("n", "", ":bd | bp ", opts) - ---Format document -keymap("n", "F", ":lua vim.lsp.buf.format() ", opts) - -keymap("n", "ff", - "lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))", - opts) -keymap("n", "fw", - "lua require'telescope.builtin'.live_grep()", - opts) - - -keymap("n", "e", ":Neotree toggle ", opts) +-- keymap("n", "", ":bd | bp ", opts) diff --git a/.config/nvim/lua/user/lsp/init.lua b/.config/nvim/lua/user/lsp/init.lua index bc83d62..050c086 100644 --- a/.config/nvim/lua/user/lsp/init.lua +++ b/.config/nvim/lua/user/lsp/init.lua @@ -16,22 +16,6 @@ end mason.setup() mason_lspconfig.setup() -local opts = { noremap = true, silent = true } - -vim.api.nvim_set_keymap("n", "gD", "lua vim.lsp.buf.declaration()", opts) -vim.api.nvim_set_keymap("n", "gd", "lua vim.lsp.buf.definition()", opts) -vim.api.nvim_set_keymap("n", "K", "lua vim.lsp.buf.hover()", opts) -vim.api.nvim_set_keymap("n", "gi", "lua vim.lsp.buf.implementation()", opts) -vim.api.nvim_set_keymap("n", "", "lua vim.lsp.buf.signature_help()", opts) -vim.api.nvim_set_keymap("n", "grr", "lua vim.lsp.buf.rename()", opts) -vim.api.nvim_set_keymap("n", "gr", "lua vim.lsp.buf.references()", opts) -vim.api.nvim_set_keymap("n", "ca", "lua vim.lsp.buf.code_action()", opts) --- vim.api.nvim_buf_set_keymap("n", "f", "lua vim.diagnostic.open_float()", opts) -vim.api.nvim_set_keymap("n", "[d", 'lua vim.diagnostic.goto_prev({ border = "rounded" })', opts) -vim.api.nvim_set_keymap("n", "gl", 'lua vim.diagnostic.open_float({ border = "rounded" })', opts) -vim.api.nvim_set_keymap("n", "]d", 'lua vim.diagnostic.goto_next({ border = "rounded" })', opts) -vim.api.nvim_set_keymap("n", "q", "lua vim.diagnostic.setloclist()", opts) - vim.cmd([[ command! Format execute 'lua vim.lsp.buf.format{async=true}' ]]) require("user.lsp.mason_lsp_config") diff --git a/.config/nvim/lua/user/neoscroll.lua b/.config/nvim/lua/user/neoscroll.lua new file mode 100644 index 0000000..71faf00 --- /dev/null +++ b/.config/nvim/lua/user/neoscroll.lua @@ -0,0 +1,26 @@ +require("neoscroll").setup({ + -- All these keys will be mapped to their corresponding default scrolling animation + mappings = { "", "", "", "", "", "", "zt", "zz", "zb" }, + hide_cursor = true, -- Hide cursor while scrolling + stop_eof = true, -- Stop at when scrolling downwards + respect_scrolloff = false, -- Stop scrolling when the cursor reaches the scrolloff margin of the file + cursor_scrolls_alone = true, -- The cursor will keep on scrolling even if the window cannot scroll further + easing_function = nil, -- Default easing function + pre_hook = nil, -- Function to run before the scrolling animation starts + post_hook = nil, -- Function to run after the scrolling animation ends + performance_mode = false, -- Disable "Performance Mode" on all buffers. +}) + +local t = {} +-- Syntax: t[keys] = {function, {function arguments}} +t[''] = {'scroll', {'-vim.wo.scroll', 'true', '250'}} +t[''] = {'scroll', { 'vim.wo.scroll', 'true', '250'}} +t[''] = {'scroll', {'-vim.api.nvim_win_get_height(0)', 'true', '450'}} +t[''] = {'scroll', { 'vim.api.nvim_win_get_height(0)', 'true', '450'}} +t[''] = {'scroll', {'-0.10', 'false', '100'}} +t[''] = {'scroll', { '0.10', 'false', '100'}} +t['zt'] = {'zt', {'250'}} +t['zz'] = {'zz', {'250'}} +t['zb'] = {'zb', {'250'}} + +require('neoscroll.config').set_mappings(t) diff --git a/.config/nvim/lua/user/neotree.lua b/.config/nvim/lua/user/neotree.lua index ad81d8f..c79e7fa 100644 --- a/.config/nvim/lua/user/neotree.lua +++ b/.config/nvim/lua/user/neotree.lua @@ -69,5 +69,13 @@ require("neo-tree").setup({ { source = "git_status", display_name = " 󰊢 Git " }, }, }, - -- Other options ... + + event_handlers = { + { + event = "neo_tree_buffer_enter", + handler = function(arg) + vim.opt.relativenumber = true + end, + } + }, }) diff --git a/.config/nvim/lua/user/null_ls.lua b/.config/nvim/lua/user/none_ls.lua similarity index 71% rename from .config/nvim/lua/user/null_ls.lua rename to .config/nvim/lua/user/none_ls.lua index a02197d..78c0b23 100644 --- a/.config/nvim/lua/user/null_ls.lua +++ b/.config/nvim/lua/user/none_ls.lua @@ -3,9 +3,7 @@ if not null_ls_status_ok then return end --- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting local formatting = null_ls.builtins.formatting --- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics local diagnostics = null_ls.builtins.diagnostics null_ls.setup({ diff --git a/.config/nvim/lua/user/onedark_config.lua b/.config/nvim/lua/user/onedark_config.lua deleted file mode 100644 index b88bd53..0000000 --- a/.config/nvim/lua/user/onedark_config.lua +++ /dev/null @@ -1,8 +0,0 @@ -require("onedark").setup({ - style = "darker", - transparent = true, - highlights = { - NvimTreeWinSeparator = {fg ='#aaaaa'} - } -}) -require("onedark").load() diff --git a/.config/nvim/lua/user/options.lua b/.config/nvim/lua/user/options.lua index 432fa24..6678fca 100644 --- a/.config/nvim/lua/user/options.lua +++ b/.config/nvim/lua/user/options.lua @@ -4,7 +4,7 @@ vim.opt.completeopt = { "menuone", "noselect" } vim.opt.showmode = false vim.opt.fileencoding = "utf-8" vim.opt.ignorecase = true -vim.opt.showtabline = 2 +vim.opt.showtabline = 1 vim.opt.pumblend = 5 vim.opt.smartindent = true vim.opt.smartcase = true diff --git a/.config/nvim/lua/user/plugins.lua b/.config/nvim/lua/user/plugins.lua index bdee408..04d8581 100644 --- a/.config/nvim/lua/user/plugins.lua +++ b/.config/nvim/lua/user/plugins.lua @@ -70,8 +70,13 @@ lazy.setup({ { "akinsho/bufferline.nvim", - tag = "v2.*", - dependencies = {"kyazdani42/nvim-web-devicons"}, + version = "*", + dependencies = { "kyazdani42/nvim-web-devicons" }, + }, + { + "ThePrimeagen/harpoon", + branch = "harpoon2", + dependencies = { "nvim-lua/plenary.nvim" }, }, { @@ -100,6 +105,14 @@ lazy.setup({ lazy = false, priority = 1000, }, + { + "folke/which-key.nvim", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 500 + end, + lazy = false, + }, --scrollbar "petertriho/nvim-scrollbar", @@ -118,14 +131,21 @@ lazy.setup({ "folke/neodev.nvim", "MunifTanjim/nui.nvim", - "b0o/schemastore.nvim" + "b0o/schemastore.nvim", + -- { + -- 'Bekaboo/dropbar.nvim', + -- -- optional, but required for fuzzy finder support + -- dependencies = { + -- 'nvim-telescope/telescope-fzf-native.nvim' + -- } + -- }, + { + "LunarVim/breadcrumbs.nvim", + dependencies = { + { "SmiteshP/nvim-navic" }, + }, + }, + { + "karb94/neoscroll.nvim", + }, }) - --- vim.cmd([[ --- augroup packer_user_config --- autocmd! --- autocmd BufWritePost plugins.lua source | PackerSync --- augroup end --- ]]) - --- Use a protected call so we don't error out on first use diff --git a/.config/nvim/lua/user/telescope.lua b/.config/nvim/lua/user/telescope.lua index e13b658..7d4df9c 100644 --- a/.config/nvim/lua/user/telescope.lua +++ b/.config/nvim/lua/user/telescope.lua @@ -3,11 +3,11 @@ if not status_ok then return end -telescope.load_extension('media_files') +telescope.load_extension("media_files") -local actions = require "telescope.actions" +local actions = require("telescope.actions") -telescope.setup { +telescope.setup({ defaults = { file_ignore_patterns = { "node_modules", "venv" }, prompt_prefix = " ", @@ -93,12 +93,12 @@ telescope.setup { -- filetypes whitelist -- defaults to {"png", "jpg", "mp4", "webm", "pdf"} filetypes = { "png", "webp", "jpg", "jpeg" }, - find_cmd = "rg" -- find command (defaults to `fd`) - } + find_cmd = "rg", -- find command (defaults to `fd`) + }, -- Your extension configuration goes here: -- extension_name = { -- extension_config_key = value, -- } -- please take a look at the readme of the extension you want to configure }, -} +}) diff --git a/.config/nvim/lua/user/themes/kanagawa.lua b/.config/nvim/lua/user/themes/kanagawa.lua index 7ca1787..94de5c2 100644 --- a/.config/nvim/lua/user/themes/kanagawa.lua +++ b/.config/nvim/lua/user/themes/kanagawa.lua @@ -17,10 +17,6 @@ require("kanagawa").setup({ overrides = function(colors) -- add/modify highlights local theme = colors.theme return { - Pmenu = { fg = theme.ui.shade0, bg = theme.ui.bg_p1, blend = vim.o.pumblend }, -- add `blend = vim.o.pumblend` to enable transparency - PmenuSel = { fg = "NONE", bg = theme.ui.bg_p2 }, - PmenuSbar = { bg = theme.ui.bg_m1 }, - PmenuThumb = { bg = theme.ui.bg_p2 }, CursorLine = { bg = "#272735" }, } end, diff --git a/.config/nvim/lua/user/which_key.lua b/.config/nvim/lua/user/which_key.lua new file mode 100644 index 0000000..5e53268 --- /dev/null +++ b/.config/nvim/lua/user/which_key.lua @@ -0,0 +1,183 @@ +local status_ok, which_key = pcall(require, "which-key") +if not status_ok then + return +end + +which_key.setup({ + plugins = { + marks = false, -- shows a list of your marks on ' and ` + registers = false, -- shows your registers on " in NORMAL or in INSERT mode + spelling = { + enabled = true, + suggestions = 20, + }, -- use which-key for spelling hints + -- the presets plugin, adds help for a bunch of default keybindings in Neovim + -- No actual key bindings are created + presets = { + operators = false, -- adds help for operators like d, y, ... + motions = false, -- adds help for motions + text_objects = false, -- help for text objects triggered after entering an operator + windows = false, -- default bindings on + nav = false, -- misc bindings to work with windows + z = false, -- bindings for folds, spelling and others prefixed with z + g = false, -- bindings for prefixed with g + }, + }, + -- add operators that will trigger motion and text object completion + -- to enable all native operators, set the preset / operators plugin above + operators = { gc = "Comments" }, + key_labels = { + -- override the label used to display some keys. It doesn't effect WK in any other way. + -- For example: + -- [""] = "SPC", + -- [""] = "RET", + -- [""] = "TAB", + }, + popup_mappings = { + scroll_down = "", -- binding to scroll down inside the popup + scroll_up = "", -- binding to scroll up inside the popup + }, + window = { + border = "single", -- none, single, double, shadow + position = "bottom", -- bottom, top + margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left] + padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left] + winblend = 0, + }, + layout = { + height = { min = 4, max = 25 }, -- min and max height of the columns + width = { min = 20, max = 50 }, -- min and max width of the columns + spacing = 3, -- spacing between columns + align = "left", -- align columns left, center or right + }, + ignore_missing = true, -- enable this to hide mappings for which you didn't specify a label + hidden = { "", "", "", "", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate + show_help = true, -- show help message on the command line when the popup is visible + show_keys = true, -- show the currently pressed key and its label as a message in the command line + triggers = "auto", -- automatically setup triggers + -- triggers = {""} -- or specify a list manually + triggers_blacklist = { + -- list of mode / prefixes that should never be hooked by WhichKey + -- this is mostly relevant for key maps that start with a native binding + -- most people should not need to change this + i = { "j", "k" }, + v = { "j", "k" }, + }, + -- disable the WhichKey popup for certain buf types and file types. + -- Disabled by default for Telescope + disable = { + buftypes = {}, + filetypes = { "TelescopePrompt" }, + }, +}) + +which_key.register({ + name = "Hotkeys", + e = { + ":Neotree toggle ", + "File tree toggle", + }, + F = { + ":lua vim.lsp.buf.format() ", + "Format file", + }, + f = { + name = "Find", + f = { + "lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))", + "Find file", + }, + w = { + "lua require'telescope.builtin'.live_grep()", + "Grep file", + }, + b = { + "lua require'telescope.builtin'.buffers()", + "Find buffer", + }, + }, + c = { + name = "Code actions", + a = { + "lua vim.lsp.buf.code_action()", + "Show code actions", + }, + }, + l = { + "lua vim.diagnostic.setloclist()", + "Show diagnostic list", + }, + d = { + name = "DAP", + r = { + "DapContinue", + "DapContinue", + }, + j = { + "DapStepInto", + "StepInto", + }, + l = { + "DapStepOver", + "StepOver", + }, + k = { + "DapStepOut", + "StepOut", + }, + b = { + "DapToggleBreakpoint", + "Toggle breakpoint", + }, + s = { + "DapTerminate", + "Terminate", + }, + }, + t = { + name = "Tabs", + n = { + "tabnew", + "New tab", + }, + q = { + "tabclose", + "Close tab", + }, + }, +}, { prefix = "" }) + +which_key.register({ + name = "LSP Actions", + D = { + "lua vim.lsp.buf.declaration()", + "Go to declaration", + }, + d = { + "lua vim.lsp.buf.definition()", + "Go to definition", + }, + i = { + "lua vim.lsp.buf.implementation()", + "Show implementations", + }, + rr = { + "lua vim.lsp.buf.rename()", + "Rename", + }, + r = { + "lua vim.lsp.buf.references()", + "Show references", + }, + l = { + "lua vim.diagnostic.open_float({ border = 'rounded' })", + "Show diagnostic at line", + }, +}, { prefix = "g" }) + +which_key.register({ + [""] = { + "lua vim.lsp.buf.signature_help()", + "Signature help", + }, +}, {}) diff --git a/.zshrc b/.zshrc index 11f0381..309746e 100644 --- a/.zshrc +++ b/.zshrc @@ -99,7 +99,7 @@ source $ZSH/oh-my-zsh.sh # Example aliases # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh" -alias vim="nvim" +alias v="nvim" alias config="/usr/bin/git --git-dir=$HOME/dotfiles/ --work-tree=$HOME" export PATH=/home/nikita/.local/bin:$PATH