diff --git a/home/.config/nvim/lua/colors/nord.lua b/home/.config/nvim/lua/colors/nord.lua index 8930447..7bec143 100644 --- a/home/.config/nvim/lua/colors/nord.lua +++ b/home/.config/nvim/lua/colors/nord.lua @@ -65,7 +65,7 @@ local function highlight_editors() -- Editor hi('ColorColumn', '' , c.grey1, '', '') hi('Cursor' , c.black , c.fg , '', '') - hi('CursorLine' , c.grey1 , '' , '', '') + hi('CursorLine' , '' , c.grey1, '', '') hi('Error' , c.fg , c.red , '', '') hi('iCursor' , c.black , c.fg , '', '') hi('LineNr' , c.grey3 , '' , '', '') @@ -87,10 +87,10 @@ local function highlight_editors() hi('healthError' , c.red , c.grey1, '', '') hi('healthSuccess', c.green , c.grey1, '', '') hi('healthWarning', c.yellow, c.grey1, '', '') - hi('TermCursorNC' , '' , c.grey2, '', '') + hi('TermCursorNC' , '' , c.grey1, '', '') -- Gutter - hi('CursorColumn', c.grey1, '' , '', '') + hi('CursorColumn', '' , c.grey1, '', '') hi('CursorLineNr', c.fg , '' , '', '') hi('Folded' , c.grey3, c.grey1, '', '') hi('FoldColumn' , c.grey3, c.black, '', '') @@ -294,6 +294,10 @@ local function highlight_plugins() hi('HopNextKey2', c.dark_blue, '', '', '') hi('HopUnmatched', c.grey3, '', '', '') + -- vim-eft + hi('EftChar' , c.orange, '', 'bold,underline', '') + hi('EftSubChar', c.grey3, '', 'bold,underline', '') + -- BufferLine hi('BufferLineIndicatorSelected', c.cyan, '', '', '') hi('BufferLineFill', c.grey1, c.grey1, '', '') diff --git a/home/.config/nvim/lua/mappings.lua b/home/.config/nvim/lua/mappings.lua index 8df7a21..37d1024 100644 --- a/home/.config/nvim/lua/mappings.lua +++ b/home/.config/nvim/lua/mappings.lua @@ -14,6 +14,18 @@ api.nvim_set_keymap('v', '>', '>gv', {noremap = true, silent = true}) -- Clear search results -- api.nvim_set_keymap('n', '', 'noh', {noremap = true, silent = true}) +-- vim-eft +api.nvim_set_keymap('n', 'f', '(eft-f)', {}) +api.nvim_set_keymap('x', 'f', '(eft-f)', {}) +api.nvim_set_keymap('n', 'F', '(eft-F)', {}) +api.nvim_set_keymap('x', 'F', '(eft-F)', {}) +api.nvim_set_keymap('n', 't', '(eft-t)', {}) +api.nvim_set_keymap('x', 't', '(eft-t)', {}) +api.nvim_set_keymap('n', 'T', '(eft-T)', {}) +api.nvim_set_keymap('x', 'T', '(eft-T)', {}) +api.nvim_set_keymap('n', ';', '(eft-repeat)', {}) +api.nvim_set_keymap('x', ';', '(eft-repeat)', {}) + ----------------- -- Normal mode -- ----------------- @@ -111,11 +123,13 @@ wk.register({ wk.register({ b = { name = 'Buffer', + a = {':EasyAlign', 'Easy align'}, c = {':ColorizerToggle', 'Colorizer'}, d = {':bdelete', 'Close buffer'}, j = {':BufferLineCyclePrev', 'Previous buffer'}, k = {':BufferLineCycleNext', 'Next buffer'}, n = {':DashboardNewFile', 'New file'}, + u = {':UndotreeToggle', 'Undotree'}, z = {':ZenMode', 'Zen mode'} }, @@ -238,20 +252,22 @@ wk.register({ -- Visual mode (with leader key) -- ----------------------------------- wk.register({ - -- DAP + b = { + name = 'Buffer', + a = {':EasyAlign', 'Range easy align'} + }, + d = { name = 'DAP', e = {':lua require("dapui").eval()', 'Evaluate highlighted text'} }, - -- GitSigns g = { name = 'Git', r = 'Reset hunk', s = 'Stage hunk' }, - -- translate-shell.vim j = { name = 'Translate', t = {':Trans', 'Translate'}, diff --git a/home/.config/nvim/lua/modules/editor.lua b/home/.config/nvim/lua/modules/editor.lua index 95eae59..18cece7 100644 --- a/home/.config/nvim/lua/modules/editor.lua +++ b/home/.config/nvim/lua/modules/editor.lua @@ -125,6 +125,10 @@ function M.hop_conf() require('hop').setup{keys = 'etovxqpdygfblzhckisuran'} end +function M.eft_conf() + vim.g.eft_index_function = {all = function() return true end} +end + function M.comment_conf() require('nvim_comment').setup({comment_empty = false}) end diff --git a/home/.config/nvim/lua/modules/tools.lua b/home/.config/nvim/lua/modules/tools.lua index 05175f5..05dc404 100644 --- a/home/.config/nvim/lua/modules/tools.lua +++ b/home/.config/nvim/lua/modules/tools.lua @@ -163,6 +163,14 @@ function M.translate_conf() } end +function M.undotree_conf() + vim.g.undotree_WindowLayout = 2 + vim.g.undotree_SplitWidth = 30 + vim.g.undotree_DiffpaneHeight = 10 + vim.g.undotree_SetFocusWhenToggle = 1 + vim.g.undotree_RelativeTimestamp = 1 +end + function M.toggleterm_conf() require('toggleterm').setup { shade_terminals = false, diff --git a/home/.config/nvim/lua/plugins.lua b/home/.config/nvim/lua/plugins.lua index 5056cc8..a882bc5 100644 --- a/home/.config/nvim/lua/plugins.lua +++ b/home/.config/nvim/lua/plugins.lua @@ -117,6 +117,11 @@ return require('packer').startup( cmd = {'HopChar1', 'HopChar2', 'HopWord', 'HopPattern', 'HopLine'}, config = editor.hop_conf } + use { + 'hrsh7th/vim-eft', + event = {'BufRead', 'BufNewFile'}, + setup = editor.eft_conf + } use { 'junegunn/vim-easy-align', cmd = 'EasyAlign' @@ -316,6 +321,11 @@ return require('packer').startup( cmd = {'Trans', 'TransSelectDirection'}, config = tools.translate_conf } + use { + 'mbbill/undotree', + cmd = 'UndotreeToggle', + setup = tools.undotree_conf + } use { 'akinsho/nvim-toggleterm.lua', cmd = 'ToggleTerm',