diff --git a/home/.config/nvim/lua/colors/nord.lua b/home/.config/nvim/lua/colors/nord.lua index 7bec143..166eb4b 100644 --- a/home/.config/nvim/lua/colors/nord.lua +++ b/home/.config/nvim/lua/colors/nord.lua @@ -57,6 +57,16 @@ end -- Editor related groups local function highlight_editors() + -- Color groups for other uses + hi('Red', c.red, '', '', '') + hi('Green', c.green, '', '', '') + hi('Yellow', c.yellow, '', '', '') + hi('Blue', c.blue, '', '', '') + hi('Purple', c.purple, '', '', '') + hi('Cyan', c.cyan, '', '', '') + hi('Orange', c.orange, '', '', '') + hi('White', c.fg, '', '', '') + -- Attributes hi('Bold' , '', '', 'bold' , '') hi('Italic' , '', '', 'italic' , '') diff --git a/home/.config/nvim/lua/mappings.lua b/home/.config/nvim/lua/mappings.lua index 1440a97..98d1e08 100644 --- a/home/.config/nvim/lua/mappings.lua +++ b/home/.config/nvim/lua/mappings.lua @@ -42,6 +42,7 @@ wk.register({ [''] = {'l', 'Go to the right window'}, [''] = {'j', 'Go to the down window'}, [''] = {'k', 'Go to the up window'}, + [''] = {'q', 'Quit a window'}, -- Copy the whole buffer [''] = {'%y+', 'Copy whole buffer'}, @@ -238,6 +239,13 @@ wk.register({ n = {':NnnPicker %:p:h', 'File picker'}, + s = { + name = 'Find/Replace', + o = {':lua require("spectre").open()', 'Open spectre'}, + p = {'viw:lua require("spectre").open_file_search()', 'Search in current file'}, + w = {':lua require("spectre").open_visual({select_word = true})', 'Find/replace cursorword'}, + }, + -- Tab related t = { name = 'Tab', @@ -274,7 +282,9 @@ wk.register({ d = {':TransSelectDirection', 'Translate with direction'}, r = {'c=system(\'trans -brief -no-ansi\', getreg(""))[:-2]', 'Translate and replace'}, c = {'c=system(\'trans -brief -no-ansi :\', getreg(""))[:-2]', 'Translate and replace with direction'} - } + }, + + s = {':lua require("spectre").open_visual()', 'Find/Replace'} }, {mode = 'v', prefix = ''}) ------------------------ diff --git a/home/.config/nvim/lua/modules/completion.lua b/home/.config/nvim/lua/modules/completion.lua index c06dfe9..bee5d68 100644 --- a/home/.config/nvim/lua/modules/completion.lua +++ b/home/.config/nvim/lua/modules/completion.lua @@ -146,12 +146,12 @@ function M.snippets_conf() ext_opts = { [types.choiceNode] = { active = { - virt_text = {{'●', 'Number'}} + virt_text = {{'●', 'Orange'}} } }, [types.insertNode] = { active = { - virt_text = {{'●', 'Keyword'}} + virt_text = {{'●', 'Blue'}} } } } diff --git a/home/.config/nvim/lua/modules/lsp.lua b/home/.config/nvim/lua/modules/lsp.lua index 85f7b7d..80536a1 100644 --- a/home/.config/nvim/lua/modules/lsp.lua +++ b/home/.config/nvim/lua/modules/lsp.lua @@ -230,6 +230,11 @@ function M.lint_conf() end function M.dap_conf() + local dap = require('dap') + vim.fn.sign_define('DapBreakpoint', {text='', texthl='Red'}) + vim.fn.sign_define('DapLogPoint', {text='', texthl='Red'}) + vim.fn.sign_define('DapStopped', {text='', texthl='Red'}) + vim.fn.sign_define('DapBreakpointRejected', {text='ﱢ', texthl='Red'}) end function M.dapui_conf() diff --git a/home/.config/nvim/lua/modules/tools.lua b/home/.config/nvim/lua/modules/tools.lua index 46bb336..166081c 100644 --- a/home/.config/nvim/lua/modules/tools.lua +++ b/home/.config/nvim/lua/modules/tools.lua @@ -156,6 +156,10 @@ end function M.vimtex_conf() end +function M.spectre_conf() + require('spectre').setup() +end + function M.translate_conf() vim.g.trans_join_lines = 1 vim.g.trans_win_height = 15 diff --git a/home/.config/nvim/lua/plugins.lua b/home/.config/nvim/lua/plugins.lua index 8ccbec2..079b131 100644 --- a/home/.config/nvim/lua/plugins.lua +++ b/home/.config/nvim/lua/plugins.lua @@ -131,6 +131,10 @@ return require('packer').startup( keys = 'gc', config = editor.comment_conf } + use { + 'editorconfig/editorconfig-vim', + ft = {'go', 'rust', 'python', 'c', 'cpp', 'javascript', 'typescript', 'vim', 'zig'} + } --------- -- LSP -- @@ -170,7 +174,7 @@ return require('packer').startup( } use { -- TODO: config, scripts to install/update dap servers 'rcarriga/nvim-dap-ui', - keys = 'd', + event = 'BufReadPre', wants = 'nvim-dap', requires = {{'mfussenegger/nvim-dap', config = lsp.dap_conf, opt = true}}, config = lsp.dapui_conf @@ -331,6 +335,12 @@ return require('packer').startup( ft = 'tex', setup = tools.vimtext_conf } + use { + 'windwp/nvim-spectre', + event = {'BufRead', 'BufNewFile'}, + wants = 'plenary.nvim', + config = tools.spectre_conf + } use { 'echuraev/translate-shell.vim', cmd = {'Trans', 'TransSelectDirection'}, @@ -368,7 +378,7 @@ return require('packer').startup( } use {'tweekmonster/startuptime.vim', cmd = 'StartupTime'} -- Just for benchmarking - -- TODO: rest.nvim, parinfer.nvim, editorconfig.nvim, conjure, nvim-spectre, - -- dial.nvim, hotpot.nvim, rust-tools.nvim, crates.nvim, go.nvim + -- TODO: rest.nvim, parinfer.nvim, conjure, dial.nvim, hotpot.nvim, + -- rust-tools.nvim, crates.nvim, go.nvim end )