diff --git a/config/nvim/lua/plugins/lazy.lua b/config/nvim/lua/plugins/lazy.lua index c587307..5026be2 100644 --- a/config/nvim/lua/plugins/lazy.lua +++ b/config/nvim/lua/plugins/lazy.lua @@ -69,32 +69,6 @@ return { event = 'VeryLazy', }, - -- fzf <3 vim - -- https://github.com/junegunn/fzf.vim - { - 'junegunn/fzf.vim', - dependencies = { - { 'junegunn/fzf', run = ':call fzf#install()' }, - }, - config = function() - require('fzf').setup { - winopts = { - win_height = 0.85, - win_width = 0.85, - }, - } - end, - opts = { - -- To ignore a certain path in a git project from both RG and FD used by FZF, - -- the eaiest way is to create ignore files and exclude the in local git clone. - -- Ref: https://stackoverflow.com/a/1753078/265508 - -- $ cd git_proj/ - -- $ echo "path/to/exclude" > .rgignore - -- $ echo "path/to/exclude" > .fdignore - -- $ printf ".rgignore\n.fdignore" >> .git/info/exclude - }, - }, - -- Highlight, list and search todo comments in your projects -- https://github.com/folke/todo-comments.nvim { diff --git a/config/nvim/lua/plugins/lsp.lua b/config/nvim/lua/plugins/lsp.lua index e3bbf5f..4c0976e 100644 --- a/config/nvim/lua/plugins/lsp.lua +++ b/config/nvim/lua/plugins/lsp.lua @@ -46,9 +46,9 @@ return { -- Easily install and manage LSP servers, DAP servers, linters, -- and formatters. -- https://github.com/williamboman/mason.nvim - { 'williamboman/mason.nvim', opts = {} }, - { 'williamboman/mason-lspconfig.nvim', opts = {} }, - { 'WhoIsSethDaniel/mason-tool-installer.nvim', opts = {} }, + { 'williamboman/mason.nvim' }, + { 'williamboman/mason-lspconfig.nvim' }, + { 'WhoIsSethDaniel/mason-tool-installer.nvim' }, -- ── Linting ───────────────────────────────────────────────────────── -- An asynchronous linter plugin for Neovim complementary to the @@ -92,6 +92,8 @@ return { vim.lsp.buf.format() elseif vim.lsp.buf.formatting then vim.lsp.buf.formatting() + else + require('conform').format { async = true, lsp_fallback = true } end end, { desc = 'Format current buffer with LSP' }) end diff --git a/config/nvim/lua/plugins/telescope.lua b/config/nvim/lua/plugins/telescope.lua index fb4249b..057d50d 100644 --- a/config/nvim/lua/plugins/telescope.lua +++ b/config/nvim/lua/plugins/telescope.lua @@ -28,15 +28,6 @@ return { t.setup { defaults = { layout_strategy = 'horizontal', - layout_config = { - preview_width = 0.65, - horizontal = { - size = { - width = '95%', - height = '95%', - }, - }, - }, pickers = { find_files = { theme = 'dropdown', @@ -63,22 +54,6 @@ return { -- See `:help telescope.builtin` -- See `:help telescope.keymap` local b = require 'telescope.builtin' - - local wk = require 'which-key' - wk.add { - { '', b.buffers, desc = '[ ] Find existing buffers' }, - { '', "lua require('telescope.builtin').commands()", desc = 'Telescope: Commands' }, - { 'sS', b.git_status, desc = 'Git Status' }, - { 'sd', b.diagnostics, desc = 'Search Diagnostics' }, - { 'sf', b.find_files, desc = 'Search Files' }, - { 'sg', b.live_grep, desc = 'Search by Grep' }, - { 'sm', ':Telescope harpoon marks', desc = 'Harpoon Marks' }, - { 'sn', "lua require('telescope').extensions.notify.notify()", desc = 'Notify' }, - { 'so', b.oldfiles, desc = 'Find recently Opened files' }, - { 'st', ':TodoTelescope', desc = 'Telescope: Todo' }, - { 'sw', b.grep_string, desc = 'Search current Word' }, - } - vim.keymap.set('n', '/', function() -- You can pass additional configuration to telescope to change theme, layout, etc. b.current_buffer_fuzzy_find(themes.get_dropdown { diff --git a/config/nvim/lua/plugins/which-key.lua b/config/nvim/lua/plugins/which-key.lua index a235b19..05a5cde 100644 --- a/config/nvim/lua/plugins/which-key.lua +++ b/config/nvim/lua/plugins/which-key.lua @@ -23,15 +23,16 @@ return { 'b', group = '[b] Buffer', expand = function() + -- Add the current buffers to the menu return require('which-key.extras').expand.buf() end, }, - { 'bk', ':blast', desc = 'Buffer: Last', mode = 'n' }, - { 'bj', ':bfirst', desc = 'Buffer: First', mode = 'n' }, - { 'bh', ':bprev', desc = 'Buffer: Prev', mode = 'n' }, - { 'bl', ':bnext', desc = 'Buffer: Next', mode = 'n' }, - { 'bd', ':Bdelete', desc = 'Buffer: Delete', mode = 'n' }, - { 'bw', ':Bwipeout', desc = 'Buffer: Wipeout', mode = 'n' }, + { 'bk', 'blast', desc = 'Buffer: Last', mode = 'n' }, + { 'bj', 'bfirst', desc = 'Buffer: First', mode = 'n' }, + { 'bh', 'bprev', desc = 'Buffer: Prev', mode = 'n' }, + { 'bl', 'bnext', desc = 'Buffer: Next', mode = 'n' }, + { 'bd', 'Bdelete', desc = 'Buffer: Delete', mode = 'n' }, + { 'bw', 'Bwipeout', desc = 'Buffer: Wipeout', mode = 'n' }, -- ── Code ──────────────────────────────────────────────────────────── { 'c', group = '[c] Code' }, @@ -78,7 +79,7 @@ return { { 'dc', 'DapContinue', desc = 'DAP: Continue' }, { 'do', 'lua vim.diagnostic.open_float()', desc = 'Diagnostic: Open float' }, { 'dq', 'lua vim.diagnostic.setloclist()', desc = 'Diagnostic: Set loc list' }, - { 'dr', ":lua require('dapui').open({reset = true})", desc = 'DAP: Reset' }, + { 'dr', "lua require('dapui').open({reset = true})", desc = 'DAP: Reset' }, { 'ds', 'lua require("telescope.builtin").lsp_document_symbols()', desc = 'LSP: Document Symbols' }, { 'dt', 'DapUiToggle', desc = 'DAP: Toggle UI' }, @@ -88,7 +89,7 @@ return { { 'ha', 'lua require("harpoon"):list():add()', desc = 'harpoon file' }, { 'hn', 'lua require("harpoon"):list():next()', desc = 'harpoon to next file' }, { 'hp', 'lua require("harpoon"):list():prev()', desc = 'harpoon to previous file' }, - { 'ht', ":lua require('harpoon.ui').toggle_quick_menu()", desc = 'DAP: Harpoon UI' }, + { 'ht', "lua require('harpoon.ui').toggle_quick_menu()", desc = 'DAP: Harpoon UI' }, -- ── LSP ───────────────────────────────────────────────────────────── { 'l', group = '[l] LSP' }, @@ -96,20 +97,31 @@ return { -- ── Quit ──────────────────────────────────────────────────────────── { 'q', group = '[q] Quit' }, - { 'qf', ':q', desc = 'Quicker close split' }, - { 'qq', ':wq!', desc = 'Quit with force saving' }, - { 'qw', ':wq', desc = 'Write and quit' }, + { 'qf', 'q', desc = 'Quicker close split' }, + { 'qq', 'wq!', desc = 'Quit with force saving' }, + { 'qw', 'wq', desc = 'Write and quit' }, -- ── Search ────────────────────────────────────────────────────────── { 's', group = '[s] Search' }, -- See: lua/plugins/telescope.lua + { '', "lua require('telescope.builtin').buffers()", desc = 'Find existing buffers' }, + { '', "lua require('telescope.builtin').commands()", desc = 'Telescope: Commands' }, + { 'sS', "lua require('telescope.builtin').git_status()", desc = 'Git Status' }, + { 'sd', "lua require('telescope.builtin').diagnostics()", desc = 'Search Diagnostics' }, + { 'sf', "lua require('telescope.builtin').find_files()", desc = 'Search Files' }, + { 'sg', "lua require('telescope.builtin').live_grep()", desc = 'Search by Grep' }, + { 'sm', 'Telescope harpoon marks', desc = 'Harpoon Marks' }, + { 'sn', "lua require('telescope').extensions.notify.notify()", desc = 'Notify' }, + { 'so', "lua require('telescope.builtin').oldfiles()", desc = 'Find recently Opened files' }, + { 'st', 'TodoTelescope', desc = 'Telescope: Todo' }, + { 'sw', "lua require('telescope.builtin').grep_string()", desc = 'Search current Word' }, -- ── Toggle ────────────────────────────────────────────────────────── { 't', group = '[t] Toggle' }, { 'tc', 'CloakToggle', desc = 'Toggle Cloak' }, - { 'tn', ':Noice dismiss', desc = 'Noice dismiss' }, - { 'ts', ':noh', desc = 'Toggle Search Highlighting' }, - { 'tt', ':TransparentToggle', desc = 'Toggle Transparency' }, + { 'tn', 'Noice dismiss', desc = 'Noice dismiss' }, + { 'ts', 'noh', desc = 'Toggle Search Highlighting' }, + { 'tt', 'TransparentToggle', desc = 'Toggle Transparency' }, { 'tw', 'Twilight', desc = 'Toggle Twilight' }, -- ── Workspace ─────────────────────────────────────────────────────── @@ -119,7 +131,7 @@ return { { 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', desc = 'LSP: Workspace Remove Folder' }, { 'ws', 'lua require("telescope.builtin").lsp_dynamic_workspace_symbols()', desc = 'LSP: Workspace Symbols' }, - -- Trouble + -- ── Trouble ───────────────────────────────────────────────────────── { 'x', group = '[x] Trouble' }, { 'xx', 'Trouble', desc = 'Toggle Trouble' }, { 'xw', 'Trouble workspace_diagnostics', desc = 'Toggle Workspace Diagnostics' }, @@ -127,19 +139,6 @@ return { { 'xl', 'Trouble loclist', desc = 'Toggle Loclist' }, { 'xq', 'Trouble quickfix', desc = 'Toggle Quickfix' }, - -- ── FZF ───────────────────────────────────────────────────────────── - { 'z', group = '[z] FZF' }, - -- Stolen from https://github.com/erikw/dotfiles/blob/d68d6274d67ac47afa20b9a0b9f3b0fa54bcdaf3/.config/nvim/lua/plugins.lua - { 'zf', ':FZF', desc = 'FZF: search for files in given path.' }, - { 'zc', ':Commands', desc = 'FZF: search commands.' }, - { 'zt', ':Tags', desc = 'FZF: search in tags file' }, - { 'zb', ':Buffers', desc = 'FZF: search open buffers.' }, - -- Ref: https://medium.com/@paulodiovani/vim-buffers-windows-and-tabs-an-overview-8e2a57c57afa - { 'zt', ':Windows', desc = 'FZF: search open tabs.' }, - { 'zh', ':History', desc = 'FZF: search history of opened files' }, - { 'zm', ':Maps', desc = 'FZF: search mappings.' }, - { 'zg', ':Rg', desc = 'FZF: search with rg (aka live grep).' }, - -- ── Help & Neoconf ────────────────────────────────────────────────── { '?', group = '[?] Help & neoconf' }, { '?c', 'Neoconf', desc = 'Neoconf: Open' }, @@ -156,7 +155,7 @@ return { { '4', 'lua require("harpoon"):list():select(4)', desc = 'harpoon to file 4' }, { '5', 'lua require("harpoon"):list():select(5)', desc = 'harpoon to file 5' }, { 'D', 'lua vim.lsp.buf.type_definition()', desc = 'LSP: Type Definition' }, - { 'e', ':Neotree reveal', desc = 'NeoTree reveal' }, + { 'e', 'Neotree reveal', desc = 'NeoTree reveal' }, -- ╭─────────────────────────────────────────────────────────╮ -- │ Without leader │ @@ -176,13 +175,16 @@ return { { '', 'TmuxNavigatePrevious', desc = 'tmux: Navigate Previous' }, -- ── Old habits ────────────────────────────────────────────────────── - { '', ':w', desc = 'Save file' }, + { '', 'w', desc = 'Save file' }, -- ── Text manipulation in visual mode ──────────────────────────────── - { '>', '>gv', desc = 'Indent Right', mode = 'v' }, - { '<', '+1gv=gv", desc = 'Move Block Down', mode = 'v' }, - { 'K', ":m '<-2gv=gv", desc = 'Move Block Up', mode = 'v' }, + { + mode = 'v', + { '>', '>gv', desc = 'Indent Right' }, + { '<', 'm '>+1gv=gv", desc = 'Move Block Down' }, + { 'K', "m '<-2gv=gv", desc = 'Move Block Up' }, + }, -- ── LSP ───────────────────────────────────────────────────────────── { '', 'lua vim.lsp.buf.signature_help()', desc = 'LSP: Signature Documentation' }, @@ -197,10 +199,10 @@ return { -- ── Misc keybinds ─────────────────────────────────────────────────── -- Sublime-like shortcut 'go to file' ctrl+p. - { '', ':Files', desc = 'FZF: search for files starting at current directory.' }, - { 'QQ', ':q!', desc = 'Quit without saving' }, - { 'WW', ':w!', desc = 'Force write to file' }, - { 'ss', ':noh', desc = 'Clear Search Highlighting' }, + { '', 'Telescope find_files', desc = 'Search for files starting at current directory.' }, + { 'QQ', 'q!', desc = 'Quit without saving' }, + { 'WW', 'w!', desc = 'Force write to file' }, + { 'ss', 'noh', desc = 'Clear Search Highlighting' }, { 'jj', '', desc = 'Esc without touching esc in insert mode', mode = 'i' }, -- ── Splits ────────────────────────────────────────────────────────── @@ -211,8 +213,8 @@ return { { '', '', desc = 'Move focus to the lower window' }, { '', '', desc = 'Move focus to the upper window' }, -- Split resizing - { ',', ':vertical resize -10', desc = 'V Resize -' }, - { '.', ':vertical resize +10', desc = 'V Resize +' }, + { ',', 'vertical resize -10', desc = 'V Resize -' }, + { '.', 'vertical resize +10', desc = 'V Resize +' }, -- ── Disable arrow keys in normal mode ─────────────────────────────── { '', 'echo "Use h to move!!"' }, @@ -231,7 +233,7 @@ return { -- ── Search ────────────────────────────────────────────────────────── -- :noh if you have search highlights - { '', ':noh', desc = 'Clear search highlights' }, + { '', 'noh', desc = 'Clear search highlights' }, } end, } diff --git a/config/nvim/spell/en.utf-8.add b/config/nvim/spell/en.utf-8.add index 9bc4fb4..1af523c 100644 --- a/config/nvim/spell/en.utf-8.add +++ b/config/nvim/spell/en.utf-8.add @@ -111,3 +111,7 @@ github Tampere Logrotate sysvinit +Noice +fzf +linters +LSPConfig diff --git a/config/nvim/spell/en.utf-8.add.spl b/config/nvim/spell/en.utf-8.add.spl index 28e7192..02aae5a 100644 Binary files a/config/nvim/spell/en.utf-8.add.spl and b/config/nvim/spell/en.utf-8.add.spl differ