mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2025-02-17 18:13:03 -05:00
neovim: add undotree and vim-eft
Also fix some cursor highlight groups
This commit is contained in:
parent
09cef9c60a
commit
af695b83db
@ -65,7 +65,7 @@ local function highlight_editors()
|
|||||||
-- Editor
|
-- Editor
|
||||||
hi('ColorColumn', '' , c.grey1, '', '')
|
hi('ColorColumn', '' , c.grey1, '', '')
|
||||||
hi('Cursor' , c.black , c.fg , '', '')
|
hi('Cursor' , c.black , c.fg , '', '')
|
||||||
hi('CursorLine' , c.grey1 , '' , '', '')
|
hi('CursorLine' , '' , c.grey1, '', '')
|
||||||
hi('Error' , c.fg , c.red , '', '')
|
hi('Error' , c.fg , c.red , '', '')
|
||||||
hi('iCursor' , c.black , c.fg , '', '')
|
hi('iCursor' , c.black , c.fg , '', '')
|
||||||
hi('LineNr' , c.grey3 , '' , '', '')
|
hi('LineNr' , c.grey3 , '' , '', '')
|
||||||
@ -87,10 +87,10 @@ local function highlight_editors()
|
|||||||
hi('healthError' , c.red , c.grey1, '', '')
|
hi('healthError' , c.red , c.grey1, '', '')
|
||||||
hi('healthSuccess', c.green , c.grey1, '', '')
|
hi('healthSuccess', c.green , c.grey1, '', '')
|
||||||
hi('healthWarning', c.yellow, c.grey1, '', '')
|
hi('healthWarning', c.yellow, c.grey1, '', '')
|
||||||
hi('TermCursorNC' , '' , c.grey2, '', '')
|
hi('TermCursorNC' , '' , c.grey1, '', '')
|
||||||
|
|
||||||
-- Gutter
|
-- Gutter
|
||||||
hi('CursorColumn', c.grey1, '' , '', '')
|
hi('CursorColumn', '' , c.grey1, '', '')
|
||||||
hi('CursorLineNr', c.fg , '' , '', '')
|
hi('CursorLineNr', c.fg , '' , '', '')
|
||||||
hi('Folded' , c.grey3, c.grey1, '', '')
|
hi('Folded' , c.grey3, c.grey1, '', '')
|
||||||
hi('FoldColumn' , c.grey3, c.black, '', '')
|
hi('FoldColumn' , c.grey3, c.black, '', '')
|
||||||
@ -294,6 +294,10 @@ local function highlight_plugins()
|
|||||||
hi('HopNextKey2', c.dark_blue, '', '', '')
|
hi('HopNextKey2', c.dark_blue, '', '', '')
|
||||||
hi('HopUnmatched', c.grey3, '', '', '')
|
hi('HopUnmatched', c.grey3, '', '', '')
|
||||||
|
|
||||||
|
-- vim-eft
|
||||||
|
hi('EftChar' , c.orange, '', 'bold,underline', '')
|
||||||
|
hi('EftSubChar', c.grey3, '', 'bold,underline', '')
|
||||||
|
|
||||||
-- BufferLine
|
-- BufferLine
|
||||||
hi('BufferLineIndicatorSelected', c.cyan, '', '', '')
|
hi('BufferLineIndicatorSelected', c.cyan, '', '', '')
|
||||||
hi('BufferLineFill', c.grey1, c.grey1, '', '')
|
hi('BufferLineFill', c.grey1, c.grey1, '', '')
|
||||||
|
@ -14,6 +14,18 @@ api.nvim_set_keymap('v', '>', '>gv', {noremap = true, silent = true})
|
|||||||
-- Clear search results
|
-- Clear search results
|
||||||
-- api.nvim_set_keymap('n', '<Esc>', '<Cmd>noh<CR>', {noremap = true, silent = true})
|
-- api.nvim_set_keymap('n', '<Esc>', '<Cmd>noh<CR>', {noremap = true, silent = true})
|
||||||
|
|
||||||
|
-- vim-eft
|
||||||
|
api.nvim_set_keymap('n', 'f', '<Plug>(eft-f)', {})
|
||||||
|
api.nvim_set_keymap('x', 'f', '<Plug>(eft-f)', {})
|
||||||
|
api.nvim_set_keymap('n', 'F', '<Plug>(eft-F)', {})
|
||||||
|
api.nvim_set_keymap('x', 'F', '<Plug>(eft-F)', {})
|
||||||
|
api.nvim_set_keymap('n', 't', '<Plug>(eft-t)', {})
|
||||||
|
api.nvim_set_keymap('x', 't', '<Plug>(eft-t)', {})
|
||||||
|
api.nvim_set_keymap('n', 'T', '<Plug>(eft-T)', {})
|
||||||
|
api.nvim_set_keymap('x', 'T', '<Plug>(eft-T)', {})
|
||||||
|
api.nvim_set_keymap('n', ';', '<Plug>(eft-repeat)', {})
|
||||||
|
api.nvim_set_keymap('x', ';', '<Plug>(eft-repeat)', {})
|
||||||
|
|
||||||
-----------------
|
-----------------
|
||||||
-- Normal mode --
|
-- Normal mode --
|
||||||
-----------------
|
-----------------
|
||||||
@ -111,11 +123,13 @@ wk.register({
|
|||||||
wk.register({
|
wk.register({
|
||||||
b = {
|
b = {
|
||||||
name = 'Buffer',
|
name = 'Buffer',
|
||||||
|
a = {':EasyAlign<CR>', 'Easy align'},
|
||||||
c = {':ColorizerToggle<CR>', 'Colorizer'},
|
c = {':ColorizerToggle<CR>', 'Colorizer'},
|
||||||
d = {':bdelete<CR>', 'Close buffer'},
|
d = {':bdelete<CR>', 'Close buffer'},
|
||||||
j = {':BufferLineCyclePrev<CR>', 'Previous buffer'},
|
j = {':BufferLineCyclePrev<CR>', 'Previous buffer'},
|
||||||
k = {':BufferLineCycleNext<CR>', 'Next buffer'},
|
k = {':BufferLineCycleNext<CR>', 'Next buffer'},
|
||||||
n = {':DashboardNewFile<CR>', 'New file'},
|
n = {':DashboardNewFile<CR>', 'New file'},
|
||||||
|
u = {':UndotreeToggle<CR>', 'Undotree'},
|
||||||
z = {':ZenMode<CR>', 'Zen mode'}
|
z = {':ZenMode<CR>', 'Zen mode'}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -238,20 +252,22 @@ wk.register({
|
|||||||
-- Visual mode (with leader key) --
|
-- Visual mode (with leader key) --
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
wk.register({
|
wk.register({
|
||||||
-- DAP
|
b = {
|
||||||
|
name = 'Buffer',
|
||||||
|
a = {':EasyAlign<CR>', 'Range easy align'}
|
||||||
|
},
|
||||||
|
|
||||||
d = {
|
d = {
|
||||||
name = 'DAP',
|
name = 'DAP',
|
||||||
e = {':lua require("dapui").eval()<CR>', 'Evaluate highlighted text'}
|
e = {':lua require("dapui").eval()<CR>', 'Evaluate highlighted text'}
|
||||||
},
|
},
|
||||||
|
|
||||||
-- GitSigns
|
|
||||||
g = {
|
g = {
|
||||||
name = 'Git',
|
name = 'Git',
|
||||||
r = 'Reset hunk',
|
r = 'Reset hunk',
|
||||||
s = 'Stage hunk'
|
s = 'Stage hunk'
|
||||||
},
|
},
|
||||||
|
|
||||||
-- translate-shell.vim
|
|
||||||
j = {
|
j = {
|
||||||
name = 'Translate',
|
name = 'Translate',
|
||||||
t = {':Trans<CR>', 'Translate'},
|
t = {':Trans<CR>', 'Translate'},
|
||||||
|
@ -125,6 +125,10 @@ function M.hop_conf()
|
|||||||
require('hop').setup{keys = 'etovxqpdygfblzhckisuran'}
|
require('hop').setup{keys = 'etovxqpdygfblzhckisuran'}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.eft_conf()
|
||||||
|
vim.g.eft_index_function = {all = function() return true end}
|
||||||
|
end
|
||||||
|
|
||||||
function M.comment_conf()
|
function M.comment_conf()
|
||||||
require('nvim_comment').setup({comment_empty = false})
|
require('nvim_comment').setup({comment_empty = false})
|
||||||
end
|
end
|
||||||
|
@ -163,6 +163,14 @@ function M.translate_conf()
|
|||||||
}
|
}
|
||||||
end
|
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()
|
function M.toggleterm_conf()
|
||||||
require('toggleterm').setup {
|
require('toggleterm').setup {
|
||||||
shade_terminals = false,
|
shade_terminals = false,
|
||||||
|
@ -117,6 +117,11 @@ return require('packer').startup(
|
|||||||
cmd = {'HopChar1', 'HopChar2', 'HopWord', 'HopPattern', 'HopLine'},
|
cmd = {'HopChar1', 'HopChar2', 'HopWord', 'HopPattern', 'HopLine'},
|
||||||
config = editor.hop_conf
|
config = editor.hop_conf
|
||||||
}
|
}
|
||||||
|
use {
|
||||||
|
'hrsh7th/vim-eft',
|
||||||
|
event = {'BufRead', 'BufNewFile'},
|
||||||
|
setup = editor.eft_conf
|
||||||
|
}
|
||||||
use {
|
use {
|
||||||
'junegunn/vim-easy-align',
|
'junegunn/vim-easy-align',
|
||||||
cmd = 'EasyAlign'
|
cmd = 'EasyAlign'
|
||||||
@ -316,6 +321,11 @@ return require('packer').startup(
|
|||||||
cmd = {'Trans', 'TransSelectDirection'},
|
cmd = {'Trans', 'TransSelectDirection'},
|
||||||
config = tools.translate_conf
|
config = tools.translate_conf
|
||||||
}
|
}
|
||||||
|
use {
|
||||||
|
'mbbill/undotree',
|
||||||
|
cmd = 'UndotreeToggle',
|
||||||
|
setup = tools.undotree_conf
|
||||||
|
}
|
||||||
use {
|
use {
|
||||||
'akinsho/nvim-toggleterm.lua',
|
'akinsho/nvim-toggleterm.lua',
|
||||||
cmd = 'ToggleTerm',
|
cmd = 'ToggleTerm',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user