mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2025-02-23 04:53:04 -05:00
neovim: big refractor
- nvim-compe -> nvim-cmp - combine multple modules config into category files - add some more plugins
This commit is contained in:
parent
7c0da28c11
commit
a0d8351e07
@ -1,4 +1,4 @@
|
|||||||
local disable_distribution_plugins = function()
|
local disable_default_plugins = function()
|
||||||
vim.g.loaded_gzip = 1
|
vim.g.loaded_gzip = 1
|
||||||
vim.g.loaded_tar = 1
|
vim.g.loaded_tar = 1
|
||||||
vim.g.loaded_tarPlugin = 1
|
vim.g.loaded_tarPlugin = 1
|
||||||
@ -24,10 +24,10 @@ local load_core = function()
|
|||||||
vim.g.global_theme = 'nord'
|
vim.g.global_theme = 'nord'
|
||||||
|
|
||||||
-- Config
|
-- Config
|
||||||
|
vim.g.mapleader = ' '
|
||||||
|
disable_default_plugins()
|
||||||
require('options')
|
require('options')
|
||||||
require('colors.' .. vim.g.global_theme).highlight()
|
require('colors.' .. vim.g.global_theme).highlight()
|
||||||
disable_distribution_plugins()
|
|
||||||
vim.g.mapleader = ' '
|
|
||||||
require('plugins')
|
require('plugins')
|
||||||
require('mappings')
|
require('mappings')
|
||||||
require('events').load_autocmds()
|
require('events').load_autocmds()
|
||||||
|
@ -111,8 +111,8 @@ local function highlight_editors()
|
|||||||
-- Statusline
|
-- Statusline
|
||||||
hi('StatusLine' , c.cyan, c.grey3, '', '')
|
hi('StatusLine' , c.cyan, c.grey3, '', '')
|
||||||
hi('StatusLineNC' , c.fg , c.grey3, '', '')
|
hi('StatusLineNC' , c.fg , c.grey3, '', '')
|
||||||
-- hi('StatusLineTerm' , c.cyan, c.grey3, '', '')
|
hi('StatusLineTerm' , c.cyan, c.grey3, '', '')
|
||||||
-- hi('StatusLineTermNC', c.fg , c.grey3, '', '')
|
hi('StatusLineTermNC', c.fg , c.grey3, '', '')
|
||||||
|
|
||||||
-- Search
|
-- Search
|
||||||
hi('IncSearch', c.white2, c.dark_blue, 'underline', '')
|
hi('IncSearch', c.white2, c.dark_blue, 'underline', '')
|
||||||
@ -167,6 +167,10 @@ local function highlight_syntax()
|
|||||||
vim.cmd('hi! link PreCondit PreProc')
|
vim.cmd('hi! link PreCondit PreProc')
|
||||||
vim.cmd('hi! link Variable Identifier')
|
vim.cmd('hi! link Variable Identifier')
|
||||||
|
|
||||||
|
-- sql
|
||||||
|
vim.cmd('hi! link sqlKeyword Keyword')
|
||||||
|
vim.cmd('hi! link sqlSpecial Keyword')
|
||||||
|
|
||||||
-- Diff
|
-- Diff
|
||||||
hi('DiffAdd' , c.green , c.grey1, '', '')
|
hi('DiffAdd' , c.green , c.grey1, '', '')
|
||||||
hi('DiffChange', c.yellow, c.grey1, '', '')
|
hi('DiffChange', c.yellow, c.grey1, '', '')
|
||||||
@ -284,6 +288,12 @@ local function highlight_plugins()
|
|||||||
hi('rainbowcol6', c.blue, '', 'bold', '')
|
hi('rainbowcol6', c.blue, '', 'bold', '')
|
||||||
hi('rainbowcol7', c.purple, '', 'bold', '')
|
hi('rainbowcol7', c.purple, '', 'bold', '')
|
||||||
|
|
||||||
|
-- hop.nvim
|
||||||
|
hi('HopNextKey', c.red, '', 'bold', '')
|
||||||
|
hi('HopNextKey1', c.cyan, '', 'bold', '')
|
||||||
|
hi('HopNextKey2', c.dark_blue, '', '', '')
|
||||||
|
hi('HopUnmatched', c.grey3, '', '', '')
|
||||||
|
|
||||||
-- BufferLine
|
-- BufferLine
|
||||||
hi('BufferLineIndicatorSelected', c.cyan, '', '', '')
|
hi('BufferLineIndicatorSelected', c.cyan, '', '', '')
|
||||||
hi('BufferLineFill', c.grey1, c.grey1, '', '')
|
hi('BufferLineFill', c.grey1, c.grey1, '', '')
|
||||||
@ -325,29 +335,6 @@ local function highlight_plugins()
|
|||||||
-- trouble.nvim
|
-- trouble.nvim
|
||||||
hi('LspTroubleText', c.blue, '', 'bold', '')
|
hi('LspTroubleText', c.blue, '', 'bold', '')
|
||||||
|
|
||||||
-- lspsaga.nvim
|
|
||||||
hi('DiagnosticError', c.grey1, '', '', '')
|
|
||||||
hi('DiagnosticWarning', c.purple, '', '', '')
|
|
||||||
hi('DiagnosticInformation', c.dark_blue, '', '', '')
|
|
||||||
hi('DiagnosticHint', c.blue, '', '', '')
|
|
||||||
hi('DiagnosticTruncateLine', c.fg, '', '', '')
|
|
||||||
hi('LspFloatWinNormal', c.grey2, '', '', '')
|
|
||||||
hi('LspFloatWinBorder', c.blue, '', '', '')
|
|
||||||
hi('LspSagaBorderTitle', c.cyan, '', '', '')
|
|
||||||
hi('LspSagaHoverBorder', c.dark_blue, '', '', '')
|
|
||||||
hi('LspSagaRenameBorder', c.green, '', '', '')
|
|
||||||
hi('LspSagaDefPreviewBorder', c.green, '', '', '')
|
|
||||||
hi('LspSagaCodeActionBorder', c.teal, '', '', '')
|
|
||||||
hi('LspSagaFinderSelection', c.green, '', '', '')
|
|
||||||
hi('LspSagaCodeActionTitle', c.dark_blue, '', '', '')
|
|
||||||
hi('LspSagaCodeActionContent', c.blue, '', '', '')
|
|
||||||
hi('LspSagaSignatureHelpBorder', c.yellow, '', '', '')
|
|
||||||
hi('ReferencesCount', c.blue, '', '', '')
|
|
||||||
hi('DefinitionCount', c.blue, '', '', '')
|
|
||||||
hi('DefinitionIcon', c.teal, '', '', '')
|
|
||||||
hi('ReferencesIcon', c.teal, '', '', '')
|
|
||||||
hi('TargetWord', c.cyan, '', '', '')
|
|
||||||
|
|
||||||
-- Telescope
|
-- Telescope
|
||||||
hi('TelescopePromptBorder', c.cyan, '', 'bold', '')
|
hi('TelescopePromptBorder', c.cyan, '', 'bold', '')
|
||||||
hi('TelescopeResultsBorder', c.blue, '', 'bold', '')
|
hi('TelescopeResultsBorder', c.blue, '', 'bold', '')
|
||||||
@ -376,7 +363,6 @@ function M.highlight()
|
|||||||
vim.cmd('hi clear')
|
vim.cmd('hi clear')
|
||||||
if vim.fn.exists('syntax_on') then vim.cmd('syntax reset') end
|
if vim.fn.exists('syntax_on') then vim.cmd('syntax reset') end
|
||||||
vim.o.background = 'dark'
|
vim.o.background = 'dark'
|
||||||
vim.o.termguicolors = true
|
|
||||||
|
|
||||||
-- Load highlight groups
|
-- Load highlight groups
|
||||||
local async
|
local async
|
||||||
|
@ -50,7 +50,7 @@ function M.load_autocmds()
|
|||||||
-- Auto-hide numbers, statusline in specific buffers
|
-- Auto-hide numbers, statusline in specific buffers
|
||||||
-- {"BufEnter", "term://*", "setlocal norelativenumber nonumber"},
|
-- {"BufEnter", "term://*", "setlocal norelativenumber nonumber"},
|
||||||
-- {"BufEnter", "term://*", "set laststatus=0"},
|
-- {"BufEnter", "term://*", "set laststatus=0"},
|
||||||
{"BufEnter,BufWinEnter,WinEnter,CmdwinEnter", "*", [[if bufname('%') == "NvimTree" | set laststatus=0 | else | set laststatus=2 | endif]]}
|
-- {"BufEnter,BufWinEnter,WinEnter,CmdwinEnter", "*", [[if bufname('%') == "NvimTree" | set laststatus=0 | else | set laststatus=2 | endif]]}
|
||||||
},
|
},
|
||||||
|
|
||||||
wins = {
|
wins = {
|
||||||
|
@ -97,6 +97,7 @@ wk.register({
|
|||||||
|
|
||||||
-- ToggleTerm
|
-- ToggleTerm
|
||||||
['<C-\\>'] = {':ToggleTerm<CR>', 'Toggle terminal'},
|
['<C-\\>'] = {':ToggleTerm<CR>', 'Toggle terminal'},
|
||||||
|
['<A-\\>'] = {':ToggleTerm direction=float<CR>', 'Toggle float terminal'},
|
||||||
|
|
||||||
-- hop.nvim
|
-- hop.nvim
|
||||||
s = {':HopWord<CR>', 'Hop to word'},
|
s = {':HopWord<CR>', 'Hop to word'},
|
||||||
@ -182,8 +183,8 @@ wk.register({
|
|||||||
n = 'Rename in buffer',
|
n = 'Rename in buffer',
|
||||||
o = 'Format buffer',
|
o = 'Format buffer',
|
||||||
r = 'Remove workspace folder',
|
r = 'Remove workspace folder',
|
||||||
s = 'Signature help',
|
|
||||||
w = 'List workspace folders',
|
w = 'List workspace folders',
|
||||||
|
x = 'Signature help',
|
||||||
f = {
|
f = {
|
||||||
name = 'Telescope',
|
name = 'Telescope',
|
||||||
a = {':Telescope lsp_code_actions<CR>', 'Code actions'},
|
a = {':Telescope lsp_code_actions<CR>', 'Code actions'},
|
||||||
@ -198,11 +199,14 @@ wk.register({
|
|||||||
S = {':Telescope lsp_workspace_symbols<CR>', 'Workspace symbols'}
|
S = {':Telescope lsp_workspace_symbols<CR>', 'Workspace symbols'}
|
||||||
},
|
},
|
||||||
g = {':SymbolsOutline<CR>', 'Symbol outline'},
|
g = {':SymbolsOutline<CR>', 'Symbol outline'},
|
||||||
D = {'<Cmd>TroubleToggle lsp_definitions<CR>', 'Definition list'},
|
t = {
|
||||||
E = {'<Cmd>TroubleToggle lsp_document_diagnostics<CR>', 'Document diagnostics list'},
|
name = 'Trouble',
|
||||||
W = {'<Cmd>TroubleToggle lsp_workspace_diagnostics<CR>', 'Workspace diagnostics list'},
|
d = {':TroubleToggle lsp_definitions<CR>', 'Definition list'},
|
||||||
L = {'<Cmd>TroubleToggle loclist<CR>', 'Location list items'},
|
e = {':TroubleToggle lsp_document_diagnostics<CR>', 'Document diagnostics list'},
|
||||||
Q = {'<Cmd>TroubleToggle quickfix<CR>', 'Quickfix list'}
|
w = {':TroubleToggle lsp_workspace_diagnostics<CR>', 'Workspace diagnostics list'},
|
||||||
|
l = {':TroubleToggle loclist<CR>', 'Location list items'},
|
||||||
|
q = {':TroubleToggle quickfix<CR>', 'Quickfix list'}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
n = {':NnnPicker %:p:h<CR>', 'File picker'},
|
n = {':NnnPicker %:p:h<CR>', 'File picker'},
|
||||||
|
@ -1,49 +0,0 @@
|
|||||||
local function blankline_options()
|
|
||||||
vim.g.indent_blankline_char = '│'
|
|
||||||
-- vim.g.indent_blankline_space_char = '·'
|
|
||||||
vim.g.indent_blankline_show_first_indent_level = true
|
|
||||||
vim.g.indent_blankline_filetype_exclude = {
|
|
||||||
'startify',
|
|
||||||
'dashboard',
|
|
||||||
'dotooagenda',
|
|
||||||
'log',
|
|
||||||
'fugitive',
|
|
||||||
'gitcommit',
|
|
||||||
'packer',
|
|
||||||
'vimwiki',
|
|
||||||
'markdown',
|
|
||||||
'json',
|
|
||||||
'txt',
|
|
||||||
'vista',
|
|
||||||
'help',
|
|
||||||
'todoist',
|
|
||||||
'NvimTree',
|
|
||||||
'peekaboo',
|
|
||||||
'git',
|
|
||||||
'TelescopePrompt',
|
|
||||||
'undotree',
|
|
||||||
'flutterToolsOutline',
|
|
||||||
'' -- for all buffers without a file type
|
|
||||||
}
|
|
||||||
vim.g.indent_blankline_buftype_exclude = {'terminal', 'nofile'}
|
|
||||||
vim.g.indent_blankline_show_trailing_blankline_indent = false
|
|
||||||
vim.g.indent_blankline_show_current_context = true
|
|
||||||
vim.g.indent_blankline_context_patterns = {
|
|
||||||
'class',
|
|
||||||
'function',
|
|
||||||
'method',
|
|
||||||
'block',
|
|
||||||
'list_literal',
|
|
||||||
'selector',
|
|
||||||
'^if',
|
|
||||||
'^table',
|
|
||||||
'if_statement',
|
|
||||||
'while',
|
|
||||||
'for'
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Refresh often, since it is lazy-loaded
|
|
||||||
-- vim.cmd('autocmd CursorMoved * IndentBlanklineRefresh')
|
|
||||||
end
|
|
||||||
|
|
||||||
blankline_options()
|
|
@ -1,20 +0,0 @@
|
|||||||
return require('bufferline').setup {
|
|
||||||
options = {
|
|
||||||
numbers = 'none',
|
|
||||||
max_name_length = 16,
|
|
||||||
max_prefix_length = 14,
|
|
||||||
tab_size = 20,
|
|
||||||
diagnostics = 'nvim_lsp',
|
|
||||||
show_close_icon = false,
|
|
||||||
show_buffer_icons = true,
|
|
||||||
show_tab_indicators = true,
|
|
||||||
enforce_regular_tabs = false,
|
|
||||||
show_buffer_close_icons = true,
|
|
||||||
always_show_bufferline = true,
|
|
||||||
offsets = {
|
|
||||||
{filetype = 'NvimTree', text = 'NvimTree', text_align = 'left'},
|
|
||||||
{filetype = 'packer', text = 'Packer', text_align = 'left'}
|
|
||||||
},
|
|
||||||
separator_style = 'thin'
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
vim.cmd [[ call wilder#setup({'modes': [':', '/', '?']}) ]]
|
|
||||||
|
|
||||||
-- Doesn't work yet. Bugs in Neovim (see neovim/neovim#14809 and gelguy/wilder.nvim#53)
|
|
||||||
-- so can't do multi-line config inside vim.cmd [[ ]] with \
|
|
||||||
vim.cmd [[
|
|
||||||
call wilder#set_option('renderer', wilder#renderer_mux({
|
|
||||||
\ ':': wilder#popupmenu_renderer({
|
|
||||||
\ 'highlighter': wilder#basic_highlighter(),
|
|
||||||
\ 'left': wilder#popupmenu_devicons(),
|
|
||||||
\ 'right': [' ', wilder#popupmenu_scrollbar()]
|
|
||||||
\ }),
|
|
||||||
\ '/': wilder#wildmenu_renderer({
|
|
||||||
\ 'highlighter': wilder#basic_highlighter(),
|
|
||||||
\ 'separator': ' · ',
|
|
||||||
\ 'right': [' ', wilder#wildmenu_index()]
|
|
||||||
\ })
|
|
||||||
\ }))
|
|
||||||
]]
|
|
||||||
|
|
||||||
vim.cmd [[
|
|
||||||
call wilder#set_option('pipeline', [
|
|
||||||
\ wilder#branch(
|
|
||||||
\ wilder#python_file_finder_pipeline({
|
|
||||||
\ 'file_command': ['fd', '--type', 'f', '--follow', '--hidden', '--exclude', '.git'],
|
|
||||||
\ 'dir_command': ['fd', '--type', 'd', '--follow', '--hidden', '--exclude', '.git']
|
|
||||||
\ }),
|
|
||||||
\ wilder#cmdline_pipeline({'language': 'python'}),
|
|
||||||
\ wilder#python_search_pipeline()
|
|
||||||
\ )
|
|
||||||
\ ])
|
|
||||||
]]
|
|
@ -1,13 +0,0 @@
|
|||||||
return require('colorizer').setup(
|
|
||||||
{'*'},
|
|
||||||
{
|
|
||||||
RGB = true, -- #RGB hex codes
|
|
||||||
RRGGBB = true, -- #RRGGBB hex codes
|
|
||||||
names = true, -- "Name" codes like Blue
|
|
||||||
RRGGBBAA = true, -- #RRGGBBAA hex codes
|
|
||||||
rgb_fn = true, -- CSS rgb() and rgba() functions
|
|
||||||
hsl_fn = true, -- CSS hsl() and hsla() functions
|
|
||||||
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
|
||||||
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
|
||||||
mode = 'background' -- Set the display mode.
|
|
||||||
})
|
|
@ -1,64 +1,156 @@
|
|||||||
require('compe').setup {
|
local M = {}
|
||||||
enabled = true,
|
|
||||||
autocomplete = true,
|
function M.cmp_conf()
|
||||||
debug = false,
|
local cmp = require('cmp')
|
||||||
min_length = 1,
|
local luasnip = require('luasnip')
|
||||||
preselect = 'always',
|
|
||||||
source = {
|
local check_back_space = function()
|
||||||
orgmode = true,
|
local col = vim.fn.col '.' - 1
|
||||||
path = true,
|
return col == 0 or vim.fn.getline('.'):sub(col, col):match '%s' ~= nil
|
||||||
buffer = true,
|
end
|
||||||
calc = false,
|
|
||||||
nvim_lsp = true,
|
local t = function(str)
|
||||||
nvim_lua = false,
|
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
||||||
vsnip = false,
|
end
|
||||||
luasnip = true,
|
|
||||||
utilsnips = false,
|
cmp.setup {
|
||||||
tags = false,
|
formatting = {
|
||||||
spell = true
|
format = function(entry, vim_item)
|
||||||
|
local lspkind_icons = {
|
||||||
|
Text = '',
|
||||||
|
Method = '',
|
||||||
|
Function = '',
|
||||||
|
Constructor = '',
|
||||||
|
Field = 'ﰠ',
|
||||||
|
Variable = '',
|
||||||
|
Class = 'ﴯ',
|
||||||
|
Interface = '',
|
||||||
|
Module = '',
|
||||||
|
Property = 'ﰠ',
|
||||||
|
Unit = '塞',
|
||||||
|
Value = '',
|
||||||
|
Enum = '',
|
||||||
|
Keyword = '',
|
||||||
|
Snippet = '',
|
||||||
|
Color = '',
|
||||||
|
File = '',
|
||||||
|
Reference = '',
|
||||||
|
Folder = '',
|
||||||
|
EnumMember = '',
|
||||||
|
Constant = '',
|
||||||
|
Struct = 'פּ',
|
||||||
|
Event = '',
|
||||||
|
Operator = '',
|
||||||
|
TypeParameter = ''
|
||||||
|
}
|
||||||
|
-- load lspkind icons
|
||||||
|
vim_item.kind = string.format('%s %s', lspkind_icons[vim_item.kind], vim_item.kind)
|
||||||
|
|
||||||
|
vim_item.menu = ({
|
||||||
|
luasnip = '[SNIP]',
|
||||||
|
path = '[PATH]',
|
||||||
|
buffer = '[BUF]',
|
||||||
|
-- calc = '[CALC]',
|
||||||
|
-- nuspell = '[SPELL]',
|
||||||
|
spell = '[SPELL]',
|
||||||
|
emoji = '[EMOJI]',
|
||||||
|
nvim_lsp = '[LSP]',
|
||||||
|
latex_symbols = '[TEX]',
|
||||||
|
tmux = '[TMUX]',
|
||||||
|
orgmode = '[ORG]'
|
||||||
|
})[entry.source.name]
|
||||||
|
|
||||||
|
return vim_item
|
||||||
|
end
|
||||||
|
},
|
||||||
|
mapping = {
|
||||||
|
['<C-Space>'] = cmp.mapping.complete(),
|
||||||
|
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||||
|
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||||
|
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||||
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||||
|
['<C-e>'] = cmp.mapping.close(),
|
||||||
|
-- supertab-like mapping
|
||||||
|
['<Tab>'] = cmp.mapping(function(fallback)
|
||||||
|
if vim.fn.pumvisible() == 1 then
|
||||||
|
vim.fn.feedkeys(t('<C-n>'), 'n')
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
vim.fn.feedkeys(t('<Plug>luasnip-expand-or-jump'), '')
|
||||||
|
elseif check_back_space() then
|
||||||
|
vim.fn.feedkeys(t('<Tab>'), 'n')
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, {'i', 's'}),
|
||||||
|
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||||
|
if vim.fn.pumvisible() == 1 then
|
||||||
|
vim.fn.feedkeys(t('<C-p>'), 'n')
|
||||||
|
elseif luasnip.jumpable(-1) then
|
||||||
|
vim.fn.feedkeys(t('<Plug>luasnip-jump-prev'), '')
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, {'i', 's'})
|
||||||
|
},
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
luasnip.lsp_expand(args.body)
|
||||||
|
end
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
{name = 'luasnip'},
|
||||||
|
{name = 'path'},
|
||||||
|
{name = 'buffer'},
|
||||||
|
-- {name = 'calc'},
|
||||||
|
-- {name = 'nuspell'},
|
||||||
|
{name = 'spell'},
|
||||||
|
{name = 'emoji'},
|
||||||
|
{name = 'nvim_lsp'},
|
||||||
|
{name = 'latex_symbols'},
|
||||||
|
{name = 'tmux'},
|
||||||
|
{name = 'orgmode'}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
-- Use (S-)Tab in completion menu
|
|
||||||
-- See https://github.com/neovim/nvim-lspconfig/wiki/Snippets
|
|
||||||
local t = function(str)
|
|
||||||
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local check_back_space = function()
|
function M.autopairs_conf()
|
||||||
local col = vim.fn.col('.') - 1
|
require('nvim-autopairs').setup {fast_wrap = {}}
|
||||||
if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then
|
require('nvim-autopairs.completion.cmp').setup({
|
||||||
return true
|
map_cr = true, -- map <CR> on insert mode
|
||||||
else
|
map_complete = true, -- it will auto insert `(` after select function or method item
|
||||||
return false
|
auto_select = true -- automatically select the first item
|
||||||
end
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
_G.tab_complete = function()
|
function M.snippets_conf()
|
||||||
if vim.fn.pumvisible() == 1 then
|
require('luasnip').config.set_config({
|
||||||
return t '<C-n>'
|
updateevents = 'TextChanged, TextChangedI',
|
||||||
elseif require('luasnip').expand_or_jumpable() then
|
history = true
|
||||||
return t '<Plug>luasnip-expand-or-jump'
|
})
|
||||||
elseif check_back_space() then
|
|
||||||
return t '<Tab>'
|
-- Loading vscode-like snippets from 'friendly-snippets'
|
||||||
else
|
require('luasnip/loaders/from_vscode').lazy_load()
|
||||||
return vim.fn['compe#complete']()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
_G.s_tab_complete = function()
|
|
||||||
if vim.fn.pumvisible() == 1 then
|
|
||||||
return t '<C-p>'
|
|
||||||
elseif require('luasnip').jumpable(-1) then
|
|
||||||
return t '<Plug>luasnip-jump-prev'
|
|
||||||
else
|
|
||||||
return t '<S-Tab>'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.api.nvim_set_keymap('i', '<Tab>', 'v:lua.tab_complete()', {expr = true})
|
function M.coq_conf()
|
||||||
vim.api.nvim_set_keymap('s', '<Tab>', 'v:lua.tab_complete()', {expr = true})
|
-- To add snippets from lsp servers, change lsp.lua:
|
||||||
vim.api.nvim_set_keymap('i', '<S-Tab>', 'v:lua.s_tab_complete()', {expr = true})
|
-----
|
||||||
vim.api.nvim_set_keymap('s', '<S-Tab>', 'v:lua.s_tab_complete()', {expr = true})
|
-- local coq = require('coq')
|
||||||
|
-- lspconf.<server>.setup(...) --> lspconf.<server>.setup(coq.lsp_ensure_capabilities(...))
|
||||||
|
vim.g.coq_settings = {
|
||||||
|
auto_start = true,
|
||||||
|
display = {
|
||||||
|
icons = {
|
||||||
|
mode = 'none'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
vim.api.nvim_set_keymap('i', '<C-Space>', 'compe#complete()', {expr = true})
|
function M.autotag_conf()
|
||||||
vim.api.nvim_set_keymap('i', '<C-e>', 'compe#close(\'<C-e>\')', {expr = true})
|
require('nvim-treesitter.configs').setup {
|
||||||
|
autotag = {enable = true}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
local function dadbod_options()
|
|
||||||
vim.g.db_ui_show_help = 0
|
|
||||||
vim.g.db_ui_win_position = 'left'
|
|
||||||
vim.g.db_ui_use_nerd_fonts = 1
|
|
||||||
vim.g.db_ui_winwidth = 30
|
|
||||||
vim.g.db_ui_save_location = vim.fn.stdpath('cache') .. '/nvim/db_ui_queries'
|
|
||||||
-- TODO: vim.g.dbs
|
|
||||||
end
|
|
||||||
|
|
||||||
dadbod_options()
|
|
@ -1,33 +0,0 @@
|
|||||||
local function dashboard_options()
|
|
||||||
-- vim.g.dashboard_disable_at_vimenter = 1
|
|
||||||
-- vim.g.dashboard_disable_statusline = 1
|
|
||||||
vim.g.dashboard_preview_file_height = 12
|
|
||||||
vim.g.dashboard_preview_file_width = 80
|
|
||||||
vim.g.dashboard_default_executive = 'telescope'
|
|
||||||
vim.g.dashboard_session_directory = vim.fn.stdpath('data') .. '/sessions'
|
|
||||||
vim.g.dashboard_custom_section = {
|
|
||||||
a = {description = {' Find File SPC f f'}, command = 'DashboardFindFile'},
|
|
||||||
b = {description = {' Recents SPC f o'}, command = 'DashboardFindHistory'},
|
|
||||||
c = {description = {' Find Word SPC f g'}, command = 'DashboardFindWord'},
|
|
||||||
d = {description = {'洛 New File SPC b n'}, command = 'DashboardNewFile'},
|
|
||||||
e = {description = {' Bookmarks SPC f m'}, command = 'DashboardJumpMark'}
|
|
||||||
}
|
|
||||||
vim.g.dashboard_custom_header = {
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
"<-. (`-')_ (`-') _ (`-') _ <-. (`-') ",
|
|
||||||
" \\( OO) ) ( OO).-/ .-> _(OO ) (_) \\(OO )_ ",
|
|
||||||
",--./ ,--/ (,------.(`-')----. ,--.(_/,-.\\ ,-(`-'),--./ ,-.)",
|
|
||||||
"| \\ | | | .---'( OO).-. '\\ \\ / (_/ | ( OO)| `.' |",
|
|
||||||
"| . '| |)(| '--. ( _) | | | \\ / / | | )| |'.'| |",
|
|
||||||
"| |\\ | | .--' \\| |)| |_ \\ /_)(| |_/ | | | |",
|
|
||||||
"| | \\ | | `---. ' '-' '\\-'\\ / | |'->| | | |",
|
|
||||||
"`--' `--' `------' `-----' `-' `--' `--' `--'",
|
|
||||||
}
|
|
||||||
vim.g.dashboard_custom_footer = {
|
|
||||||
'おかえりなさい'
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
dashboard_options()
|
|
132
home/.config/nvim/lua/modules/editor.lua
Normal file
132
home/.config/nvim/lua/modules/editor.lua
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
local M = {}
|
||||||
|
|
||||||
|
function M.colorizer_conf()
|
||||||
|
require('colorizer').setup(
|
||||||
|
{'*'},
|
||||||
|
{
|
||||||
|
RGB = true, -- #RGB hex codes
|
||||||
|
RRGGBB = true, -- #RRGGBB hex codes
|
||||||
|
names = true, -- "Name" codes like Blue
|
||||||
|
RRGGBBAA = true, -- #RRGGBBAA hex codes
|
||||||
|
rgb_fn = true, -- CSS rgb() and rgba() functions
|
||||||
|
hsl_fn = true, -- CSS hsl() and hsla() functions
|
||||||
|
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
||||||
|
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
||||||
|
mode = 'background' -- Set the display mode.
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.blankline_conf()
|
||||||
|
vim.g.indent_blankline_char = '│'
|
||||||
|
-- vim.g.indent_blankline_space_char = '·'
|
||||||
|
vim.g.indent_blankline_show_first_indent_level = true
|
||||||
|
vim.g.indent_blankline_filetype_exclude = {
|
||||||
|
'startify',
|
||||||
|
'dashboard',
|
||||||
|
'dotooagenda',
|
||||||
|
'log',
|
||||||
|
'fugitive',
|
||||||
|
'gitcommit',
|
||||||
|
'packer',
|
||||||
|
'vimwiki',
|
||||||
|
'markdown',
|
||||||
|
'org',
|
||||||
|
'json',
|
||||||
|
'txt',
|
||||||
|
'vista',
|
||||||
|
'help',
|
||||||
|
'todoist',
|
||||||
|
'NvimTree',
|
||||||
|
'peekaboo',
|
||||||
|
'git',
|
||||||
|
'TelescopePrompt',
|
||||||
|
'undotree',
|
||||||
|
'flutterToolsOutline',
|
||||||
|
'' -- for all buffers without a file type
|
||||||
|
}
|
||||||
|
vim.g.indent_blankline_buftype_exclude = {'terminal', 'nofile'}
|
||||||
|
vim.g.indent_blankline_show_trailing_blankline_indent = false
|
||||||
|
vim.g.indent_blankline_show_current_context = true
|
||||||
|
vim.g.indent_blankline_context_patterns = {
|
||||||
|
'class',
|
||||||
|
'function',
|
||||||
|
'method',
|
||||||
|
'block',
|
||||||
|
'list_literal',
|
||||||
|
'selector',
|
||||||
|
'^if',
|
||||||
|
'^table',
|
||||||
|
'if_statement',
|
||||||
|
'while',
|
||||||
|
'for'
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Refresh often, since it is lazy-loaded
|
||||||
|
-- vim.cmd('autocmd CursorMoved * IndentBlanklineRefresh')
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.treesitter_conf()
|
||||||
|
vim.api.nvim_command('set foldmethod=expr')
|
||||||
|
vim.api.nvim_command('set foldexpr=nvim_treesitter#foldexpr()')
|
||||||
|
|
||||||
|
require('nvim-treesitter.configs').setup {
|
||||||
|
ensure_installed = 'maintained',
|
||||||
|
highlight = {enable = true},
|
||||||
|
textobjects = {
|
||||||
|
select = {
|
||||||
|
enable = true,
|
||||||
|
keymaps = {
|
||||||
|
['af'] = '@function.outer',
|
||||||
|
['if'] = '@function.inner',
|
||||||
|
['ac'] = '@class.outer',
|
||||||
|
['ic'] = '@class.inner'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
move = {
|
||||||
|
enable = true,
|
||||||
|
set_jumps = true, -- whether to set jumps in the jumplist
|
||||||
|
goto_next_start = {
|
||||||
|
[']['] = '@function.outer',
|
||||||
|
[']m'] = '@class.outer'
|
||||||
|
},
|
||||||
|
goto_next_end = {
|
||||||
|
[']]'] = '@function.outer',
|
||||||
|
[']M'] = '@class.outer'
|
||||||
|
},
|
||||||
|
goto_previous_start = {
|
||||||
|
['[['] = '@function.outer',
|
||||||
|
['[m'] = '@class.outer'
|
||||||
|
},
|
||||||
|
goto_previous_end = {
|
||||||
|
['[]'] = '@function.outer',
|
||||||
|
['[M'] = '@class.outer'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
matchup = {enable = true}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.rainbow_conf()
|
||||||
|
require('nvim-treesitter.configs').setup {
|
||||||
|
rainbow = {
|
||||||
|
enable = true,
|
||||||
|
extended_mode = true,
|
||||||
|
max_file_lines = 1000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.matchup_conf()
|
||||||
|
vim.g.matchup_matchparen_offscreen = {method = 'popup'}
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.hop_conf()
|
||||||
|
require('hop').setup{keys = 'etovxqpdygfblzhckisuran'}
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.comment_conf()
|
||||||
|
require('nvim_comment').setup({comment_empty = false})
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
@ -1,42 +0,0 @@
|
|||||||
return require('gitsigns').setup {
|
|
||||||
signs = {
|
|
||||||
add = {hl = 'DiffAdd' , text = '', numhl='GitSignsAddNr'},
|
|
||||||
change = {hl = 'DiffChange', text = '', numhl='GitSignsChangeNr'},
|
|
||||||
delete = {hl = 'DiffDelete', text = '', numhl='GitSignsDeleteNr'},
|
|
||||||
topdelete = {hl = 'DiffDelete', text = '', numhl='GitSignsDeleteNr'},
|
|
||||||
changedelete = {hl = 'DiffChange', text = '', numhl='GitSignsChangeNr'}
|
|
||||||
},
|
|
||||||
numhl = true,
|
|
||||||
keymaps = {
|
|
||||||
-- Default keymap options
|
|
||||||
noremap = true,
|
|
||||||
buffer = true,
|
|
||||||
|
|
||||||
['n ]g'] = {expr = true, '&diff ? \']g\' : \'<cmd>lua require"gitsigns.actions".next_hunk()<CR>\''},
|
|
||||||
['n [g'] = {expr = true, '&diff ? \'[g\' : \'<cmd>lua require"gitsigns.actions".prev_hunk()<CR>\''},
|
|
||||||
|
|
||||||
['n <leader>gs'] = '<cmd>lua require"gitsigns".stage_hunk()<CR>',
|
|
||||||
['v <leader>gs'] = '<cmd>lua require"gitsigns".stage_hunk({vim.fn.line("."), vim.fn.line("v")})<CR>',
|
|
||||||
['n <leader>gu'] = '<cmd>lua require"gitsigns".undo_stage_hunk()<CR>',
|
|
||||||
['n <leader>gr'] = '<cmd>lua require"gitsigns".reset_hunk()<CR>',
|
|
||||||
['v <leader>gr'] = '<cmd>lua require"gitsigns".reset_hunk({vim.fn.line("."), vim.fn.line("v")})<CR>',
|
|
||||||
['n <leader>gR'] = '<cmd>lua require"gitsigns".reset_buffer()<CR>',
|
|
||||||
['n <leader>gp'] = '<cmd>lua require"gitsigns".preview_hunk()<CR>',
|
|
||||||
['n <leader>gb'] = '<cmd>lua require"gitsigns".blame_line(true)<CR>'
|
|
||||||
},
|
|
||||||
watch_index = {
|
|
||||||
interval = 1000,
|
|
||||||
follow_files = true
|
|
||||||
},
|
|
||||||
current_line_blame = false,
|
|
||||||
current_line_blame_opts = {
|
|
||||||
delay = 1000,
|
|
||||||
virt_text = true,
|
|
||||||
virt_text_pos = 'eol'
|
|
||||||
},
|
|
||||||
sign_priority = 6,
|
|
||||||
update_debounce = 100,
|
|
||||||
status_formatter = nil, -- Use default
|
|
||||||
word_diff = false,
|
|
||||||
use_internal_diff = true -- If luajit is present
|
|
||||||
}
|
|
@ -1,126 +1,166 @@
|
|||||||
local lspconf = require('lspconfig')
|
local M = {}
|
||||||
|
|
||||||
local on_attach = function(client, bufnr)
|
function M.lsp_conf()
|
||||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
local lspconf = require('lspconfig')
|
||||||
|
|
||||||
local function buf_set_keymap(...)
|
local on_attach = function(client, bufnr)
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, ...)
|
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||||
|
|
||||||
|
local function buf_set_keymap(...)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
local opts = {noremap = true, silent = true}
|
||||||
|
buf_set_keymap('n', 'gD', '<Cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
||||||
|
buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
||||||
|
buf_set_keymap('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
||||||
|
buf_set_keymap('n', 'gi', '<Cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
||||||
|
buf_set_keymap('n', '<leader>lx', '<Cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||||
|
buf_set_keymap('n', '<leader>la', '<Cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
||||||
|
buf_set_keymap('n', '<leader>lr', '<Cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
||||||
|
buf_set_keymap('n', '<leader>lw', '<Cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
||||||
|
buf_set_keymap('n', '<leader>ld', '<Cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
||||||
|
buf_set_keymap('n', '<leader>ln', '<Cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
||||||
|
buf_set_keymap('n', 'gr', '<Cmd>lua vim.lsp.buf.references()<CR>', opts)
|
||||||
|
buf_set_keymap('n', '<leader>le', '<Cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
|
||||||
|
buf_set_keymap('n', '[d', '<Cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
|
||||||
|
buf_set_keymap('n', ']d', '<Cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
|
||||||
|
buf_set_keymap('n', '<leader>ll', '<Cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
|
||||||
|
|
||||||
|
if client.resolved_capabilities.document_formatting then
|
||||||
|
buf_set_keymap('n', '<leader>lo', '<Cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
||||||
|
elseif client.resolved_capabilities.document_range_formatting then
|
||||||
|
buf_set_keymap('n', '<leader>lo', '<Cmd>lua vim.lsp.buf.range_formatting({},{0,0},{vim.fn.line("$"),0})<CR>', opts)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local opts = {noremap = true, silent = true}
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
buf_set_keymap('n', 'gD', '<Cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||||
buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
|
||||||
buf_set_keymap('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
|
||||||
buf_set_keymap('n', 'gi', '<Cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<leader>ls', '<Cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<leader>la', '<Cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<leader>lr', '<Cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<leader>lw', '<Cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<leader>ld', '<Cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<leader>ln', '<Cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
|
||||||
buf_set_keymap('n', 'gr', '<Cmd>lua vim.lsp.buf.references()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<leader>le', '<Cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '[d', '<Cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
|
|
||||||
buf_set_keymap('n', ']d', '<Cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
|
|
||||||
buf_set_keymap('n', '<leader>ll', '<Cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
|
|
||||||
|
|
||||||
if client.resolved_capabilities.document_formatting then
|
---------------------------
|
||||||
buf_set_keymap('n', '<leader>lo', '<Cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
-- Server configurations --
|
||||||
elseif client.resolved_capabilities.document_range_formatting then
|
---------------------------
|
||||||
buf_set_keymap('n', '<leader>lo', '<Cmd>lua vim.lsp.buf.range_formatting({},{0,0},{vim.fn.line("$"),0})<CR>', opts)
|
-- https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
-- C/C++
|
||||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
lspconf.clangd.setup {
|
||||||
|
on_attach = on_attach,
|
||||||
---------------------------
|
capabilities = capabilities,
|
||||||
-- Server configurations --
|
filetypes = {'c', 'cpp'},
|
||||||
---------------------------
|
cmd = {
|
||||||
-- https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md
|
'clangd',
|
||||||
|
'-j=2',
|
||||||
-- C/C++
|
'--background-index',
|
||||||
lspconf.clangd.setup {
|
'--clang-tidy',
|
||||||
on_attach = on_attach,
|
'--completion-style=detailed',
|
||||||
capabilities = capabilities,
|
'--pch-storage=memory',
|
||||||
filetypes = {'c', 'cpp'},
|
'--header-insertion=iwyu',
|
||||||
cmd = {
|
'--header-insertion=decorators'
|
||||||
'clangd',
|
}
|
||||||
'-j=2',
|
|
||||||
'--background-index',
|
|
||||||
'--clang-tidy',
|
|
||||||
'--completion-style=detailed',
|
|
||||||
'--pch-storage=memory',
|
|
||||||
'--header-insertion=iwyu',
|
|
||||||
'--header-insertion=decorators'
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
-- Lua
|
-- Lua
|
||||||
local runtime_path = vim.split(package.path, ';')
|
local runtime_path = vim.split(package.path, ';')
|
||||||
table.insert(runtime_path, 'lua/?.lua')
|
table.insert(runtime_path, 'lua/?.lua')
|
||||||
table.insert(runtime_path, 'lua/?/init.lua')
|
table.insert(runtime_path, 'lua/?/init.lua')
|
||||||
|
|
||||||
lspconf.sumneko_lua.setup {
|
lspconf.sumneko_lua.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
cmd = {
|
cmd = {
|
||||||
vim.fn.stdpath('data') .. '/lsp/lua-language-server/bin/Linux/lua-language-server',
|
vim.fn.stdpath('data') .. '/lsp/lua-language-server/bin/Linux/lua-language-server',
|
||||||
'-E',
|
'-E',
|
||||||
vim.fn.stdpath('data') .. '/lsp/lua-language-server/main.lua'
|
vim.fn.stdpath('data') .. '/lsp/lua-language-server/main.lua'
|
||||||
},
|
},
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
globals = {'vim'}
|
globals = {'vim'}
|
||||||
},
|
},
|
||||||
runtime = {
|
runtime = {
|
||||||
version = 'LuaJIT',
|
version = 'LuaJIT',
|
||||||
path = runtime_path
|
path = runtime_path
|
||||||
},
|
},
|
||||||
workspace = {
|
workspace = {
|
||||||
library = vim.api.nvim_get_runtime_file('', true),
|
library = vim.api.nvim_get_runtime_file('', true),
|
||||||
maxPreload = 100000,
|
maxPreload = 100000,
|
||||||
preloadFileSize = 100000
|
preloadFileSize = 100000
|
||||||
},
|
},
|
||||||
telemetry = {
|
telemetry = {
|
||||||
enable = false
|
enable = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
-- Go
|
-- Go
|
||||||
lspconf.gopls.setup {
|
lspconf.gopls.setup {
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
|
||||||
cmd = {'gopls', '--remote=auto'},
|
|
||||||
init_options = {
|
|
||||||
usePlaceholders = true,
|
|
||||||
completeUnimported = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Others
|
|
||||||
local servers = {
|
|
||||||
'dockerls',
|
|
||||||
'bashls',
|
|
||||||
'pyright',
|
|
||||||
'tsserver',
|
|
||||||
'html',
|
|
||||||
'jsonls',
|
|
||||||
'cmake',
|
|
||||||
'rust_analyzer'
|
|
||||||
}
|
|
||||||
for _, server in ipairs(servers) do
|
|
||||||
lspconf[server].setup {
|
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities
|
capabilities = capabilities,
|
||||||
|
cmd = {'gopls', '--remote=auto'},
|
||||||
|
init_options = {
|
||||||
|
usePlaceholders = true,
|
||||||
|
completeUnimported = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Others
|
||||||
|
local servers = {
|
||||||
|
'dockerls',
|
||||||
|
'bashls',
|
||||||
|
'pyright',
|
||||||
|
'tsserver',
|
||||||
|
'html',
|
||||||
|
'jsonls',
|
||||||
|
'cmake',
|
||||||
|
'sqls',
|
||||||
|
'rust_analyzer'
|
||||||
|
}
|
||||||
|
for _, server in ipairs(servers) do
|
||||||
|
lspconf[server].setup {
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Replace the default lsp diagnostic letters with prettier symbols
|
||||||
|
vim.fn.sign_define('LspDiagnosticsSignError', {text = ''})
|
||||||
|
vim.fn.sign_define('LspDiagnosticsSignWarning', {text = ''})
|
||||||
|
vim.fn.sign_define('LspDiagnosticsSignInformation', {text = ''})
|
||||||
|
vim.fn.sign_define('LspDiagnosticsSignHint', {text = ''})
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.sqls_conf()
|
||||||
|
require('sqls').setup {
|
||||||
|
picker = 'telescope'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Replace the default lsp diagnostic letters with prettier symbols
|
function M.trouble_conf()
|
||||||
vim.fn.sign_define('LspDiagnosticsSignError', {text = ''})
|
require('trouble').setup {
|
||||||
vim.fn.sign_define('LspDiagnosticsSignWarning', {text = ''})
|
mode = 'lsp_workspace_diagnostics',
|
||||||
vim.fn.sign_define('LspDiagnosticsSignInformation', {text = ''})
|
fold_open = ' ',
|
||||||
vim.fn.sign_define('LspDiagnosticsSignHint', {text = ''})
|
fold_closed = '',
|
||||||
|
action_keys = {
|
||||||
|
open_split = {'<c-h>'},
|
||||||
|
open_vsplit = {'<c-v>'},
|
||||||
|
open_tab = {'<c-t>'}
|
||||||
|
},
|
||||||
|
signs = {
|
||||||
|
error = '',
|
||||||
|
warning = '',
|
||||||
|
hint = '',
|
||||||
|
information = '',
|
||||||
|
other = ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.outline_conf()
|
||||||
|
vim.g.symbols_outline = {
|
||||||
|
highlight_hovered_item = false,
|
||||||
|
show_guides = false
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
return require('trouble').setup {
|
|
||||||
mode = 'lsp_workspace_diagnostics',
|
|
||||||
fold_open = ' ',
|
|
||||||
fold_closed = '',
|
|
||||||
action_keys = {
|
|
||||||
open_split = {'<c-h>'},
|
|
||||||
open_vsplit = {'<c-v>'},
|
|
||||||
open_tab = {'<c-t>'}
|
|
||||||
},
|
|
||||||
signs = {
|
|
||||||
error = '',
|
|
||||||
warning = '',
|
|
||||||
hint = '',
|
|
||||||
information = '',
|
|
||||||
other = ''
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
local function markdownPreview_options()
|
|
||||||
vim.g.mkdp_refresh_slow = 1
|
|
||||||
vim.g.mkdp_filetypes = {
|
|
||||||
'markdown',
|
|
||||||
'pandoc.markdown',
|
|
||||||
'rmd'
|
|
||||||
}
|
|
||||||
-- vim.g.mkdp_page_title = '「${name}」'
|
|
||||||
-- vim.g.mkdp_echo_preview_url = 1
|
|
||||||
end
|
|
||||||
|
|
||||||
markdownPreview_options()
|
|
@ -1,44 +0,0 @@
|
|||||||
local function tree_options()
|
|
||||||
vim.g.nvim_tree_width = 35
|
|
||||||
vim.g.nvim_tree_ignore = {'.git', '.hg', '.svn', 'node_modules'}
|
|
||||||
vim.g.nvim_tree_auto_open = 0
|
|
||||||
vim.g.nvim_tree_auto_close = 1
|
|
||||||
vim.g.nvim_tree_auto_ignore_ft = {'dashboard'}
|
|
||||||
vim.g.nvim_tree_follow = 1
|
|
||||||
vim.g.nvim_tree_indent_markers = 1
|
|
||||||
vim.g.nvim_tree_git_hl = 1
|
|
||||||
vim.g.nvim_tree_auto_resize = 0
|
|
||||||
-- vim.g.nvim_tree_add_trailing = 1
|
|
||||||
vim.g.nvim_tree_lsp_diagnostics = 1
|
|
||||||
vim.g.nvim_tree_icons = {
|
|
||||||
default = '',
|
|
||||||
symlink = '',
|
|
||||||
git = {
|
|
||||||
unstaged = "",
|
|
||||||
staged = "",
|
|
||||||
unmerged = "",
|
|
||||||
renamed = "",
|
|
||||||
untracked = "★",
|
|
||||||
deleted = "",
|
|
||||||
ignored = ""
|
|
||||||
},
|
|
||||||
folder = {
|
|
||||||
arrow_open = "",
|
|
||||||
arrow_closed = "",
|
|
||||||
default = "",
|
|
||||||
open = "",
|
|
||||||
empty = "",
|
|
||||||
empty_open = "",
|
|
||||||
symlink = "",
|
|
||||||
symlink_open = ""
|
|
||||||
},
|
|
||||||
lsp = {
|
|
||||||
hint = "",
|
|
||||||
info = "",
|
|
||||||
warning = "",
|
|
||||||
error = ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
tree_options()
|
|
@ -1,39 +0,0 @@
|
|||||||
local c = require('colors.' .. vim.g.global_theme).colors
|
|
||||||
|
|
||||||
return require('orgmode').setup({
|
|
||||||
-- General settings
|
|
||||||
org_agenda_files = {
|
|
||||||
'~/Documents/Org/agenda/agenda.org',
|
|
||||||
'~/Documents/Org/agenda/archive.org'
|
|
||||||
},
|
|
||||||
org_default_notes_file = '~/Documents/Org/notes.org',
|
|
||||||
org_todo_keywords = {
|
|
||||||
'TODO', 'PROJ', 'LOOP', 'STRT', 'WAIT', 'HOLD', 'IDEA', 'DONE', 'KILL',
|
|
||||||
'[ ]', '[-]', '[X]' , '|', 'OKAY', 'YES', 'NO'
|
|
||||||
},
|
|
||||||
org_todo_keyword_faces = {
|
|
||||||
TODO = ':foreground ' .. c.green .. ' :weight bold',
|
|
||||||
PROJ = ':foreground ' .. c.grey_bright .. ' :weight bold :slant italic',
|
|
||||||
LOOP = ':foreground ' .. c.green .. ' :weight bold :underline on',
|
|
||||||
STRT = ':foreground ' .. c.blue .. ' :weight bold',
|
|
||||||
WAIT = ':foreground ' .. c.yellow .. ' :weight bold',
|
|
||||||
HOLD = ':foreground ' .. c.yellow .. ' :weight bold :slant italic',
|
|
||||||
IDEA = ':foreground ' .. c.green .. ' :weight bold :slant italic',
|
|
||||||
DONE = ':foreground ' .. c.grey2 .. ' :weight bold',
|
|
||||||
KILL = ':foreground ' .. c.red .. ' :weight bold',
|
|
||||||
OKAY = ':foreground ' .. c.grey1 .. ' :weight bold :slant italic',
|
|
||||||
YES = ':foreground ' .. c.grey1 .. ' :weight bold :underline on',
|
|
||||||
NO = ':foreground ' .. c.red .. ' :weight bold :underline on'
|
|
||||||
},
|
|
||||||
org_hide_leading_stars = true,
|
|
||||||
org_highlight_latex_and_related = 'entities',
|
|
||||||
|
|
||||||
-- Agenda settings
|
|
||||||
org_deadline_warning_days = 7,
|
|
||||||
org_agenda_span = 'week',
|
|
||||||
org_agenda_start_on_weekday = 7, -- Start a week in Sunday
|
|
||||||
org_agenda_min_height = 15,
|
|
||||||
|
|
||||||
-- Tags settings
|
|
||||||
org_use_tag_inheritance = false
|
|
||||||
})
|
|
@ -1,13 +0,0 @@
|
|||||||
return require('nnn').setup {
|
|
||||||
set_default_mappings = false,
|
|
||||||
session = 'global',
|
|
||||||
layout = {
|
|
||||||
window = {width = 0.8, height = 0.8, highlight = 'Debug'},
|
|
||||||
},
|
|
||||||
command = 'nnn -HUdex',
|
|
||||||
action = {
|
|
||||||
['<c-t>'] = 'tab split',
|
|
||||||
['<c-h>'] = 'split',
|
|
||||||
['<c-v>'] = 'vsplit'
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
local function luaSnip_setup()
|
|
||||||
require('luasnip').config.set_config({
|
|
||||||
updateevents = 'TextChanged, TextChangedI',
|
|
||||||
history = true
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Loading vscode-like snippets from 'friendly-snippets'
|
|
||||||
require('luasnip/loaders/from_vscode').lazy_load()
|
|
||||||
end
|
|
||||||
|
|
||||||
luaSnip_setup()
|
|
@ -1,234 +0,0 @@
|
|||||||
local gl = require('galaxyline')
|
|
||||||
local gls = gl.section
|
|
||||||
local condition = require('galaxyline.condition')
|
|
||||||
|
|
||||||
gl.short_line_list = {'NvimTree', 'packer', 'Outline'}
|
|
||||||
|
|
||||||
local colors = require('colors.' .. vim.g.global_theme).colors
|
|
||||||
|
|
||||||
gls.left[1] = {
|
|
||||||
LeftCorner = {
|
|
||||||
provider = function()
|
|
||||||
return '▊ '
|
|
||||||
end,
|
|
||||||
highlight = {colors.blue, colors.grey1}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.left[2] = {
|
|
||||||
ViMode = {
|
|
||||||
provider = function()
|
|
||||||
local mode_color = {
|
|
||||||
n = colors.green, -- Normal
|
|
||||||
no = colors.green, -- N-Pending
|
|
||||||
i = colors.blue, -- Insert
|
|
||||||
ic = colors.blue, -- Insert
|
|
||||||
v = colors.yellow, -- Visual
|
|
||||||
[''] = colors.yellow, -- V-Block
|
|
||||||
V = colors.yellow, -- V-Line
|
|
||||||
c = colors.white2, -- Command
|
|
||||||
s = colors.purple, -- Select
|
|
||||||
S = colors.purple, -- S-Line
|
|
||||||
[''] = colors.purple, -- S-Block
|
|
||||||
R = colors.red, -- Replace
|
|
||||||
Rv = colors.red, -- V-Replace
|
|
||||||
cv = colors.white2, -- Vim-Ex
|
|
||||||
ce = colors.white2, -- Ex
|
|
||||||
r = colors.cyan, -- Prompt
|
|
||||||
rm = colors.cyan, -- More
|
|
||||||
['r?'] = colors.cyan, -- Confirm
|
|
||||||
['!'] = colors.orange, -- Shell
|
|
||||||
t = colors.orange -- Terminal
|
|
||||||
}
|
|
||||||
vim.api.nvim_command('hi GalaxyViMode guifg=' .. mode_color[vim.fn.mode()])
|
|
||||||
return ' '
|
|
||||||
end,
|
|
||||||
highlight = {colors.green, colors.grey1}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.left[3] = {
|
|
||||||
FileSize = {
|
|
||||||
provider = 'FileSize',
|
|
||||||
condition = condition.buffer_not_empty,
|
|
||||||
highlight = {colors.fg, colors.grey1}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.left[4] ={
|
|
||||||
FileIcon = {
|
|
||||||
provider = 'FileIcon',
|
|
||||||
condition = condition.buffer_not_empty,
|
|
||||||
highlight = {
|
|
||||||
require('galaxyline.provider_fileinfo').get_file_icon_color,
|
|
||||||
colors.grey1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.left[5] = {
|
|
||||||
FileName = {
|
|
||||||
provider = 'FileName',
|
|
||||||
condition = condition.buffer_not_empty,
|
|
||||||
highlight = {colors.fg, colors.grey1, 'bold'}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.left[6] = {
|
|
||||||
LineInfo = {
|
|
||||||
provider = 'LineColumn',
|
|
||||||
highlight = {colors.fg, colors.grey1}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.left[7] = {
|
|
||||||
PerCent = {
|
|
||||||
provider = 'LinePercent',
|
|
||||||
highlight = {colors.fg, colors.grey1, 'bold'}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.left[8] = {
|
|
||||||
DiagnosticError = {
|
|
||||||
provider = 'DiagnosticError',
|
|
||||||
icon = ' ',
|
|
||||||
highlight = {colors.red, colors.grey1}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.left[9] = {
|
|
||||||
DiagnosticWarn = {
|
|
||||||
provider = 'DiagnosticWarn',
|
|
||||||
icon = ' ',
|
|
||||||
highlight = {colors.yellow, colors.grey1}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.left[10] = {
|
|
||||||
DiagnosticHint = {
|
|
||||||
provider = 'DiagnosticHint',
|
|
||||||
icon = ' ',
|
|
||||||
highlight = {colors.cyan, colors.grey1}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.left[11] = {
|
|
||||||
DiagnosticInfo = {
|
|
||||||
provider = 'DiagnosticInfo',
|
|
||||||
icon = ' ',
|
|
||||||
highlight = {colors.blue, colors.grey1}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.right[1] = {
|
|
||||||
ShowLspClient = {
|
|
||||||
provider = 'GetLspClient',
|
|
||||||
condition = function ()
|
|
||||||
local tbl = {['dashboard'] = true, [''] = true}
|
|
||||||
if tbl[vim.bo.filetype] then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end,
|
|
||||||
icon = ' LSP:',
|
|
||||||
highlight = {colors.purple, colors.grey1, 'bold'}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.right[2] = {
|
|
||||||
FileEncode = {
|
|
||||||
provider = 'FileEncode',
|
|
||||||
condition = condition.hide_in_width,
|
|
||||||
separator = ' ',
|
|
||||||
separator_highlight = {'NONE', colors.grey1},
|
|
||||||
highlight = {colors.fg, colors.grey1}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.right[3] = {
|
|
||||||
FileFormat = {
|
|
||||||
provider = 'FileFormat',
|
|
||||||
condition = condition.hide_in_width,
|
|
||||||
separator = ' ',
|
|
||||||
separator_highlight = {'NONE', colors.grey1},
|
|
||||||
highlight = {colors.fg, colors.grey1}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.right[4] = {
|
|
||||||
GitIcon = {
|
|
||||||
provider = function() return ' ' end,
|
|
||||||
condition = condition.check_git_workspace,
|
|
||||||
separator = ' ',
|
|
||||||
separator_highlight = {'NONE', colors.grey1},
|
|
||||||
highlight = {colors.green, colors.grey1, 'bold'}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.right[5] = {
|
|
||||||
GitBranch = {
|
|
||||||
provider = 'GitBranch',
|
|
||||||
condition = condition.check_git_workspace,
|
|
||||||
highlight = {colors.green, colors.grey1, 'bold'}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.right[6] = {
|
|
||||||
GitSeparator = {
|
|
||||||
provider = function()
|
|
||||||
return ' '
|
|
||||||
end,
|
|
||||||
highlight = {colors.green, colors.grey1}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.right[7] = {
|
|
||||||
DiffAdd = {
|
|
||||||
provider = 'DiffAdd',
|
|
||||||
condition = condition.hide_in_width,
|
|
||||||
icon = ' ',
|
|
||||||
highlight = {colors.green, colors.grey1}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.right[8] = {
|
|
||||||
DiffModified = {
|
|
||||||
provider = 'DiffModified',
|
|
||||||
condition = condition.hide_in_width,
|
|
||||||
icon = '柳',
|
|
||||||
highlight = {colors.yellow, colors.grey1}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.right[9] = {
|
|
||||||
DiffRemove = {
|
|
||||||
provider = 'DiffRemove',
|
|
||||||
condition = condition.hide_in_width,
|
|
||||||
icon = ' ',
|
|
||||||
highlight = {colors.red, colors.grey1}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.short_line_left[1] = {
|
|
||||||
BufferType = {
|
|
||||||
provider = 'FileTypeName',
|
|
||||||
separator = ' ',
|
|
||||||
separator_highlight = {'NONE', colors.grey1},
|
|
||||||
highlight = {colors.blue, colors.grey1, 'bold'}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.short_line_left[2] = {
|
|
||||||
SFileName = {
|
|
||||||
provider = 'SFileName',
|
|
||||||
condition = condition.buffer_not_empty,
|
|
||||||
highlight = {colors.fg, colors.grey1, 'bold'}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gls.short_line_right[1] = {
|
|
||||||
BufferIcon = {
|
|
||||||
provider= 'BufferIcon',
|
|
||||||
highlight = {colors.fg, colors.grey1}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,43 +0,0 @@
|
|||||||
local function telescope_setup()
|
|
||||||
require('telescope').setup {
|
|
||||||
defaults = {
|
|
||||||
prompt_prefix = ' ',
|
|
||||||
selection_caret = ' ',
|
|
||||||
set_env = {['COLORTERM'] = 'truecolor'},
|
|
||||||
layout_strategy = 'horizontal',
|
|
||||||
layout_config = {
|
|
||||||
horizontal = {
|
|
||||||
preview_width = 0.6
|
|
||||||
},
|
|
||||||
-- prompt_position = 'top',
|
|
||||||
width = 0.8,
|
|
||||||
height = 0.8
|
|
||||||
},
|
|
||||||
file_ignore_patterns = {'.git', '.svn', '.hg', 'node_modules'}
|
|
||||||
},
|
|
||||||
pickers = {
|
|
||||||
find_files = {
|
|
||||||
hidden = true,
|
|
||||||
follow = true
|
|
||||||
},
|
|
||||||
grep_string = {
|
|
||||||
opts = '--hidden'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
extensions = {
|
|
||||||
project = {
|
|
||||||
base_dirs = {{'~/Code', max_depth = 2}}
|
|
||||||
},
|
|
||||||
fzf = {
|
|
||||||
fuzzy = true,
|
|
||||||
override_generic_sorter = false,
|
|
||||||
override_file_sorter = true,
|
|
||||||
case_mode = 'smart_case'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
require('telescope').load_extension('project')
|
|
||||||
require('telescope').load_extension('fzf')
|
|
||||||
end
|
|
||||||
|
|
||||||
telescope_setup()
|
|
@ -1,13 +0,0 @@
|
|||||||
return require('toggleterm').setup {
|
|
||||||
shade_terminals = false,
|
|
||||||
float_opts = {
|
|
||||||
border = 'curved',
|
|
||||||
width = 80,
|
|
||||||
height = 80,
|
|
||||||
winblend = 3,
|
|
||||||
highlights = {
|
|
||||||
border = 'Normal',
|
|
||||||
background = 'Normal'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
return require('nvim-treesitter.configs').setup {
|
|
||||||
textobjects = {
|
|
||||||
select = {
|
|
||||||
enable = true,
|
|
||||||
keymaps = {
|
|
||||||
["af"] = "@function.outer",
|
|
||||||
["if"] = "@function.inner",
|
|
||||||
["ac"] = "@class.outer",
|
|
||||||
["ic"] = "@class.inner"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
move = {
|
|
||||||
enable = true,
|
|
||||||
set_jumps = true, -- whether to set jumps in the jumplist
|
|
||||||
goto_next_start = {
|
|
||||||
["]["] = "@function.outer",
|
|
||||||
["]m"] = "@class.outer"
|
|
||||||
},
|
|
||||||
goto_next_end = {
|
|
||||||
["]]"] = "@function.outer",
|
|
||||||
["]M"] = "@class.outer"
|
|
||||||
},
|
|
||||||
goto_previous_start = {
|
|
||||||
["[["] = "@function.outer",
|
|
||||||
["[m"] = "@class.outer"
|
|
||||||
},
|
|
||||||
goto_previous_end = {
|
|
||||||
["[]"] = "@function.outer",
|
|
||||||
["[M"] = "@class.outer"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
217
home/.config/nvim/lua/modules/tools.lua
Normal file
217
home/.config/nvim/lua/modules/tools.lua
Normal file
@ -0,0 +1,217 @@
|
|||||||
|
local M = {}
|
||||||
|
|
||||||
|
function M.telescope_conf()
|
||||||
|
require('telescope').setup {
|
||||||
|
defaults = {
|
||||||
|
prompt_prefix = ' ',
|
||||||
|
selection_caret = ' ',
|
||||||
|
set_env = {['COLORTERM'] = 'truecolor'},
|
||||||
|
layout_strategy = 'horizontal',
|
||||||
|
layout_config = {
|
||||||
|
horizontal = {
|
||||||
|
preview_width = 0.6
|
||||||
|
},
|
||||||
|
-- prompt_position = 'top',
|
||||||
|
width = 0.8,
|
||||||
|
height = 0.8
|
||||||
|
},
|
||||||
|
file_ignore_patterns = {'.git', '.svn', '.hg', 'node_modules'}
|
||||||
|
},
|
||||||
|
pickers = {
|
||||||
|
find_files = {
|
||||||
|
hidden = true,
|
||||||
|
follow = true
|
||||||
|
},
|
||||||
|
grep_string = {
|
||||||
|
opts = '--hidden'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
extensions = {
|
||||||
|
project = {
|
||||||
|
base_dirs = {{'~/Code', max_depth = 2}}
|
||||||
|
},
|
||||||
|
fzf = {
|
||||||
|
fuzzy = true,
|
||||||
|
override_generic_sorter = false,
|
||||||
|
override_file_sorter = true,
|
||||||
|
case_mode = 'smart_case'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
require('telescope').load_extension('project')
|
||||||
|
require('telescope').load_extension('fzf')
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.nnn_conf()
|
||||||
|
require('nnn').setup {
|
||||||
|
set_default_mappings = false,
|
||||||
|
session = 'global',
|
||||||
|
layout = {
|
||||||
|
window = {width = 0.8, height = 0.8, highlight = 'Debug'},
|
||||||
|
},
|
||||||
|
command = 'nnn -HUdex',
|
||||||
|
action = {
|
||||||
|
['<c-t>'] = 'tab split',
|
||||||
|
['<c-h>'] = 'split',
|
||||||
|
['<c-v>'] = 'vsplit'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.octo_conf()
|
||||||
|
require('octo').setup()
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.neogit_conf()
|
||||||
|
require('neogit').setup {
|
||||||
|
integrations = {
|
||||||
|
diffview = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.markdown_preview_conf()
|
||||||
|
vim.g.mkdp_refresh_slow = 1
|
||||||
|
vim.g.mkdp_filetypes = {
|
||||||
|
'markdown',
|
||||||
|
'pandoc.markdown',
|
||||||
|
'rmd'
|
||||||
|
}
|
||||||
|
-- vim.g.mkdp_page_title = '「${name}」'
|
||||||
|
-- vim.g.mkdp_echo_preview_url = 1
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.zenmode_conf()
|
||||||
|
require('zen-mode').setup {
|
||||||
|
window = {
|
||||||
|
options = {
|
||||||
|
signcolumn = 'no',
|
||||||
|
number = false,
|
||||||
|
relativenumber = false,
|
||||||
|
cursorline = false,
|
||||||
|
cursorcolumn = false,
|
||||||
|
foldcolumn = '0'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
on_open = function()
|
||||||
|
vim.cmd('TSContextDisable')
|
||||||
|
vim.cmd('IndentBlanklineDisable')
|
||||||
|
end,
|
||||||
|
on_close = function()
|
||||||
|
vim.cmd('TSContextEnable')
|
||||||
|
-- vim.cmd('IndentBlanklineEnable')
|
||||||
|
end
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.orgmode_conf()
|
||||||
|
local c = require('colors.' .. vim.g.global_theme).colors
|
||||||
|
|
||||||
|
require('orgmode').setup({
|
||||||
|
-- General settings
|
||||||
|
org_agenda_files = {'~/Documents/Org/agenda/*'},
|
||||||
|
org_default_notes_file = '~/Documents/Org/notes.org',
|
||||||
|
org_todo_keywords = {
|
||||||
|
'TODO', 'PROJ', 'LOOP', 'STRT', 'WAIT', 'HOLD', 'IDEA', 'DONE', 'KILL',
|
||||||
|
'[ ]', '[-]', '[X]' , '|', 'OKAY', 'YES', 'NO'
|
||||||
|
},
|
||||||
|
org_todo_keyword_faces = {
|
||||||
|
TODO = ':foreground ' .. c.green .. ' :weight bold',
|
||||||
|
PROJ = ':foreground ' .. c.grey_bright .. ' :weight bold :slant italic',
|
||||||
|
LOOP = ':foreground ' .. c.green .. ' :weight bold :underline on',
|
||||||
|
STRT = ':foreground ' .. c.blue .. ' :weight bold',
|
||||||
|
WAIT = ':foreground ' .. c.yellow .. ' :weight bold',
|
||||||
|
HOLD = ':foreground ' .. c.yellow .. ' :weight bold :slant italic',
|
||||||
|
IDEA = ':foreground ' .. c.green .. ' :weight bold :slant italic',
|
||||||
|
DONE = ':foreground ' .. c.grey2 .. ' :weight bold',
|
||||||
|
KILL = ':foreground ' .. c.red .. ' :weight bold',
|
||||||
|
OKAY = ':foreground ' .. c.grey1 .. ' :weight bold :slant italic',
|
||||||
|
YES = ':foreground ' .. c.grey1 .. ' :weight bold :underline on',
|
||||||
|
NO = ':foreground ' .. c.red .. ' :weight bold :underline on'
|
||||||
|
},
|
||||||
|
org_hide_leading_stars = true,
|
||||||
|
org_highlight_latex_and_related = 'entities',
|
||||||
|
|
||||||
|
-- Agenda settings
|
||||||
|
org_deadline_warning_days = 7,
|
||||||
|
org_agenda_span = 'week',
|
||||||
|
org_agenda_start_on_weekday = 7, -- Start a week in Sunday
|
||||||
|
org_agenda_min_height = 15,
|
||||||
|
|
||||||
|
-- Tags settings
|
||||||
|
org_use_tag_inheritance = false
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.translate_conf()
|
||||||
|
vim.g.trans_join_lines = 1
|
||||||
|
vim.g.trans_win_height = 15
|
||||||
|
vim.g.trans_default_direction = ':ja'
|
||||||
|
vim.g.trans_directions_list = {
|
||||||
|
{'', 'en'},
|
||||||
|
{'', 'ja'},
|
||||||
|
{'', 'de'},
|
||||||
|
{'', 'ru'},
|
||||||
|
{'', 'fr'},
|
||||||
|
{'', 'nl'},
|
||||||
|
{'', 'es'},
|
||||||
|
{'', 'zh-CN'},
|
||||||
|
{'', 'zh-TW'}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.toggleterm_conf()
|
||||||
|
require('toggleterm').setup {
|
||||||
|
shade_terminals = false,
|
||||||
|
float_opts = {
|
||||||
|
border = 'curved',
|
||||||
|
-- width = 80,
|
||||||
|
-- height = 80,
|
||||||
|
winblend = 3,
|
||||||
|
highlights = {
|
||||||
|
border = 'Normal',
|
||||||
|
background = 'Normal'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.wilder_conf()
|
||||||
|
vim.cmd [[ call wilder#setup({'modes': [':', '/', '?']}) ]]
|
||||||
|
|
||||||
|
-- Doesn't work yet. Bugs in Neovim (see neovim/neovim#14809 and gelguy/wilder.nvim#53)
|
||||||
|
-- so can't do multi-line config inside vim.cmd [[ ]] with \
|
||||||
|
-- vim.cmd [[
|
||||||
|
-- call wilder#set_option('renderer', wilder#renderer_mux({
|
||||||
|
-- \ ':': wilder#popupmenu_renderer({
|
||||||
|
-- \ 'highlighter': wilder#basic_highlighter(),
|
||||||
|
-- \ 'left': wilder#popupmenu_devicons(),
|
||||||
|
-- \ 'right': [' ', wilder#popupmenu_scrollbar()]
|
||||||
|
-- \ }),
|
||||||
|
-- \ '/': wilder#wildmenu_renderer({
|
||||||
|
-- \ 'highlighter': wilder#basic_highlighter(),
|
||||||
|
-- \ 'separator': ' · ',
|
||||||
|
-- \ 'right': [' ', wilder#wildmenu_index()]
|
||||||
|
-- \ })
|
||||||
|
-- \ }))
|
||||||
|
-- ]]
|
||||||
|
|
||||||
|
-- vim.cmd [[
|
||||||
|
-- call wilder#set_option('pipeline', [
|
||||||
|
-- \ wilder#branch(
|
||||||
|
-- \ wilder#python_file_finder_pipeline({
|
||||||
|
-- \ 'file_command': ['fd', '--type', 'f', '--follow', '--hidden', '--exclude', '.git'],
|
||||||
|
-- \ 'dir_command': ['fd', '--type', 'd', '--follow', '--hidden', '--exclude', '.git']
|
||||||
|
-- \ }),
|
||||||
|
-- \ wilder#cmdline_pipeline({'language': 'python'}),
|
||||||
|
-- \ wilder#python_search_pipeline()
|
||||||
|
-- \ )
|
||||||
|
-- \ ])
|
||||||
|
-- ]]
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.neoscroll_conf()
|
||||||
|
require('neoscroll').setup()
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
@ -1,18 +0,0 @@
|
|||||||
local function translate_options()
|
|
||||||
vim.g.trans_join_lines = 1
|
|
||||||
vim.g.trans_win_height = 15
|
|
||||||
vim.g.trans_default_direction = ':ja'
|
|
||||||
vim.g.trans_directions_list = {
|
|
||||||
{'', 'en'},
|
|
||||||
{'', 'ja'},
|
|
||||||
{'', 'de'},
|
|
||||||
{'', 'ru'},
|
|
||||||
{'', 'fr'},
|
|
||||||
{'', 'nl'},
|
|
||||||
{'', 'es'},
|
|
||||||
{'', 'zh-CN'},
|
|
||||||
{'', 'zh-TW'}
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
translate_options()
|
|
401
home/.config/nvim/lua/modules/ui.lua
Normal file
401
home/.config/nvim/lua/modules/ui.lua
Normal file
@ -0,0 +1,401 @@
|
|||||||
|
local M = {}
|
||||||
|
|
||||||
|
function M.dashboard_conf()
|
||||||
|
-- vim.g.dashboard_disable_at_vimenter = 1
|
||||||
|
-- vim.g.dashboard_disable_statusline = 1
|
||||||
|
vim.g.dashboard_preview_file_height = 12
|
||||||
|
vim.g.dashboard_preview_file_width = 80
|
||||||
|
vim.g.dashboard_default_executive = 'telescope'
|
||||||
|
vim.g.dashboard_session_directory = vim.fn.stdpath('data') .. '/sessions'
|
||||||
|
vim.g.dashboard_custom_section = {
|
||||||
|
a = {description = {' Find File SPC f f'}, command = 'DashboardFindFile'},
|
||||||
|
b = {description = {' Recents SPC f o'}, command = 'DashboardFindHistory'},
|
||||||
|
c = {description = {' Find Word SPC f g'}, command = 'DashboardFindWord'},
|
||||||
|
d = {description = {'洛 New File SPC b n'}, command = 'DashboardNewFile'},
|
||||||
|
e = {description = {' Bookmarks SPC f m'}, command = 'DashboardJumpMark'}
|
||||||
|
}
|
||||||
|
vim.g.dashboard_custom_header = {
|
||||||
|
" ",
|
||||||
|
" ",
|
||||||
|
" ",
|
||||||
|
"<-. (`-')_ (`-') _ (`-') _ <-. (`-') ",
|
||||||
|
" \\( OO) ) ( OO).-/ .-> _(OO ) (_) \\(OO )_ ",
|
||||||
|
",--./ ,--/ (,------.(`-')----. ,--.(_/,-.\\ ,-(`-'),--./ ,-.)",
|
||||||
|
"| \\ | | | .---'( OO).-. '\\ \\ / (_/ | ( OO)| `.' |",
|
||||||
|
"| . '| |)(| '--. ( _) | | | \\ / / | | )| |'.'| |",
|
||||||
|
"| |\\ | | .--' \\| |)| |_ \\ /_)(| |_/ | | | |",
|
||||||
|
"| | \\ | | `---. ' '-' '\\-'\\ / | |'->| | | |",
|
||||||
|
"`--' `--' `------' `-----' `-' `--' `--' `--'",
|
||||||
|
}
|
||||||
|
vim.g.dashboard_custom_footer = {
|
||||||
|
'おかえりなさい'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.statusline_conf()
|
||||||
|
local gl = require('galaxyline')
|
||||||
|
local gls = gl.section
|
||||||
|
local condition = require('galaxyline.condition')
|
||||||
|
local colors = require('colors.' .. vim.g.global_theme).colors
|
||||||
|
|
||||||
|
gl.short_line_list = {'NvimTree', 'packer', 'Outline'}
|
||||||
|
|
||||||
|
gls.left[1] = {
|
||||||
|
LeftCorner = {
|
||||||
|
provider = function()
|
||||||
|
return '▊ '
|
||||||
|
end,
|
||||||
|
highlight = {colors.blue, colors.grey1}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[2] = {
|
||||||
|
ViMode = {
|
||||||
|
provider = function()
|
||||||
|
local mode_color = {
|
||||||
|
n = colors.green, -- Normal
|
||||||
|
no = colors.green, -- N-Pending
|
||||||
|
i = colors.blue, -- Insert
|
||||||
|
ic = colors.blue, -- Insert
|
||||||
|
v = colors.yellow, -- Visual
|
||||||
|
[''] = colors.yellow, -- V-Block
|
||||||
|
V = colors.yellow, -- V-Line
|
||||||
|
c = colors.white2, -- Command
|
||||||
|
s = colors.purple, -- Select
|
||||||
|
S = colors.purple, -- S-Line
|
||||||
|
[''] = colors.purple, -- S-Block
|
||||||
|
R = colors.red, -- Replace
|
||||||
|
Rv = colors.red, -- V-Replace
|
||||||
|
cv = colors.white2, -- Vim-Ex
|
||||||
|
ce = colors.white2, -- Ex
|
||||||
|
r = colors.cyan, -- Prompt
|
||||||
|
rm = colors.cyan, -- More
|
||||||
|
['r?'] = colors.cyan, -- Confirm
|
||||||
|
['!'] = colors.orange, -- Shell
|
||||||
|
t = colors.orange -- Terminal
|
||||||
|
}
|
||||||
|
vim.api.nvim_command('hi GalaxyViMode guifg=' .. mode_color[vim.fn.mode()])
|
||||||
|
return ' '
|
||||||
|
end,
|
||||||
|
highlight = {colors.green, colors.grey1}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[3] = {
|
||||||
|
FileSize = {
|
||||||
|
provider = 'FileSize',
|
||||||
|
condition = condition.buffer_not_empty,
|
||||||
|
highlight = {colors.fg, colors.grey1}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[4] ={
|
||||||
|
FileIcon = {
|
||||||
|
provider = 'FileIcon',
|
||||||
|
condition = condition.buffer_not_empty,
|
||||||
|
highlight = {
|
||||||
|
require('galaxyline.provider_fileinfo').get_file_icon_color,
|
||||||
|
colors.grey1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[5] = {
|
||||||
|
FileName = {
|
||||||
|
provider = 'FileName',
|
||||||
|
condition = condition.buffer_not_empty,
|
||||||
|
highlight = {colors.fg, colors.grey1, 'bold'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[6] = {
|
||||||
|
LineInfo = {
|
||||||
|
provider = 'LineColumn',
|
||||||
|
highlight = {colors.fg, colors.grey1}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[7] = {
|
||||||
|
PerCent = {
|
||||||
|
provider = 'LinePercent',
|
||||||
|
highlight = {colors.fg, colors.grey1, 'bold'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[8] = {
|
||||||
|
DiagnosticError = {
|
||||||
|
provider = 'DiagnosticError',
|
||||||
|
icon = ' ',
|
||||||
|
highlight = {colors.red, colors.grey1}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[9] = {
|
||||||
|
DiagnosticWarn = {
|
||||||
|
provider = 'DiagnosticWarn',
|
||||||
|
icon = ' ',
|
||||||
|
highlight = {colors.yellow, colors.grey1}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[10] = {
|
||||||
|
DiagnosticHint = {
|
||||||
|
provider = 'DiagnosticHint',
|
||||||
|
icon = ' ',
|
||||||
|
highlight = {colors.cyan, colors.grey1}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[11] = {
|
||||||
|
DiagnosticInfo = {
|
||||||
|
provider = 'DiagnosticInfo',
|
||||||
|
icon = ' ',
|
||||||
|
highlight = {colors.blue, colors.grey1}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[1] = {
|
||||||
|
ShowLspClient = {
|
||||||
|
provider = 'GetLspClient',
|
||||||
|
condition = function ()
|
||||||
|
local tbl = {['dashboard'] = true, [''] = true}
|
||||||
|
if tbl[vim.bo.filetype] then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end,
|
||||||
|
icon = ' LSP:',
|
||||||
|
highlight = {colors.purple, colors.grey1, 'bold'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[2] = {
|
||||||
|
FileEncode = {
|
||||||
|
provider = 'FileEncode',
|
||||||
|
condition = condition.hide_in_width,
|
||||||
|
separator = ' ',
|
||||||
|
separator_highlight = {'NONE', colors.grey1},
|
||||||
|
highlight = {colors.fg, colors.grey1}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[3] = {
|
||||||
|
FileFormat = {
|
||||||
|
provider = 'FileFormat',
|
||||||
|
condition = condition.hide_in_width,
|
||||||
|
separator = ' ',
|
||||||
|
separator_highlight = {'NONE', colors.grey1},
|
||||||
|
highlight = {colors.fg, colors.grey1}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[4] = {
|
||||||
|
GitIcon = {
|
||||||
|
provider = function() return ' ' end,
|
||||||
|
condition = condition.check_git_workspace,
|
||||||
|
separator = ' ',
|
||||||
|
separator_highlight = {'NONE', colors.grey1},
|
||||||
|
highlight = {colors.green, colors.grey1, 'bold'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[5] = {
|
||||||
|
GitBranch = {
|
||||||
|
provider = 'GitBranch',
|
||||||
|
condition = condition.check_git_workspace,
|
||||||
|
highlight = {colors.green, colors.grey1, 'bold'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[6] = {
|
||||||
|
GitSeparator = {
|
||||||
|
provider = function()
|
||||||
|
return ' '
|
||||||
|
end,
|
||||||
|
highlight = {colors.green, colors.grey1}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[7] = {
|
||||||
|
DiffAdd = {
|
||||||
|
provider = 'DiffAdd',
|
||||||
|
condition = condition.hide_in_width,
|
||||||
|
icon = ' ',
|
||||||
|
highlight = {colors.green, colors.grey1}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[8] = {
|
||||||
|
DiffModified = {
|
||||||
|
provider = 'DiffModified',
|
||||||
|
condition = condition.hide_in_width,
|
||||||
|
icon = '柳',
|
||||||
|
highlight = {colors.yellow, colors.grey1}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[9] = {
|
||||||
|
DiffRemove = {
|
||||||
|
provider = 'DiffRemove',
|
||||||
|
condition = condition.hide_in_width,
|
||||||
|
icon = ' ',
|
||||||
|
highlight = {colors.red, colors.grey1}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.short_line_left[1] = {
|
||||||
|
BufferType = {
|
||||||
|
provider = 'FileTypeName',
|
||||||
|
separator = ' ',
|
||||||
|
separator_highlight = {'NONE', colors.grey1},
|
||||||
|
highlight = {colors.blue, colors.grey1, 'bold'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.short_line_left[2] = {
|
||||||
|
SFileName = {
|
||||||
|
provider = 'SFileName',
|
||||||
|
condition = condition.buffer_not_empty,
|
||||||
|
highlight = {colors.fg, colors.grey1, 'bold'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.short_line_right[1] = {
|
||||||
|
BufferIcon = {
|
||||||
|
provider= 'BufferIcon',
|
||||||
|
highlight = {colors.fg, colors.grey1}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.bufferline_conf()
|
||||||
|
require('bufferline').setup {
|
||||||
|
options = {
|
||||||
|
numbers = 'none',
|
||||||
|
max_name_length = 16,
|
||||||
|
max_prefix_length = 14,
|
||||||
|
tab_size = 20,
|
||||||
|
diagnostics = 'nvim_lsp',
|
||||||
|
show_close_icon = false,
|
||||||
|
show_buffer_icons = true,
|
||||||
|
show_tab_indicators = true,
|
||||||
|
enforce_regular_tabs = false,
|
||||||
|
show_buffer_close_icons = true,
|
||||||
|
always_show_bufferline = true,
|
||||||
|
offsets = {
|
||||||
|
{filetype = 'NvimTree', text = 'NvimTree', text_align = 'left'},
|
||||||
|
{filetype = 'packer', text = 'Packer', text_align = 'left'}
|
||||||
|
},
|
||||||
|
separator_style = 'thin'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.nvimtree_conf()
|
||||||
|
vim.g.nvim_tree_width = 35
|
||||||
|
vim.g.nvim_tree_ignore = {'.git', '.hg', '.svn', 'node_modules'}
|
||||||
|
vim.g.nvim_tree_auto_open = 0
|
||||||
|
vim.g.nvim_tree_auto_close = 1
|
||||||
|
vim.g.nvim_tree_auto_ignore_ft = {'dashboard'}
|
||||||
|
vim.g.nvim_tree_follow = 1
|
||||||
|
vim.g.nvim_tree_indent_markers = 1
|
||||||
|
vim.g.nvim_tree_git_hl = 1
|
||||||
|
vim.g.nvim_tree_auto_resize = 0
|
||||||
|
-- vim.g.nvim_tree_add_trailing = 1
|
||||||
|
vim.g.nvim_tree_lsp_diagnostics = 1
|
||||||
|
vim.g.nvim_tree_icons = {
|
||||||
|
default = '',
|
||||||
|
symlink = '',
|
||||||
|
git = {
|
||||||
|
unstaged = '',
|
||||||
|
staged = '',
|
||||||
|
unmerged = '',
|
||||||
|
renamed = '',
|
||||||
|
untracked = '★',
|
||||||
|
deleted = '',
|
||||||
|
ignored = ''
|
||||||
|
},
|
||||||
|
folder = {
|
||||||
|
arrow_open = '',
|
||||||
|
arrow_closed = '',
|
||||||
|
default = '',
|
||||||
|
open = '',
|
||||||
|
empty = '',
|
||||||
|
empty_open = '',
|
||||||
|
symlink = '',
|
||||||
|
symlink_open = ''
|
||||||
|
},
|
||||||
|
lsp = {
|
||||||
|
hint = '',
|
||||||
|
info = '',
|
||||||
|
warning = '',
|
||||||
|
error = ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.whichkey_conf()
|
||||||
|
require('which-key').setup {
|
||||||
|
plugins = {
|
||||||
|
spelling = {
|
||||||
|
enabled = true,
|
||||||
|
suggestions = 30
|
||||||
|
}
|
||||||
|
},
|
||||||
|
icons = {
|
||||||
|
breadcrumb = '»',
|
||||||
|
separator = 'ﰲ',
|
||||||
|
group = '+'
|
||||||
|
},
|
||||||
|
layout = {
|
||||||
|
align = 'center'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.gitsigns_conf()
|
||||||
|
require('gitsigns').setup {
|
||||||
|
signs = {
|
||||||
|
add = {hl = 'DiffAdd' , text = '', numhl='GitSignsAddNr'},
|
||||||
|
change = {hl = 'DiffChange', text = '', numhl='GitSignsChangeNr'},
|
||||||
|
delete = {hl = 'DiffDelete', text = '', numhl='GitSignsDeleteNr'},
|
||||||
|
topdelete = {hl = 'DiffDelete', text = '', numhl='GitSignsDeleteNr'},
|
||||||
|
changedelete = {hl = 'DiffChange', text = '', numhl='GitSignsChangeNr'}
|
||||||
|
},
|
||||||
|
numhl = true,
|
||||||
|
keymaps = {
|
||||||
|
-- Default keymap options
|
||||||
|
noremap = true,
|
||||||
|
buffer = true,
|
||||||
|
|
||||||
|
['n ]g'] = {expr = true, '&diff ? \']g\' : \'<cmd>lua require"gitsigns.actions".next_hunk()<CR>\''},
|
||||||
|
['n [g'] = {expr = true, '&diff ? \'[g\' : \'<cmd>lua require"gitsigns.actions".prev_hunk()<CR>\''},
|
||||||
|
|
||||||
|
['n <leader>gs'] = '<cmd>lua require"gitsigns".stage_hunk()<CR>',
|
||||||
|
['v <leader>gs'] = '<cmd>lua require"gitsigns".stage_hunk({vim.fn.line("."), vim.fn.line("v")})<CR>',
|
||||||
|
['n <leader>gu'] = '<cmd>lua require"gitsigns".undo_stage_hunk()<CR>',
|
||||||
|
['n <leader>gr'] = '<cmd>lua require"gitsigns".reset_hunk()<CR>',
|
||||||
|
['v <leader>gr'] = '<cmd>lua require"gitsigns".reset_hunk({vim.fn.line("."), vim.fn.line("v")})<CR>',
|
||||||
|
['n <leader>gR'] = '<cmd>lua require"gitsigns".reset_buffer()<CR>',
|
||||||
|
['n <leader>gp'] = '<cmd>lua require"gitsigns".preview_hunk()<CR>',
|
||||||
|
['n <leader>gb'] = '<cmd>lua require"gitsigns".blame_line(true)<CR>'
|
||||||
|
},
|
||||||
|
watch_index = {
|
||||||
|
interval = 1000,
|
||||||
|
follow_files = true
|
||||||
|
},
|
||||||
|
current_line_blame = false,
|
||||||
|
current_line_blame_opts = {
|
||||||
|
delay = 1000,
|
||||||
|
virt_text = true,
|
||||||
|
virt_text_pos = 'eol'
|
||||||
|
},
|
||||||
|
sign_priority = 6,
|
||||||
|
update_debounce = 100,
|
||||||
|
status_formatter = nil, -- Use default
|
||||||
|
word_diff = false,
|
||||||
|
use_internal_diff = true -- If luajit is present
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
@ -1,16 +0,0 @@
|
|||||||
return require('which-key').setup {
|
|
||||||
plugins = {
|
|
||||||
spelling = {
|
|
||||||
enabled = true,
|
|
||||||
suggestions = 30
|
|
||||||
}
|
|
||||||
},
|
|
||||||
icons = {
|
|
||||||
breadcrumb = "»",
|
|
||||||
separator = "ﰲ",
|
|
||||||
group = "+"
|
|
||||||
},
|
|
||||||
layout = {
|
|
||||||
align = 'center'
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
return require('zen-mode').setup {
|
|
||||||
window = {
|
|
||||||
options = {
|
|
||||||
signcolumn = 'no',
|
|
||||||
number = false,
|
|
||||||
relativenumber = false,
|
|
||||||
cursorline = false,
|
|
||||||
cursorcolumn = false,
|
|
||||||
foldcolumn = '0'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
on_open = function(win)
|
|
||||||
vim.cmd('TSContextDisable')
|
|
||||||
vim.cmd('IndentBlanklineDisable')
|
|
||||||
end,
|
|
||||||
on_close = function()
|
|
||||||
vim.cmd('TSContextEnable')
|
|
||||||
-- vim.cmd('IndentBlanklineEnable')
|
|
||||||
end,
|
|
||||||
}
|
|
@ -1,11 +1,8 @@
|
|||||||
local opt = vim.opt
|
local opt = vim.opt
|
||||||
|
|
||||||
local function load_options()
|
local function load_options()
|
||||||
vim.cmd('filetype indent plugin on')
|
|
||||||
vim.cmd('syntax on')
|
|
||||||
-- vim.cmd('set iskeyword+=-')
|
|
||||||
|
|
||||||
-- General settings
|
-- General settings
|
||||||
|
opt.termguicolors = true
|
||||||
opt.mouse = 'nv'
|
opt.mouse = 'nv'
|
||||||
opt.errorbells = false
|
opt.errorbells = false
|
||||||
opt.visualbell = false
|
opt.visualbell = false
|
||||||
|
@ -16,6 +16,7 @@ return require('packer').startup(
|
|||||||
--------
|
--------
|
||||||
-- UI --
|
-- UI --
|
||||||
--------
|
--------
|
||||||
|
local ui = require('modules.ui')
|
||||||
use {
|
use {
|
||||||
'glepnir/dashboard-nvim',
|
'glepnir/dashboard-nvim',
|
||||||
cmd = {
|
cmd = {
|
||||||
@ -28,57 +29,44 @@ return require('packer').startup(
|
|||||||
'SessionLoad',
|
'SessionLoad',
|
||||||
'SessionSave'
|
'SessionSave'
|
||||||
},
|
},
|
||||||
setup = function()
|
setup = ui.dashboard_conf
|
||||||
require('modules.dashboard')
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
use { -- TODO: consider moving to felline.nvim
|
use { -- TODO: consider moving to felline.nvim
|
||||||
'glepnir/galaxyline.nvim',
|
'glepnir/galaxyline.nvim',
|
||||||
branch = 'main',
|
branch = 'main',
|
||||||
requires = 'kyazdani42/nvim-web-devicons',
|
requires = 'kyazdani42/nvim-web-devicons',
|
||||||
config = function()
|
config = ui.statusline_conf
|
||||||
require('modules.statusline')
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'akinsho/nvim-bufferline.lua',
|
'akinsho/nvim-bufferline.lua',
|
||||||
event = 'BufRead',
|
event = 'BufRead',
|
||||||
config = function()
|
config = ui.bufferline_conf
|
||||||
require('modules.bufferline')
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'kyazdani42/nvim-tree.lua',
|
'kyazdani42/nvim-tree.lua',
|
||||||
cmd = 'NvimTreeToggle',
|
cmd = 'NvimTreeToggle',
|
||||||
setup = function()
|
setup = ui.nvimtree_conf
|
||||||
require('modules.nvimtree')
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'folke/which-key.nvim',
|
'folke/which-key.nvim',
|
||||||
config = function()
|
config = ui.whichkey_conf
|
||||||
require('modules.whichkey')
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
------------------
|
|
||||||
-- Highlighting --
|
|
||||||
------------------
|
|
||||||
use {
|
use {
|
||||||
'lewis6991/gitsigns.nvim',
|
'lewis6991/gitsigns.nvim',
|
||||||
event = {'BufRead', 'BufNewFile'},
|
event = {'BufRead', 'BufNewFile'},
|
||||||
wants = 'plenary.nvim',
|
wants = 'plenary.nvim',
|
||||||
requires = {{'nvim-lua/plenary.nvim', opt = true}},
|
requires = {{'nvim-lua/plenary.nvim', opt = true}},
|
||||||
config = function()
|
config = ui.gitsigns_conf
|
||||||
require('modules.gitgutter')
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
------------
|
||||||
|
-- Editor --
|
||||||
|
------------
|
||||||
|
local editor = require('modules.editor')
|
||||||
use {
|
use {
|
||||||
'norcalli/nvim-colorizer.lua',
|
'norcalli/nvim-colorizer.lua',
|
||||||
cmd = 'ColorizerToggle',
|
cmd = 'ColorizerToggle',
|
||||||
config = function()
|
config = editor.colorizer_conf
|
||||||
require('modules.colorizer')
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'RRethy/vim-illuminate',
|
'RRethy/vim-illuminate',
|
||||||
@ -87,33 +75,19 @@ return require('packer').startup(
|
|||||||
use {
|
use {
|
||||||
'lukas-reineke/indent-blankline.nvim',
|
'lukas-reineke/indent-blankline.nvim',
|
||||||
event = 'BufRead',
|
event = 'BufRead',
|
||||||
config = function()
|
config = editor.blankline_conf
|
||||||
require('modules.blankline')
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
run = ':TSUpdate',
|
run = ':TSUpdate',
|
||||||
event = 'BufRead',
|
event = 'BufRead',
|
||||||
config = function()
|
config = editor.treesitter_conf
|
||||||
require('nvim-treesitter.configs').setup {
|
|
||||||
ensure_installed = 'maintained',
|
|
||||||
highlight = {enable = true}
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'p00f/nvim-ts-rainbow',
|
'p00f/nvim-ts-rainbow',
|
||||||
after = 'nvim-treesitter',
|
after = 'nvim-treesitter',
|
||||||
config = function()
|
-- Putting config into `treesitter_conf` doesn't work for some reason
|
||||||
require('nvim-treesitter.configs').setup {
|
config = editor.rainbow_conf
|
||||||
rainbow = {
|
|
||||||
enable = true,
|
|
||||||
extended_mode = true,
|
|
||||||
max_file_lines = 1000
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'romgrk/nvim-treesitter-context',
|
'romgrk/nvim-treesitter-context',
|
||||||
@ -121,47 +95,51 @@ return require('packer').startup(
|
|||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||||
after = 'nvim-treesitter',
|
after = 'nvim-treesitter'
|
||||||
config = function()
|
|
||||||
require('modules.textobjects')
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'andymass/vim-matchup',
|
'andymass/vim-matchup',
|
||||||
after = 'nvim-treesitter',
|
after = 'nvim-treesitter',
|
||||||
config = function()
|
config = editor.matchup_conf
|
||||||
vim.g.matchup_matchparen_offscreen = {method = 'popup'}
|
}
|
||||||
require('nvim-treesitter.configs').setup {
|
use {
|
||||||
matchup = {enable = true}
|
'machakann/vim-sandwich',
|
||||||
}
|
keys = {'sa', 'sd', 'sr'}
|
||||||
end
|
}
|
||||||
|
use {
|
||||||
|
'phaazon/hop.nvim',
|
||||||
|
cmd = {'HopChar1', 'HopChar2', 'HopWord', 'HopPattern', 'HopLine'},
|
||||||
|
config = editor.hop_conf
|
||||||
|
}
|
||||||
|
use {
|
||||||
|
'junegunn/vim-easy-align',
|
||||||
|
cmd = 'EasyAlign'
|
||||||
|
}
|
||||||
|
use {
|
||||||
|
'terrortylor/nvim-comment',
|
||||||
|
keys = 'gc',
|
||||||
|
config = editor.comment_conf
|
||||||
}
|
}
|
||||||
|
|
||||||
---------
|
---------
|
||||||
-- LSP --
|
-- LSP --
|
||||||
---------
|
---------
|
||||||
|
local lsp = require('modules.lsp')
|
||||||
use {
|
use {
|
||||||
'neovim/nvim-lspconfig',
|
'neovim/nvim-lspconfig',
|
||||||
event = 'BufReadPre',
|
event = 'BufReadPre',
|
||||||
config = function()
|
config = lsp.lsp_conf
|
||||||
require('modules.lsp')
|
}
|
||||||
end
|
use {
|
||||||
|
'nanotee/sqls.nvim',
|
||||||
|
ft = {'sql', 'mysql', 'plsql'},
|
||||||
|
wants = 'nvim-lspconfig',
|
||||||
|
config = lsp.sqls_conf
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'ray-x/lsp_signature.nvim',
|
'ray-x/lsp_signature.nvim',
|
||||||
after = 'nvim-lspconfig'
|
after = 'nvim-lspconfig'
|
||||||
}
|
}
|
||||||
use {
|
|
||||||
'glepnir/lspsaga.nvim',
|
|
||||||
after = 'nvim-lspconfig'
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'onsails/lspkind-nvim',
|
|
||||||
event = 'InsertEnter',
|
|
||||||
config = function()
|
|
||||||
require('lspkind').init({with_text = false})
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use {
|
use {
|
||||||
'ahmedkhalf/lsp-rooter.nvim',
|
'ahmedkhalf/lsp-rooter.nvim',
|
||||||
after = 'nvim-lspconfig'
|
after = 'nvim-lspconfig'
|
||||||
@ -169,38 +147,78 @@ return require('packer').startup(
|
|||||||
use {
|
use {
|
||||||
'folke/trouble.nvim',
|
'folke/trouble.nvim',
|
||||||
cmd = {'Trouble', 'TroubleToggle', 'TroubleRefresh'},
|
cmd = {'Trouble', 'TroubleToggle', 'TroubleRefresh'},
|
||||||
config = function()
|
config = lsp.trouble_conf
|
||||||
require('modules.lsptrouble')
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'simrat39/symbols-outline.nvim',
|
'simrat39/symbols-outline.nvim',
|
||||||
cmd = {'SymbolsOutline', 'SymbolsOutlineOpen'},
|
cmd = {'SymbolsOutline', 'SymbolsOutlineOpen'},
|
||||||
setup = function()
|
setup = lsp.outline_conf
|
||||||
vim.g.symbols_outline = {
|
|
||||||
highlight_hovered_item = false,
|
|
||||||
show_guides = false
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use { -- TODO: replace with nvim-cmp
|
|
||||||
'hrsh7th/nvim-compe',
|
|
||||||
event = 'InsertEnter',
|
|
||||||
config = function()
|
|
||||||
require('modules.completion')
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use { -- TODO: lazy-loaded + work with autopairs
|
|
||||||
'L3MON4D3/LuaSnip',
|
|
||||||
requires = 'rafamadriz/friendly-snippets',
|
|
||||||
config = function()
|
|
||||||
require('modules.snippets')
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
---------------
|
----------------
|
||||||
-- Utilities --
|
-- Completion --
|
||||||
---------------
|
----------------
|
||||||
|
local completion = require('modules.completion')
|
||||||
|
use {
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
event = 'InsertEnter',
|
||||||
|
wants = {'LuaSnip'},
|
||||||
|
requires = {
|
||||||
|
{
|
||||||
|
'L3MON4D3/LuaSnip',
|
||||||
|
wants = 'friendly-snippets',
|
||||||
|
requires = {{'rafamadriz/friendly-snippets', opt = true}},
|
||||||
|
config = completion.snippets_conf,
|
||||||
|
opt = true
|
||||||
|
},
|
||||||
|
{'saadparwaiz1/cmp_luasnip', after = 'nvim-cmp', opt = true},
|
||||||
|
{'hrsh7th/cmp-path', after = 'nvim-cmp', opt = true},
|
||||||
|
{'hrsh7th/cmp-buffer', after = 'nvim-cmp', opt = true},
|
||||||
|
-- {'hrsh7th/cmp-calc', after = 'nvim-cmp', opt = true},
|
||||||
|
-- {'f3fora/cmp-nuspell', after = 'nvim-cmp', rocks={'lua-nuspell'}, opt = true},
|
||||||
|
{'f3fora/cmp-spell', after = 'nvim-cmp', opt = true},
|
||||||
|
{'hrsh7th/cmp-emoji', after = 'nvim-cmp', opt = true},
|
||||||
|
{'hrsh7th/cmp-nvim-lsp', after = 'nvim-cmp', opt = true},
|
||||||
|
{'kdheepak/cmp-latex-symbols', after = 'nvim-cmp', opt = true},
|
||||||
|
{'andersevenrud/compe-tmux', after = 'nvim-cmp', branch = 'cmp', opt = true}
|
||||||
|
},
|
||||||
|
config = completion.cmp_conf
|
||||||
|
}
|
||||||
|
use {
|
||||||
|
'windwp/nvim-autopairs',
|
||||||
|
after = 'nvim-cmp',
|
||||||
|
config = completion.autopairs_conf
|
||||||
|
}
|
||||||
|
-- use {
|
||||||
|
-- 'ms-jpq/coq_nvim',
|
||||||
|
-- branch = 'coq',
|
||||||
|
-- event = 'InsertEnter',
|
||||||
|
-- run = ':COQdeps',
|
||||||
|
-- wants = 'coq.artifacts',
|
||||||
|
-- requires = {{'ms-jpq/coq.artifacts', branch = 'artifacts', opt = true}},
|
||||||
|
-- setup = completion.coq_conf
|
||||||
|
-- }
|
||||||
|
use {
|
||||||
|
'windwp/nvim-ts-autotag',
|
||||||
|
ft = {
|
||||||
|
'html',
|
||||||
|
'xml',
|
||||||
|
'javascript',
|
||||||
|
'javascriptreact',
|
||||||
|
'typescript',
|
||||||
|
'typescriptreact',
|
||||||
|
'vue',
|
||||||
|
'svelte',
|
||||||
|
'php'
|
||||||
|
},
|
||||||
|
wants = 'nvim-treesitter',
|
||||||
|
config = completion.autotag_conf
|
||||||
|
}
|
||||||
|
|
||||||
|
-----------
|
||||||
|
-- Tools --
|
||||||
|
-----------
|
||||||
|
local tools = require('modules.tools')
|
||||||
use {
|
use {
|
||||||
'nvim-telescope/telescope.nvim',
|
'nvim-telescope/telescope.nvim',
|
||||||
cmd = 'Telescope',
|
cmd = 'Telescope',
|
||||||
@ -218,24 +236,18 @@ return require('packer').startup(
|
|||||||
{'nvim-telescope/telescope-project.nvim', opt = true},
|
{'nvim-telescope/telescope-project.nvim', opt = true},
|
||||||
{'nvim-telescope/telescope-fzf-native.nvim', run = 'make', opt = true}
|
{'nvim-telescope/telescope-fzf-native.nvim', run = 'make', opt = true}
|
||||||
},
|
},
|
||||||
config = function()
|
config = tools.telescope_conf
|
||||||
require('modules.telescope-nvim')
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
use { -- Telescope file browser doesn't support dotfiles
|
use { -- Telescope file browser doesn't support dotfiles
|
||||||
'mcchrish/nnn.vim',
|
'mcchrish/nnn.vim',
|
||||||
cmd = 'NnnPicker',
|
cmd = 'NnnPicker',
|
||||||
config = function()
|
config = tools.nnn_conf
|
||||||
require('modules.picker')
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
use { -- TODO: colors + config
|
use { -- TODO: colors + config
|
||||||
'pwntester/octo.nvim',
|
'pwntester/octo.nvim',
|
||||||
cmd = 'Octo',
|
cmd = 'Octo',
|
||||||
wants = 'telescope.nvim',
|
wants = 'telescope.nvim',
|
||||||
config = function()
|
config = tools.octo_conf
|
||||||
require('octo').setup()
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'TimUntersberger/neogit',
|
'TimUntersberger/neogit',
|
||||||
@ -256,37 +268,13 @@ return require('packer').startup(
|
|||||||
opt = true
|
opt = true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
config = function()
|
config = tools.neogit_conf
|
||||||
require('neogit').setup {
|
|
||||||
integrations = {
|
|
||||||
diffview = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'kristijanhusak/vim-dadbod-ui',
|
|
||||||
cmd = {'DBUIToggle', 'DBUIAddConnection', 'DBUI', 'DBUIFindBuffer', 'DBUIRenameBuffer'},
|
|
||||||
wants = 'vim-dadbod',
|
|
||||||
requires = {{'tpope/vim-dadbod', opt = true}},
|
|
||||||
config = function()
|
|
||||||
require('modules.dadbod')
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'kristijanhusak/vim-dadbod-completion',
|
|
||||||
after = 'vim-dadbod-ui',
|
|
||||||
config = function()
|
|
||||||
vim.g.compe.source.vim_dadbod_completion = true
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'iamcco/markdown-preview.nvim',
|
'iamcco/markdown-preview.nvim',
|
||||||
run = 'cd app && yarn install',
|
run = 'cd app && yarn install',
|
||||||
ft = {'markdown', 'pandoc.markdown', 'rmd'},
|
ft = {'markdown', 'pandoc.markdown', 'rmd'},
|
||||||
config = function()
|
config = tools.markdown_preview_conf
|
||||||
require('modules.markdown-preview')
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'turbio/bracey.vim',
|
'turbio/bracey.vim',
|
||||||
@ -298,45 +286,33 @@ return require('packer').startup(
|
|||||||
cmd = 'ZenMode',
|
cmd = 'ZenMode',
|
||||||
wants = 'twilight.nvim',
|
wants = 'twilight.nvim',
|
||||||
requires = {{'folke/twilight.nvim', opt = true}},
|
requires = {{'folke/twilight.nvim', opt = true}},
|
||||||
config = function()
|
config = tools.zenmode_conf
|
||||||
require('modules.zen')
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
use { -- shouldn't be lazy-loaded (otherwise bindings don't work)
|
use { -- shouldn't be lazy-loaded (global bindings don't work)
|
||||||
'kristijanhusak/orgmode.nvim',
|
'kristijanhusak/orgmode.nvim',
|
||||||
ft = 'org',
|
ft = {'org'},
|
||||||
config = function()
|
config = tools.orgmode_conf
|
||||||
require('modules.org')
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'echuraev/translate-shell.vim',
|
'echuraev/translate-shell.vim',
|
||||||
cmd = {'Trans', 'TransSelectDirection'},
|
cmd = {'Trans', 'TransSelectDirection'},
|
||||||
config = function()
|
config = tools.translate_conf
|
||||||
require('modules.translate-shell')
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
'akinsho/nvim-toggleterm.lua',
|
'akinsho/nvim-toggleterm.lua',
|
||||||
cmd = 'ToggleTerm',
|
cmd = 'ToggleTerm',
|
||||||
config = function()
|
config = tools.toggleterm_conf
|
||||||
require('modules.terminal')
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
-- use {
|
-- use {
|
||||||
-- 'gelguy/wilder.nvim',
|
-- 'gelguy/wilder.nvim',
|
||||||
-- run = ':UpdateRemotePlugins',
|
-- run = ':UpdateRemotePlugins',
|
||||||
-- event = 'CmdlineEnter',
|
-- event = 'CmdlineEnter',
|
||||||
-- config = function()
|
-- config = tools.wilder_conf
|
||||||
-- require('modules.cmdline')
|
|
||||||
-- end
|
|
||||||
-- }
|
-- }
|
||||||
use {
|
use {
|
||||||
'karb94/neoscroll.nvim',
|
'karb94/neoscroll.nvim',
|
||||||
event = 'WinScrolled',
|
event = 'WinScrolled',
|
||||||
config = function()
|
config = tools.neoscroll_conf
|
||||||
require('neoscroll').setup()
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
use { -- TODO: colors
|
use { -- TODO: colors
|
||||||
'michaelb/sniprun',
|
'michaelb/sniprun',
|
||||||
@ -349,63 +325,7 @@ return require('packer').startup(
|
|||||||
}
|
}
|
||||||
use {'tweekmonster/startuptime.vim', cmd = 'StartupTime'} -- Just for benchmarking
|
use {'tweekmonster/startuptime.vim', cmd = 'StartupTime'} -- Just for benchmarking
|
||||||
|
|
||||||
------------
|
-- TODO: nvim-lint, rest.nvim, parinfer.nvim, editorconfig.nvim, conjure,
|
||||||
-- Editor --
|
-- nvim-spectre, nvim-dap-ui, dial.nvim, asynctasks.nvim, hotpot.nvim
|
||||||
------------
|
|
||||||
use {
|
|
||||||
'windwp/nvim-autopairs',
|
|
||||||
event = 'InsertCharPre',
|
|
||||||
config = function()
|
|
||||||
require('nvim-autopairs').setup()
|
|
||||||
require('nvim-autopairs.completion.compe').setup({
|
|
||||||
map_cr = true,
|
|
||||||
map_complete = true
|
|
||||||
})
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'machakann/vim-sandwich',
|
|
||||||
keys = {'sa', 'sd', 'sr'}
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'phaazon/hop.nvim',
|
|
||||||
cmd = {'HopChar1', 'HopChar2', 'HopWord', 'HopPattern', 'HopLine'},
|
|
||||||
config = function()
|
|
||||||
require('hop').setup{keys = 'etovxqpdygfblzhckisuran'}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'junegunn/vim-easy-align',
|
|
||||||
cmd = 'EasyAlign'
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'terrortylor/nvim-comment',
|
|
||||||
keys = 'gc',
|
|
||||||
config = function()
|
|
||||||
require('nvim_comment').setup({comment_empty = false})
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'windwp/nvim-ts-autotag',
|
|
||||||
ft = {
|
|
||||||
'html',
|
|
||||||
'xml',
|
|
||||||
'javascript',
|
|
||||||
'javascriptreact',
|
|
||||||
'typescript',
|
|
||||||
'typescriptreact',
|
|
||||||
'vue',
|
|
||||||
'svelte',
|
|
||||||
'php'
|
|
||||||
},
|
|
||||||
wants = 'nvim-treesitter',
|
|
||||||
config = function()
|
|
||||||
require('nvim-treesitter.configs').setup {
|
|
||||||
autotag = {enable = true}
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
-- TODO: nvim-lint, rest.nvim, sqls.nvim, nvim-spectre, nvim-dap-ui, dial.nvim, asynctasks.nvim
|
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user