mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2024-11-28 10:18:25 -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
418f3b462b
commit
3cefe864f4
@ -1,4 +1,4 @@
|
||||
local disable_distribution_plugins = function()
|
||||
local disable_default_plugins = function()
|
||||
vim.g.loaded_gzip = 1
|
||||
vim.g.loaded_tar = 1
|
||||
vim.g.loaded_tarPlugin = 1
|
||||
@ -24,10 +24,10 @@ local load_core = function()
|
||||
vim.g.global_theme = 'nord'
|
||||
|
||||
-- Config
|
||||
vim.g.mapleader = ' '
|
||||
disable_default_plugins()
|
||||
require('options')
|
||||
require('colors.' .. vim.g.global_theme).highlight()
|
||||
disable_distribution_plugins()
|
||||
vim.g.mapleader = ' '
|
||||
require('plugins')
|
||||
require('mappings')
|
||||
require('events').load_autocmds()
|
||||
|
@ -111,8 +111,8 @@ local function highlight_editors()
|
||||
-- Statusline
|
||||
hi('StatusLine' , c.cyan, c.grey3, '', '')
|
||||
hi('StatusLineNC' , c.fg , c.grey3, '', '')
|
||||
-- hi('StatusLineTerm' , c.cyan, c.grey3, '', '')
|
||||
-- hi('StatusLineTermNC', c.fg , c.grey3, '', '')
|
||||
hi('StatusLineTerm' , c.cyan, c.grey3, '', '')
|
||||
hi('StatusLineTermNC', c.fg , c.grey3, '', '')
|
||||
|
||||
-- Search
|
||||
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 Variable Identifier')
|
||||
|
||||
-- sql
|
||||
vim.cmd('hi! link sqlKeyword Keyword')
|
||||
vim.cmd('hi! link sqlSpecial Keyword')
|
||||
|
||||
-- Diff
|
||||
hi('DiffAdd' , c.green , c.grey1, '', '')
|
||||
hi('DiffChange', c.yellow, c.grey1, '', '')
|
||||
@ -284,6 +288,12 @@ local function highlight_plugins()
|
||||
hi('rainbowcol6', c.blue, '', '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
|
||||
hi('BufferLineIndicatorSelected', c.cyan, '', '', '')
|
||||
hi('BufferLineFill', c.grey1, c.grey1, '', '')
|
||||
@ -325,29 +335,6 @@ local function highlight_plugins()
|
||||
-- trouble.nvim
|
||||
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
|
||||
hi('TelescopePromptBorder', c.cyan, '', 'bold', '')
|
||||
hi('TelescopeResultsBorder', c.blue, '', 'bold', '')
|
||||
@ -376,7 +363,6 @@ function M.highlight()
|
||||
vim.cmd('hi clear')
|
||||
if vim.fn.exists('syntax_on') then vim.cmd('syntax reset') end
|
||||
vim.o.background = 'dark'
|
||||
vim.o.termguicolors = true
|
||||
|
||||
-- Load highlight groups
|
||||
local async
|
||||
|
@ -50,7 +50,7 @@ function M.load_autocmds()
|
||||
-- Auto-hide numbers, statusline in specific buffers
|
||||
-- {"BufEnter", "term://*", "setlocal norelativenumber nonumber"},
|
||||
-- {"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 = {
|
||||
|
@ -97,6 +97,7 @@ wk.register({
|
||||
|
||||
-- ToggleTerm
|
||||
['<C-\\>'] = {':ToggleTerm<CR>', 'Toggle terminal'},
|
||||
['<A-\\>'] = {':ToggleTerm direction=float<CR>', 'Toggle float terminal'},
|
||||
|
||||
-- hop.nvim
|
||||
s = {':HopWord<CR>', 'Hop to word'},
|
||||
@ -182,8 +183,8 @@ wk.register({
|
||||
n = 'Rename in buffer',
|
||||
o = 'Format buffer',
|
||||
r = 'Remove workspace folder',
|
||||
s = 'Signature help',
|
||||
w = 'List workspace folders',
|
||||
x = 'Signature help',
|
||||
f = {
|
||||
name = 'Telescope',
|
||||
a = {':Telescope lsp_code_actions<CR>', 'Code actions'},
|
||||
@ -198,11 +199,14 @@ wk.register({
|
||||
S = {':Telescope lsp_workspace_symbols<CR>', 'Workspace symbols'}
|
||||
},
|
||||
g = {':SymbolsOutline<CR>', 'Symbol outline'},
|
||||
D = {'<Cmd>TroubleToggle lsp_definitions<CR>', 'Definition list'},
|
||||
E = {'<Cmd>TroubleToggle lsp_document_diagnostics<CR>', 'Document diagnostics list'},
|
||||
W = {'<Cmd>TroubleToggle lsp_workspace_diagnostics<CR>', 'Workspace diagnostics list'},
|
||||
L = {'<Cmd>TroubleToggle loclist<CR>', 'Location list items'},
|
||||
Q = {'<Cmd>TroubleToggle quickfix<CR>', 'Quickfix list'}
|
||||
t = {
|
||||
name = 'Trouble',
|
||||
d = {':TroubleToggle lsp_definitions<CR>', 'Definition list'},
|
||||
e = {':TroubleToggle lsp_document_diagnostics<CR>', 'Document diagnostics 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'},
|
||||
|
@ -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 {
|
||||
enabled = true,
|
||||
autocomplete = true,
|
||||
debug = false,
|
||||
min_length = 1,
|
||||
preselect = 'always',
|
||||
source = {
|
||||
orgmode = true,
|
||||
path = true,
|
||||
buffer = true,
|
||||
calc = false,
|
||||
nvim_lsp = true,
|
||||
nvim_lua = false,
|
||||
vsnip = false,
|
||||
luasnip = true,
|
||||
utilsnips = false,
|
||||
tags = false,
|
||||
spell = true
|
||||
}
|
||||
}
|
||||
local M = {}
|
||||
|
||||
function M.cmp_conf()
|
||||
local cmp = require('cmp')
|
||||
local luasnip = require('luasnip')
|
||||
|
||||
local check_back_space = function()
|
||||
local col = vim.fn.col '.' - 1
|
||||
return col == 0 or vim.fn.getline('.'):sub(col, col):match '%s' ~= nil
|
||||
end
|
||||
|
||||
-- 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
|
||||
|
||||
local check_back_space = function()
|
||||
local col = vim.fn.col('.') - 1
|
||||
if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
cmp.setup {
|
||||
formatting = {
|
||||
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)
|
||||
|
||||
_G.tab_complete = function()
|
||||
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
|
||||
return t '<C-n>'
|
||||
elseif require('luasnip').expand_or_jumpable() then
|
||||
return t '<Plug>luasnip-expand-or-jump'
|
||||
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
|
||||
return t '<Tab>'
|
||||
vim.fn.feedkeys(t('<Tab>'), 'n')
|
||||
else
|
||||
return vim.fn['compe#complete']()
|
||||
fallback()
|
||||
end
|
||||
end
|
||||
_G.s_tab_complete = function()
|
||||
end, {'i', 's'}),
|
||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
return t '<C-p>'
|
||||
elseif require('luasnip').jumpable(-1) then
|
||||
return t '<Plug>luasnip-jump-prev'
|
||||
vim.fn.feedkeys(t('<C-p>'), 'n')
|
||||
elseif luasnip.jumpable(-1) then
|
||||
vim.fn.feedkeys(t('<Plug>luasnip-jump-prev'), '')
|
||||
else
|
||||
return t '<S-Tab>'
|
||||
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'}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
vim.api.nvim_set_keymap('i', '<Tab>', 'v:lua.tab_complete()', {expr = true})
|
||||
vim.api.nvim_set_keymap('s', '<Tab>', 'v:lua.tab_complete()', {expr = true})
|
||||
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})
|
||||
function M.autopairs_conf()
|
||||
require('nvim-autopairs').setup {fast_wrap = {}}
|
||||
require('nvim-autopairs.completion.cmp').setup({
|
||||
map_cr = true, -- map <CR> on insert mode
|
||||
map_complete = true, -- it will auto insert `(` after select function or method item
|
||||
auto_select = true -- automatically select the first item
|
||||
})
|
||||
end
|
||||
|
||||
vim.api.nvim_set_keymap('i', '<C-Space>', 'compe#complete()', {expr = true})
|
||||
vim.api.nvim_set_keymap('i', '<C-e>', 'compe#close(\'<C-e>\')', {expr = true})
|
||||
function M.snippets_conf()
|
||||
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
|
||||
|
||||
function M.coq_conf()
|
||||
-- To add snippets from lsp servers, change lsp.lua:
|
||||
-----
|
||||
-- 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
|
||||
|
||||
function M.autotag_conf()
|
||||
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,3 +1,6 @@
|
||||
local M = {}
|
||||
|
||||
function M.lsp_conf()
|
||||
local lspconf = require('lspconfig')
|
||||
|
||||
local on_attach = function(client, bufnr)
|
||||
@ -12,7 +15,7 @@ local on_attach = function(client, bufnr)
|
||||
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>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)
|
||||
@ -110,6 +113,7 @@ local servers = {
|
||||
'html',
|
||||
'jsonls',
|
||||
'cmake',
|
||||
'sqls',
|
||||
'rust_analyzer'
|
||||
}
|
||||
for _, server in ipairs(servers) do
|
||||
@ -124,3 +128,39 @@ 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
|
||||
|
||||
function M.trouble_conf()
|
||||
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 = ''
|
||||
}
|
||||
}
|
||||
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 function load_options()
|
||||
vim.cmd('filetype indent plugin on')
|
||||
vim.cmd('syntax on')
|
||||
-- vim.cmd('set iskeyword+=-')
|
||||
|
||||
-- General settings
|
||||
opt.termguicolors = true
|
||||
opt.mouse = 'nv'
|
||||
opt.errorbells = false
|
||||
opt.visualbell = false
|
||||
|
@ -16,6 +16,7 @@ return require('packer').startup(
|
||||
--------
|
||||
-- UI --
|
||||
--------
|
||||
local ui = require('modules.ui')
|
||||
use {
|
||||
'glepnir/dashboard-nvim',
|
||||
cmd = {
|
||||
@ -28,57 +29,44 @@ return require('packer').startup(
|
||||
'SessionLoad',
|
||||
'SessionSave'
|
||||
},
|
||||
setup = function()
|
||||
require('modules.dashboard')
|
||||
end
|
||||
setup = ui.dashboard_conf
|
||||
}
|
||||
use { -- TODO: consider moving to felline.nvim
|
||||
'glepnir/galaxyline.nvim',
|
||||
branch = 'main',
|
||||
requires = 'kyazdani42/nvim-web-devicons',
|
||||
config = function()
|
||||
require('modules.statusline')
|
||||
end
|
||||
config = ui.statusline_conf
|
||||
}
|
||||
use {
|
||||
'akinsho/nvim-bufferline.lua',
|
||||
event = 'BufRead',
|
||||
config = function()
|
||||
require('modules.bufferline')
|
||||
end
|
||||
config = ui.bufferline_conf
|
||||
}
|
||||
use {
|
||||
'kyazdani42/nvim-tree.lua',
|
||||
cmd = 'NvimTreeToggle',
|
||||
setup = function()
|
||||
require('modules.nvimtree')
|
||||
end
|
||||
setup = ui.nvimtree_conf
|
||||
}
|
||||
use {
|
||||
'folke/which-key.nvim',
|
||||
config = function()
|
||||
require('modules.whichkey')
|
||||
end
|
||||
config = ui.whichkey_conf
|
||||
}
|
||||
|
||||
------------------
|
||||
-- Highlighting --
|
||||
------------------
|
||||
use {
|
||||
'lewis6991/gitsigns.nvim',
|
||||
event = {'BufRead', 'BufNewFile'},
|
||||
wants = 'plenary.nvim',
|
||||
requires = {{'nvim-lua/plenary.nvim', opt = true}},
|
||||
config = function()
|
||||
require('modules.gitgutter')
|
||||
end
|
||||
config = ui.gitsigns_conf
|
||||
}
|
||||
|
||||
------------
|
||||
-- Editor --
|
||||
------------
|
||||
local editor = require('modules.editor')
|
||||
use {
|
||||
'norcalli/nvim-colorizer.lua',
|
||||
cmd = 'ColorizerToggle',
|
||||
config = function()
|
||||
require('modules.colorizer')
|
||||
end
|
||||
config = editor.colorizer_conf
|
||||
}
|
||||
use {
|
||||
'RRethy/vim-illuminate',
|
||||
@ -87,33 +75,19 @@ return require('packer').startup(
|
||||
use {
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
event = 'BufRead',
|
||||
config = function()
|
||||
require('modules.blankline')
|
||||
end
|
||||
config = editor.blankline_conf
|
||||
}
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = ':TSUpdate',
|
||||
event = 'BufRead',
|
||||
config = function()
|
||||
require('nvim-treesitter.configs').setup {
|
||||
ensure_installed = 'maintained',
|
||||
highlight = {enable = true}
|
||||
}
|
||||
end
|
||||
config = editor.treesitter_conf
|
||||
}
|
||||
use {
|
||||
'p00f/nvim-ts-rainbow',
|
||||
after = 'nvim-treesitter',
|
||||
config = function()
|
||||
require('nvim-treesitter.configs').setup {
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true,
|
||||
max_file_lines = 1000
|
||||
}
|
||||
}
|
||||
end
|
||||
-- Putting config into `treesitter_conf` doesn't work for some reason
|
||||
config = editor.rainbow_conf
|
||||
}
|
||||
use {
|
||||
'romgrk/nvim-treesitter-context',
|
||||
@ -121,47 +95,51 @@ return require('packer').startup(
|
||||
}
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
after = 'nvim-treesitter',
|
||||
config = function()
|
||||
require('modules.textobjects')
|
||||
end
|
||||
after = 'nvim-treesitter'
|
||||
}
|
||||
use {
|
||||
'andymass/vim-matchup',
|
||||
after = 'nvim-treesitter',
|
||||
config = function()
|
||||
vim.g.matchup_matchparen_offscreen = {method = 'popup'}
|
||||
require('nvim-treesitter.configs').setup {
|
||||
matchup = {enable = true}
|
||||
config = editor.matchup_conf
|
||||
}
|
||||
end
|
||||
use {
|
||||
'machakann/vim-sandwich',
|
||||
keys = {'sa', 'sd', 'sr'}
|
||||
}
|
||||
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 --
|
||||
---------
|
||||
local lsp = require('modules.lsp')
|
||||
use {
|
||||
'neovim/nvim-lspconfig',
|
||||
event = 'BufReadPre',
|
||||
config = function()
|
||||
require('modules.lsp')
|
||||
end
|
||||
config = lsp.lsp_conf
|
||||
}
|
||||
use {
|
||||
'nanotee/sqls.nvim',
|
||||
ft = {'sql', 'mysql', 'plsql'},
|
||||
wants = 'nvim-lspconfig',
|
||||
config = lsp.sqls_conf
|
||||
}
|
||||
use {
|
||||
'ray-x/lsp_signature.nvim',
|
||||
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 {
|
||||
'ahmedkhalf/lsp-rooter.nvim',
|
||||
after = 'nvim-lspconfig'
|
||||
@ -169,38 +147,78 @@ return require('packer').startup(
|
||||
use {
|
||||
'folke/trouble.nvim',
|
||||
cmd = {'Trouble', 'TroubleToggle', 'TroubleRefresh'},
|
||||
config = function()
|
||||
require('modules.lsptrouble')
|
||||
end
|
||||
config = lsp.trouble_conf
|
||||
}
|
||||
use {
|
||||
'simrat39/symbols-outline.nvim',
|
||||
cmd = {'SymbolsOutline', 'SymbolsOutlineOpen'},
|
||||
setup = function()
|
||||
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
|
||||
setup = lsp.outline_conf
|
||||
}
|
||||
|
||||
---------------
|
||||
-- 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 {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
cmd = 'Telescope',
|
||||
@ -218,24 +236,18 @@ return require('packer').startup(
|
||||
{'nvim-telescope/telescope-project.nvim', opt = true},
|
||||
{'nvim-telescope/telescope-fzf-native.nvim', run = 'make', opt = true}
|
||||
},
|
||||
config = function()
|
||||
require('modules.telescope-nvim')
|
||||
end
|
||||
config = tools.telescope_conf
|
||||
}
|
||||
use { -- Telescope file browser doesn't support dotfiles
|
||||
'mcchrish/nnn.vim',
|
||||
cmd = 'NnnPicker',
|
||||
config = function()
|
||||
require('modules.picker')
|
||||
end
|
||||
config = tools.nnn_conf
|
||||
}
|
||||
use { -- TODO: colors + config
|
||||
'pwntester/octo.nvim',
|
||||
cmd = 'Octo',
|
||||
wants = 'telescope.nvim',
|
||||
config = function()
|
||||
require('octo').setup()
|
||||
end
|
||||
config = tools.octo_conf
|
||||
}
|
||||
use {
|
||||
'TimUntersberger/neogit',
|
||||
@ -256,37 +268,13 @@ return require('packer').startup(
|
||||
opt = true
|
||||
}
|
||||
},
|
||||
config = function()
|
||||
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
|
||||
config = tools.neogit_conf
|
||||
}
|
||||
use {
|
||||
'iamcco/markdown-preview.nvim',
|
||||
run = 'cd app && yarn install',
|
||||
ft = {'markdown', 'pandoc.markdown', 'rmd'},
|
||||
config = function()
|
||||
require('modules.markdown-preview')
|
||||
end
|
||||
config = tools.markdown_preview_conf
|
||||
}
|
||||
use {
|
||||
'turbio/bracey.vim',
|
||||
@ -298,45 +286,33 @@ return require('packer').startup(
|
||||
cmd = 'ZenMode',
|
||||
wants = 'twilight.nvim',
|
||||
requires = {{'folke/twilight.nvim', opt = true}},
|
||||
config = function()
|
||||
require('modules.zen')
|
||||
end
|
||||
config = tools.zenmode_conf
|
||||
}
|
||||
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',
|
||||
ft = 'org',
|
||||
config = function()
|
||||
require('modules.org')
|
||||
end
|
||||
ft = {'org'},
|
||||
config = tools.orgmode_conf
|
||||
}
|
||||
use {
|
||||
'echuraev/translate-shell.vim',
|
||||
cmd = {'Trans', 'TransSelectDirection'},
|
||||
config = function()
|
||||
require('modules.translate-shell')
|
||||
end
|
||||
config = tools.translate_conf
|
||||
}
|
||||
use {
|
||||
'akinsho/nvim-toggleterm.lua',
|
||||
cmd = 'ToggleTerm',
|
||||
config = function()
|
||||
require('modules.terminal')
|
||||
end
|
||||
config = tools.toggleterm_conf
|
||||
}
|
||||
-- use {
|
||||
-- 'gelguy/wilder.nvim',
|
||||
-- run = ':UpdateRemotePlugins',
|
||||
-- event = 'CmdlineEnter',
|
||||
-- config = function()
|
||||
-- require('modules.cmdline')
|
||||
-- end
|
||||
-- config = tools.wilder_conf
|
||||
-- }
|
||||
use {
|
||||
'karb94/neoscroll.nvim',
|
||||
event = 'WinScrolled',
|
||||
config = function()
|
||||
require('neoscroll').setup()
|
||||
end
|
||||
config = tools.neoscroll_conf
|
||||
}
|
||||
use { -- TODO: colors
|
||||
'michaelb/sniprun',
|
||||
@ -349,63 +325,7 @@ return require('packer').startup(
|
||||
}
|
||||
use {'tweekmonster/startuptime.vim', cmd = 'StartupTime'} -- Just for benchmarking
|
||||
|
||||
------------
|
||||
-- Editor --
|
||||
------------
|
||||
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
|
||||
-- TODO: nvim-lint, rest.nvim, parinfer.nvim, editorconfig.nvim, conjure,
|
||||
-- nvim-spectre, nvim-dap-ui, dial.nvim, asynctasks.nvim, hotpot.nvim
|
||||
end
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user