From 2b6ae8473e1b0fb8cc0bd16aa8c485a77ee5e847 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 16 Mar 2021 21:54:42 +0100 Subject: renaming, treesitter buggy --- .config/nvim/init.lua | 59 +++---- .config/nvim/lua/_autopairs/init.lua | 40 +++++ .config/nvim/lua/_closetag/init.lua | 3 + .config/nvim/lua/_colorizer/init.lua | 13 ++ .config/nvim/lua/_floaterm/init.lua | 13 ++ .config/nvim/lua/_galaxyline/init.lua | 233 ++++++++++++++++++++++++++++ .config/nvim/lua/_gitblame/init.lua | 2 + .config/nvim/lua/_gitsigns/init.lua | 36 +++++ .config/nvim/lua/_goyo/init.vim | 2 + .config/nvim/lua/_hop/init.lua | 2 + .config/nvim/lua/_kommentary/init.lua | 6 + .config/nvim/lua/_lsp/bash-ls.lua | 2 + .config/nvim/lua/_lsp/docker-ls.lua | 2 + .config/nvim/lua/_lsp/general.lua | 15 ++ .config/nvim/lua/_lsp/init.lua | 19 +++ .config/nvim/lua/_lsp/json-ls.lua | 10 ++ .config/nvim/lua/_lsp/lua-ls.lua | 37 +++++ .config/nvim/lua/_lsp/python-ls.lua | 2 + .config/nvim/lua/_lsp/vim.lua | 2 + .config/nvim/lua/_lsp/wrapper.lua | 129 ++++++++++++++++ .config/nvim/lua/_lsp/yaml-ls.lua | 2 + .config/nvim/lua/_lspkind/init.lua | 26 ++++ .config/nvim/lua/_neogit/init.lua | 1 + .config/nvim/lua/_nvimtree/init.lua | 31 ++++ .config/nvim/lua/_quickscope/init.lua | 7 + .config/nvim/lua/_rnvimr/init.lua | 22 +++ .config/nvim/lua/_startify/init.lua | 41 +++++ .config/nvim/lua/_treesitter/init.lua | 15 ++ .config/nvim/lua/_vim-bbye/init.vim | 1 + .config/nvim/lua/_vim-pydocstring/init.vim | 1 + .config/nvim/lua/_vim-rooter/init.lua | 2 + .config/nvim/lua/_whichkey/init.vim | 236 ++++++++++++++++++++++++++++ .config/nvim/lua/autopairs/init.lua | 40 ----- .config/nvim/lua/barbar/init.lua | 118 -------------- .config/nvim/lua/closetag/init.lua | 3 - .config/nvim/lua/colorizer/init.lua | 13 -- .config/nvim/lua/floaterm/init.lua | 13 -- .config/nvim/lua/galaxyline/init.lua | 233 ---------------------------- .config/nvim/lua/gitblame/init.lua | 2 - .config/nvim/lua/gitsigns/init.lua | 36 ----- .config/nvim/lua/goyo/init.vim | 2 - .config/nvim/lua/hop/init.lua | 2 - .config/nvim/lua/kommentary/init.lua | 6 - .config/nvim/lua/lightbulb/init.lua | 36 ----- .config/nvim/lua/lsp/bash-ls.lua | 2 - .config/nvim/lua/lsp/docker-ls.lua | 2 - .config/nvim/lua/lsp/general.lua | 15 -- .config/nvim/lua/lsp/init.lua | 19 --- .config/nvim/lua/lsp/json-ls.lua | 10 -- .config/nvim/lua/lsp/lua-ls.lua | 37 ----- .config/nvim/lua/lsp/python-ls.lua | 2 - .config/nvim/lua/lsp/vim.lua | 2 - .config/nvim/lua/lsp/wrapper.lua | 129 ---------------- .config/nvim/lua/lsp/yaml-ls.lua | 2 - .config/nvim/lua/lspkind/init.lua | 26 ---- .config/nvim/lua/neogit/init.lua | 1 - .config/nvim/lua/nvimtree/init.lua | 31 ---- .config/nvim/lua/plugins.lua | 8 +- .config/nvim/lua/quickscope/init.lua | 7 - .config/nvim/lua/rnvimr/init.lua | 22 --- .config/nvim/lua/settings.lua | 11 ++ .config/nvim/lua/startify/init.lua | 41 ----- .config/nvim/lua/treesitter/init.lua | 15 -- .config/nvim/lua/utils.lua | 7 + .config/nvim/lua/vim-bbye/init.vim | 1 - .config/nvim/lua/vim-pydocstring/init.vim | 1 - .config/nvim/lua/vim-rooter/init.lua | 2 - .config/nvim/lua/whichkey/init.vim | 238 ----------------------------- 68 files changed, 1004 insertions(+), 1143 deletions(-) create mode 100644 .config/nvim/lua/_autopairs/init.lua create mode 100644 .config/nvim/lua/_closetag/init.lua create mode 100644 .config/nvim/lua/_colorizer/init.lua create mode 100644 .config/nvim/lua/_floaterm/init.lua create mode 100644 .config/nvim/lua/_galaxyline/init.lua create mode 100644 .config/nvim/lua/_gitblame/init.lua create mode 100644 .config/nvim/lua/_gitsigns/init.lua create mode 100644 .config/nvim/lua/_goyo/init.vim create mode 100644 .config/nvim/lua/_hop/init.lua create mode 100644 .config/nvim/lua/_kommentary/init.lua create mode 100644 .config/nvim/lua/_lsp/bash-ls.lua create mode 100644 .config/nvim/lua/_lsp/docker-ls.lua create mode 100644 .config/nvim/lua/_lsp/general.lua create mode 100644 .config/nvim/lua/_lsp/init.lua create mode 100644 .config/nvim/lua/_lsp/json-ls.lua create mode 100644 .config/nvim/lua/_lsp/lua-ls.lua create mode 100644 .config/nvim/lua/_lsp/python-ls.lua create mode 100644 .config/nvim/lua/_lsp/vim.lua create mode 100644 .config/nvim/lua/_lsp/wrapper.lua create mode 100644 .config/nvim/lua/_lsp/yaml-ls.lua create mode 100644 .config/nvim/lua/_lspkind/init.lua create mode 100644 .config/nvim/lua/_neogit/init.lua create mode 100644 .config/nvim/lua/_nvimtree/init.lua create mode 100644 .config/nvim/lua/_quickscope/init.lua create mode 100644 .config/nvim/lua/_rnvimr/init.lua create mode 100644 .config/nvim/lua/_startify/init.lua create mode 100644 .config/nvim/lua/_treesitter/init.lua create mode 100644 .config/nvim/lua/_vim-bbye/init.vim create mode 100644 .config/nvim/lua/_vim-pydocstring/init.vim create mode 100644 .config/nvim/lua/_vim-rooter/init.lua create mode 100644 .config/nvim/lua/_whichkey/init.vim delete mode 100644 .config/nvim/lua/autopairs/init.lua delete mode 100644 .config/nvim/lua/barbar/init.lua delete mode 100644 .config/nvim/lua/closetag/init.lua delete mode 100644 .config/nvim/lua/colorizer/init.lua delete mode 100644 .config/nvim/lua/floaterm/init.lua delete mode 100644 .config/nvim/lua/galaxyline/init.lua delete mode 100644 .config/nvim/lua/gitblame/init.lua delete mode 100644 .config/nvim/lua/gitsigns/init.lua delete mode 100644 .config/nvim/lua/goyo/init.vim delete mode 100644 .config/nvim/lua/hop/init.lua delete mode 100644 .config/nvim/lua/kommentary/init.lua delete mode 100644 .config/nvim/lua/lightbulb/init.lua delete mode 100644 .config/nvim/lua/lsp/bash-ls.lua delete mode 100644 .config/nvim/lua/lsp/docker-ls.lua delete mode 100644 .config/nvim/lua/lsp/general.lua delete mode 100644 .config/nvim/lua/lsp/init.lua delete mode 100644 .config/nvim/lua/lsp/json-ls.lua delete mode 100644 .config/nvim/lua/lsp/lua-ls.lua delete mode 100644 .config/nvim/lua/lsp/python-ls.lua delete mode 100644 .config/nvim/lua/lsp/vim.lua delete mode 100644 .config/nvim/lua/lsp/wrapper.lua delete mode 100644 .config/nvim/lua/lsp/yaml-ls.lua delete mode 100644 .config/nvim/lua/lspkind/init.lua delete mode 100644 .config/nvim/lua/neogit/init.lua delete mode 100644 .config/nvim/lua/nvimtree/init.lua delete mode 100644 .config/nvim/lua/quickscope/init.lua delete mode 100644 .config/nvim/lua/rnvimr/init.lua delete mode 100644 .config/nvim/lua/startify/init.lua delete mode 100644 .config/nvim/lua/treesitter/init.lua delete mode 100644 .config/nvim/lua/vim-bbye/init.vim delete mode 100644 .config/nvim/lua/vim-pydocstring/init.vim delete mode 100644 .config/nvim/lua/vim-rooter/init.lua delete mode 100644 .config/nvim/lua/whichkey/init.vim diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index d0e013a..4ee361e 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -7,39 +7,40 @@ require('colorscheme') -- Plugins require('_compe') require('_telescope') -require('autopairs') -require('_bufferline') -require('closetag') -require('colorizer') -require('floaterm') -require('galaxyline') -require('gitblame') -require('gitsigns') -require('hop') -require('kommentary') --- require('limeligth') -require('neogit') -require('nvimtree') -require('quickscope') -require('rnvimr') -require('startify') -require('treesitter') -require('vim-rooter') +require('_autopairs') +require('_closetag') +require('_colorizer') +require('_floaterm') +require('_gitblame') +require('_gitsigns') +require('_hop') +require('_kommentary') +-- require('_limeligth') +require('_neogit') +require('_nvimtree') +require('_quickscope') +require('_rnvimr') +require('_startify') +-- require('_treesitter') +require('_vim-rooter') +-- bufferline and statusline +require('_galaxyline') +require('_bufferline') -- Load vim scripts -- Which Key (Hope to replace with Lua plugin someday) -vim.cmd('source ~/.config/nvim/lua/whichkey/init.vim') -vim.cmd('source ~/.config/nvim/lua/goyo/init.vim') -vim.cmd('source ~/.config/nvim/lua/vim-bbye/init.vim') +vim.cmd('source ~/.config/nvim/lua/_goyo/init.vim') +vim.cmd('source ~/.config/nvim/lua/_vim-bbye/init.vim') +vim.cmd('source ~/.config/nvim/lua/_whichkey/init.vim') -- LSP -require('lspkind') -require('lsp') +require('_lspkind') +require('_lsp') require('utils') -require('lsp.bash-ls') -require('lsp.docker-ls') -require('lsp.lua-ls') -require('lsp.json-ls') -require('lsp.python-ls') -require('lsp.yaml-ls') +require('_lsp.bash-ls') +require('_lsp.docker-ls') +require('_lsp.lua-ls') +require('_lsp.json-ls') +require('_lsp.python-ls') +require('_lsp.yaml-ls') diff --git a/.config/nvim/lua/_autopairs/init.lua b/.config/nvim/lua/_autopairs/init.lua new file mode 100644 index 0000000..6810a77 --- /dev/null +++ b/.config/nvim/lua/_autopairs/init.lua @@ -0,0 +1,40 @@ +require('nvim-autopairs').setup() + +local pairs_map = { + ["'"] = "'", + ['"'] = '"', + ['('] = ')', + ['['] = ']', + ['{'] = '}', + ['`'] = '`', +} +local disable_filetype = { "TelescopePrompt" } +local break_line_filetype = nil -- mean all file type +local html_break_line_filetype = {'html' , 'vue' , 'typescriptreact' , 'svelte' , 'javascriptreact'} +local ignored_next_char = "%w" + +local remap = vim.api.nvim_set_keymap +local npairs = require('nvim-autopairs') + +-- skip it, if you use another global object +_G.MUtils= {} + +vim.g.completion_confirm_key = "" +MUtils.completion_confirm=function() + if vim.fn.pumvisible() ~= 0 then + if vim.fn.complete_info()["selected"] ~= -1 then + vim.fn["compe#confirm"]() + return npairs.esc("") + else + vim.defer_fn(function() + vim.fn["compe#confirm"]("") + end, 20) + return npairs.esc("") + end + else + return npairs.check_break_line_char() + end +end + + +remap('i' , '','v:lua.MUtils.completion_confirm()', {expr = true , noremap = true}) diff --git a/.config/nvim/lua/_closetag/init.lua b/.config/nvim/lua/_closetag/init.lua new file mode 100644 index 0000000..8c11641 --- /dev/null +++ b/.config/nvim/lua/_closetag/init.lua @@ -0,0 +1,3 @@ +vim.g.closetag_filenames = '*.html,*.xhtml,*.phtml' +vim.g.closetag_xhtml_filenames = '*.xhtml,*.jsx,*.js' +vim.g.closetag_filetypes = 'html,xhtml,phtml,javascript,javascriptreact' diff --git a/.config/nvim/lua/_colorizer/init.lua b/.config/nvim/lua/_colorizer/init.lua new file mode 100644 index 0000000..1e25d7d --- /dev/null +++ b/.config/nvim/lua/_colorizer/init.lua @@ -0,0 +1,13 @@ +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 + }) + diff --git a/.config/nvim/lua/_floaterm/init.lua b/.config/nvim/lua/_floaterm/init.lua new file mode 100644 index 0000000..633df35 --- /dev/null +++ b/.config/nvim/lua/_floaterm/init.lua @@ -0,0 +1,13 @@ +-- Floaterm +vim.g.floaterm_keymap_toggle = '' +vim.g.floaterm_keymap_next = '' +vim.g.floaterm_keymap_prev = '' +vim.g.floaterm_keymap_new = '' +vim.g.floaterm_title='' + +vim.g.floaterm_gitcommit='floaterm' +vim.g.floaterm_autoinsert=1 +vim.g.floaterm_width=0.8 +vim.g.floaterm_height=0.8 +vim.g.floaterm_wintitle=0 +vim.g.floaterm_autoclose=1 diff --git a/.config/nvim/lua/_galaxyline/init.lua b/.config/nvim/lua/_galaxyline/init.lua new file mode 100644 index 0000000..44801cf --- /dev/null +++ b/.config/nvim/lua/_galaxyline/init.lua @@ -0,0 +1,233 @@ +local cmd = vim.cmd +local fn = vim.fn +local gl = require("galaxyline") +local section = gl.section +gl.short_line_list = {"LuaTree", "packager", "Floaterm", "coc-eplorer"} + + +local colors = { + bg = "#0f1419", + fg = "#d0d0d0", + line_bg = "#0f1419", + fg_green = "#90a959", + yellow = "#f4bf75", + cyan = "#75b5aa", + darkblue = "#6a9fb5", + green = "#90a959", + orange = "#D08770", + purple = "#B48EAD", + magenta = "#aa759f", + gray = "#505050", + blue = "#6a9fb5", + red = "#ac4142" +} + +local buffer_not_empty = function() + if fn.empty(fn.expand("%:t")) ~= 1 then + return true + end + return false +end + +section.left[1] = { + FirstElement = { + -- provider = function() return '▊ ' end, + provider = function() + return " " + end, + highlight = {colors.blue, colors.line_bg} + } +} +section.left[2] = { + ViMode = { + provider = function() + -- auto change color according the vim mode + local mode_color = { + n = colors.magenta, + i = colors.green, + v = colors.blue, + [""] = colors.blue, + V = colors.blue, + c = colors.red, + no = colors.magenta, + s = colors.orange, + S = colors.orange, + [""] = colors.orange, + ic = colors.yellow, + R = colors.purple, + Rv = colors.purple, + cv = colors.red, + ce = colors.red, + r = colors.cyan, + rm = colors.cyan, + ["r?"] = colors.cyan, + ["!"] = colors.red, + t = colors.red + } + cmd("hi GalaxyViMode guifg=" .. mode_color[fn.mode()]) + return "  " + end, + highlight = {colors.red, colors.line_bg, "bold"} + } +} +section.left[3] = { + FileIcon = { + provider = "FileIcon", + condition = buffer_not_empty, + highlight = {require("galaxyline.provider_fileinfo").get_file_icon_color, colors.line_bg} + } +} +section.left[4] = { + FileName = { + -- provider = "FileName", + provider = function() + return fn.expand("%:F") + end, + condition = buffer_not_empty, + separator = " ", + separator_highlight = {colors.purple, colors.bg}, + highlight = {colors.purple, colors.line_bg, "bold"} + } +} + +section.right[1] = { + GitIcon = { + provider = function() + return " " + end, + condition = require("galaxyline.provider_vcs").check_git_workspace, + highlight = {colors.orange, colors.line_bg} + } +} +section.right[2] = { + GitBranch = { + provider = "GitBranch", + condition = require("galaxyline.provider_vcs").check_git_workspace, + separator = "", + separator_highlight = {colors.purple, colors.bg}, + highlight = {colors.orange, colors.line_bg, "bold"} + } +} + +local checkwidth = function() + local squeeze_width = fn.winwidth(0) / 2 + if squeeze_width > 40 then + return true + end + return false +end + +section.right[3] = { + DiffAdd = { + provider = "DiffAdd", + condition = checkwidth, + icon = " ", + highlight = {colors.green, colors.line_bg} + } +} +section.right[4] = { + DiffModified = { + provider = "DiffModified", + condition = checkwidth, + icon = "柳", + highlight = {colors.yellow, colors.line_bg} + } +} +section.right[5] = { + DiffRemove = { + provider = "DiffRemove", + condition = checkwidth, + icon = " ", + highlight = {colors.red, colors.line_bg} + } +} + +section.right[6] = { + LineInfo = { + provider = "LineColumn", + separator = "", + separator_highlight = {colors.blue, colors.line_bg}, + highlight = {colors.gray, colors.line_bg} + } +} +-- section.right[7] = { +-- FileSize = { +-- provider = "FileSize", +-- separator = " ", +-- condition = buffer_not_empty, +-- separator_highlight = {colors.blue, colors.line_bg}, +-- highlight = {colors.fg, colors.line_bg} +-- } +-- } + +section.right[8] = { + DiagnosticError = { + provider = "DiagnosticError", + separator = " ", + icon = " ", + highlight = {colors.red, colors.line_bg}, + separator_highlight = {colors.bg, colors.bg} + } +} +section.right[9] = { + DiagnosticWarn = { + provider = "DiagnosticWarn", + -- separator = " ", + icon = " ", + highlight = {colors.yellow, colors.line_bg}, + separator_highlight = {colors.bg, colors.bg} + } +} + +section.right[10] = { + DiagnosticInfo = { + -- separator = " ", + provider = "DiagnosticInfo", + icon = " ", + highlight = {colors.green, colors.line_bg}, + separator_highlight = {colors.bg, colors.bg} + } +} + +section.right[11] = { + DiagnosticHint = { + provider = "DiagnosticHint", + -- separator = " ", + icon = " ", + highlight = {colors.blue, colors.line_bg}, + separator_highlight = {colors.bg, colors.bg} + } +} + +section.short_line_left[1] = { + BufferType = { + provider = 'FileTypeName', + separator = ' ', + separator_highlight = {'NONE',colors.bg}, + highlight = {colors.blue,colors.bg,'bold'} + } +} + +section.short_line_left[2] = { + SFileName = { + provider = function () + local fileinfo = require('galaxyline.provider_fileinfo') + local fname = fileinfo.get_current_file_name() + for _,v in ipairs(gl.short_line_list) do + if v == vim.bo.filetype then + return '' + end + end + return fname + end, + condition = buffer_not_empty, + highlight = {colors.white,colors.bg,'bold'} + } +} + +section.short_line_right[1] = { + BufferIcon = { + provider= 'BufferIcon', + highlight = {colors.fg,colors.bg} + } +} diff --git a/.config/nvim/lua/_gitblame/init.lua b/.config/nvim/lua/_gitblame/init.lua new file mode 100644 index 0000000..12645a7 --- /dev/null +++ b/.config/nvim/lua/_gitblame/init.lua @@ -0,0 +1,2 @@ +vim.cmd('highlight default link gitblame SpecialComment') +vim.g.gitblame_enabled = 0 diff --git a/.config/nvim/lua/_gitsigns/init.lua b/.config/nvim/lua/_gitsigns/init.lua new file mode 100644 index 0000000..b435be7 --- /dev/null +++ b/.config/nvim/lua/_gitsigns/init.lua @@ -0,0 +1,36 @@ +require('gitsigns').setup { + signs = { + -- TODO add hl to colorscheme + add = {hl = 'GitSignsAdd' , text = '▎', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'}, + change = {hl = 'GitSignsChange', text = '▎', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, + delete = {hl = 'GitSignsDelete', text = '契', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, + topdelete = {hl = 'GitSignsDelete', text = '契', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, + changedelete = {hl = 'GitSignsChange', text = '▎', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, + }, + numhl = false, + linehl = false, + keymaps = { + -- Default keymap options + noremap = true, + buffer = true, + + --[[ ['n ]c'] = { expr = true, "&diff ? ']c' : 'lua require\"gitsigns\".next_hunk()'"}, + ['n [c'] = { expr = true, "&diff ? '[c' : 'lua require\"gitsigns\".prev_hunk()'"}, + ['n hs'] = 'lua require"gitsigns".stage_hunk()', + ['n hu'] = 'lua require"gitsigns".undo_stage_hunk()', + ['n hr'] = 'lua require"gitsigns".reset_hunk()', + ['n hp'] = 'lua require"gitsigns".preview_hunk()', + ['n hb'] = 'lua require"gitsigns".blame_line()', ]] + + -- Text objects + --[[ ['o ih'] = ':lua require"gitsigns".text_object()', + ['x ih'] = ':lua require"gitsigns".text_object()' ]] + }, + watch_index = { + interval = 1000 + }, + sign_priority = 6, + update_debounce = 200, + status_formatter = nil, -- Use default + use_decoration_api = false +} diff --git a/.config/nvim/lua/_goyo/init.vim b/.config/nvim/lua/_goyo/init.vim new file mode 100644 index 0000000..f617194 --- /dev/null +++ b/.config/nvim/lua/_goyo/init.vim @@ -0,0 +1,2 @@ +autocmd! User GoyoEnter Limelight lua require('galaxyline').disable_galaxyline() +autocmd! User GoyoLeave Limelight! lua require('galaxyline').galaxyline_augroup() diff --git a/.config/nvim/lua/_hop/init.lua b/.config/nvim/lua/_hop/init.lua new file mode 100644 index 0000000..f7dd27d --- /dev/null +++ b/.config/nvim/lua/_hop/init.lua @@ -0,0 +1,2 @@ +vim.api.nvim_set_keymap('n', 's', ":HopChar2", {}) +vim.api.nvim_set_keymap('n', 'S', ":HopWord", {}) diff --git a/.config/nvim/lua/_kommentary/init.lua b/.config/nvim/lua/_kommentary/init.lua new file mode 100644 index 0000000..350e1ac --- /dev/null +++ b/.config/nvim/lua/_kommentary/init.lua @@ -0,0 +1,6 @@ +vim.g.kommentary_create_default_mappings = false +vim.api.nvim_set_keymap("n", "gc", "kommentary_line_default", {}) +vim.api.nvim_set_keymap("v", "gc", "kommentary_visual_default", {}) +require('kommentary.config').configure_language("default", { + prefer_single_line_comments = true, +}) diff --git a/.config/nvim/lua/_lsp/bash-ls.lua b/.config/nvim/lua/_lsp/bash-ls.lua new file mode 100644 index 0000000..8be0383 --- /dev/null +++ b/.config/nvim/lua/_lsp/bash-ls.lua @@ -0,0 +1,2 @@ +-- npm i -g bash-language-server +require'lspconfig'.bashls.setup{} diff --git a/.config/nvim/lua/_lsp/docker-ls.lua b/.config/nvim/lua/_lsp/docker-ls.lua new file mode 100644 index 0000000..ad6e220 --- /dev/null +++ b/.config/nvim/lua/_lsp/docker-ls.lua @@ -0,0 +1,2 @@ +-- npm install -g dockerfile-language-server-nodejs +require'lspconfig'.dockerls.setup{} diff --git a/.config/nvim/lua/_lsp/general.lua b/.config/nvim/lua/_lsp/general.lua new file mode 100644 index 0000000..fa28dbc --- /dev/null +++ b/.config/nvim/lua/_lsp/general.lua @@ -0,0 +1,15 @@ +require"lspconfig".efm.setup { + init_options = {documentFormatting = true}, + filetypes = {"lua"}, + settings = { + rootMarkers = {".git/"}, + languages = { + lua = { + { + formatCommand = "lua-format -i --no-keep-simple-function-one-line --no-break-after-operator --column-limit=150 --break-after-table-lb", + formatStdin = true + } + } + } + } +} diff --git a/.config/nvim/lua/_lsp/init.lua b/.config/nvim/lua/_lsp/init.lua new file mode 100644 index 0000000..4515e7c --- /dev/null +++ b/.config/nvim/lua/_lsp/init.lua @@ -0,0 +1,19 @@ +--TODO figure out why this don't work +vim.fn.sign_define("LspDiagnosticsSignError", {texthl = "LspDiagnosticsSignError", text = "", numhl = "LspDiagnosticsSignError"}) +vim.fn.sign_define("LspDiagnosticsSignWarning", {texthl = "LspDiagnosticsSignWarning", text = "", numhl = "LspDiagnosticsSignWarning"}) +vim.fn.sign_define("LspDiagnosticsSignInformation", {texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"}) +vim.fn.sign_define("LspDiagnosticsSignHint", {texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"}) + +vim.cmd('nnoremap gd lua vim.lsp.buf.definition()') +vim.cmd('nnoremap gD lua vim.lsp.buf.declaration()') +vim.cmd('nnoremap gr lua vim.lsp.buf.references()') +vim.cmd('nnoremap gi lua vim.lsp.buf.implementation()') +vim.cmd('nnoremap ca :Lspsaga code_action') +vim.cmd('nnoremap K :Lspsaga hover_doc') +-- vim.cmd('nnoremap lua vim.lsp.buf.signature_help()') +vim.cmd('nnoremap :Lspsaga diagnostic_jump_prev') +vim.cmd('nnoremap :Lspsaga diagnostic_jump_next') +-- scroll down hover doc or scroll in definition preview +vim.cmd('nnoremap lua require(\'lspsaga.action\').smart_scroll_with_saga(1)') +-- scroll up hover doc +vim.cmd('nnoremap lua require(\'lspsaga.action\').smart_scroll_with_saga(-1)') diff --git a/.config/nvim/lua/_lsp/json-ls.lua b/.config/nvim/lua/_lsp/json-ls.lua new file mode 100644 index 0000000..d13fed3 --- /dev/null +++ b/.config/nvim/lua/_lsp/json-ls.lua @@ -0,0 +1,10 @@ +-- npm install -g vscode-json-languageserver +require'lspconfig'.jsonls.setup { + commands = { + Format = { + function() + vim.lsp.buf.range_formatting({},{0,0},{vim.fn.line("$"),0}) + end + } + } +} diff --git a/.config/nvim/lua/_lsp/lua-ls.lua b/.config/nvim/lua/_lsp/lua-ls.lua new file mode 100644 index 0000000..c04219a --- /dev/null +++ b/.config/nvim/lua/_lsp/lua-ls.lua @@ -0,0 +1,37 @@ +-- https://github.com/sumneko/lua-language-server/wiki/Build-and-Run-(Standalone) +USER = vim.fn.expand('$USER') + +local sumneko_root_path = "" +local sumneko_binary = "" + +if vim.fn.has("mac") == 1 then + sumneko_root_path = "/Users/" .. USER .. "/.config/nvim/lua-language-server" + sumneko_binary = "/Users/" .. USER .. "/.config/nvim/lua-language-server/bin/macOS/lua-language-server" +elseif vim.fn.has("unix") == 1 then + sumneko_root_path = "/home/" .. USER .. "/.config/nvim/lua-language-server" + sumneko_binary = "/home/" .. USER .. "/.config/nvim/lua-language-server/bin/Linux/lua-language-server" +else + print("Unsupported system for sumneko") +end + +require'lspconfig'.sumneko_lua.setup { + cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"}, + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT', + -- Setup your lua path + path = vim.split(package.path, ';') + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = {'vim'} + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = {[vim.fn.expand('$VIMRUNTIME/lua')] = true, [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true} + } + } + } +} diff --git a/.config/nvim/lua/_lsp/python-ls.lua b/.config/nvim/lua/_lsp/python-ls.lua new file mode 100644 index 0000000..11eeef9 --- /dev/null +++ b/.config/nvim/lua/_lsp/python-ls.lua @@ -0,0 +1,2 @@ +-- npm i -g pyright +require'lspconfig'.pyright.setup{} diff --git a/.config/nvim/lua/_lsp/vim.lua b/.config/nvim/lua/_lsp/vim.lua new file mode 100644 index 0000000..a7555c6 --- /dev/null +++ b/.config/nvim/lua/_lsp/vim.lua @@ -0,0 +1,2 @@ +-- npm install -g vim-language-server +require'lspconfig'.vimls.setup{} diff --git a/.config/nvim/lua/_lsp/wrapper.lua b/.config/nvim/lua/_lsp/wrapper.lua new file mode 100644 index 0000000..7f3647c --- /dev/null +++ b/.config/nvim/lua/_lsp/wrapper.lua @@ -0,0 +1,129 @@ +local lsp_wrapper = {} + +-- buf + +function lsp_wrapper.add_to_workspace_folder() + vim.lsp.buf.add_workspace_folder() +end + +function lsp_wrapper.clear_references() + vim.lsp.buf.clear_references() +end + +function lsp_wrapper.code_action() + vim.lsp.buf.code_action() +end + +function lsp_wrapper.declaration() + vim.lsp.buf.declaration() + vim.lsp.buf.clear_references() +end + +function lsp_wrapper.definition() + vim.lsp.buf.definition() + vim.lsp.buf.clear_references() +end + +function lsp_wrapper.document_highlight() + vim.lsp.buf.document_highlight() +end + +function lsp_wrapper.document_symbol() + vim.lsp.buf.document_symbol() +end + +function lsp_wrapper.formatting() + vim.lsp.buf.formatting() +end + +function lsp_wrapper.formatting_sync() + vim.lsp.buf.formatting_sync() +end + +function lsp_wrapper.hover() + vim.lsp.buf.hover() +end + +function lsp_wrapper.implementation() + vim.lsp.buf.implementation() +end + +function lsp_wrapper.incoming_calls() + vim.lsp.buf.incoming_calls() +end + +function lsp_wrapper.list_workspace_folders() + vim.lsp.buf.list_workspace_folders() +end + +function lsp_wrapper.outgoing_calls() + vim.lsp.buf.outgoing_calls() +end + +function lsp_wrapper.range_code_action() + vim.lsp.buf.range_code_action() +end + +function lsp_wrapper.range_formatting() + vim.lsp.buf.range_formatting() +end + +function lsp_wrapper.references() + vim.lsp.buf.references() + vim.lsp.buf.clear_references() +end + +function lsp_wrapper.remove_workspace_folder() + vim.lsp.buf.remove_workspace_folder() +end + +function lsp_wrapper.rename() + vim.lsp.buf.rename() +end + +function lsp_wrapper.signature_help() + vim.lsp.buf.signature_help() +end + +function lsp_wrapper.type_definition() + vim.lsp.buf.type_definition() +end + +function lsp_wrapper.workspace_symbol() + vim.lsp.buf.workspace_symbol() +end + +-- diagnostic + +function lsp_wrapper.get_all() + vim.lsp.diagnostic.get_all() +end + +function lsp_wrapper.get_next() + vim.lsp.diagnostic.get_next() +end + +function lsp_wrapper.get_prev() + vim.lsp.diagnostic.get_prev() +end + +function lsp_wrapper.goto_next() + vim.lsp.diagnostic.goto_next() +end + +function lsp_wrapper.goto_prev() + vim.lsp.diagnostic.goto_prev() +end + +function lsp_wrapper.show_line_diagnostics() + vim.lsp.diagnostic.show_line_diagnostics() +end + +-- misc + +-- :lua print(vim.inspect(vim.lsp.buf_get_clients())) + +-- autoformat +-- autocmd BufWritePre *.rs lua vim.lsp.buf.formatting_sync(nil, 1000) + +return lsp_wrapper diff --git a/.config/nvim/lua/_lsp/yaml-ls.lua b/.config/nvim/lua/_lsp/yaml-ls.lua new file mode 100644 index 0000000..904f20e --- /dev/null +++ b/.config/nvim/lua/_lsp/yaml-ls.lua @@ -0,0 +1,2 @@ +-- npm install -g yaml-language-server +require'lspconfig'.yamlls.setup{} diff --git a/.config/nvim/lua/_lspkind/init.lua b/.config/nvim/lua/_lspkind/init.lua new file mode 100644 index 0000000..e3c590f --- /dev/null +++ b/.config/nvim/lua/_lspkind/init.lua @@ -0,0 +1,26 @@ +-- symbols for autocomplete +require('lspkind').init({ + with_text = false, + symbol_map = { + Text = '  ', + Method = '  ', + Function = '  ', + Constructor = '  ', + Variable = '[]', + Class = '  ', + Interface = ' 蘒', + Module = '  ', + Property = '  ', + Unit = ' 塞 ', + Value = '  ', + Enum = ' 練', + Keyword = '  ', + Snippet = '  ', + Color = '', + File = '', + Folder = ' ﱮ ', + EnumMember = '  ', + Constant = '  ', + Struct = '  ' + }, +}) diff --git a/.config/nvim/lua/_neogit/init.lua b/.config/nvim/lua/_neogit/init.lua new file mode 100644 index 0000000..ca38081 --- /dev/null +++ b/.config/nvim/lua/_neogit/init.lua @@ -0,0 +1 @@ +local neogit = require('neogit') diff --git a/.config/nvim/lua/_nvimtree/init.lua b/.config/nvim/lua/_nvimtree/init.lua new file mode 100644 index 0000000..3803765 --- /dev/null +++ b/.config/nvim/lua/_nvimtree/init.lua @@ -0,0 +1,31 @@ +local tree_cb = require'nvim-tree.config'.nvim_tree_callback +vim.g.nvim_tree_bindings = { + -- mappings + [""] = tree_cb("edit"), + ["l"] = tree_cb("edit"), + ["o"] = tree_cb("edit"), + ["<2-LeftMouse>"] = tree_cb("edit"), + ["<2-RightMouse>"] = tree_cb("cd"), + [""] = tree_cb("cd"), + ["v"] = tree_cb("vsplit"), + ["s"] = tree_cb("split"), + [""] = tree_cb("tabnew"), + ["h"] = tree_cb("close_node"), + [""] = tree_cb("close_node"), + [""] = tree_cb("close_node"), + [""] = tree_cb("preview"), + ["I"] = tree_cb("toggle_ignored"), + ["H"] = tree_cb("toggle_dotfiles"), + ["R"] = tree_cb("refresh"), + ["a"] = tree_cb("create"), + ["d"] = tree_cb("remove"), + ["r"] = tree_cb("rename"), + [""] = tree_cb("full_rename"), + ["x"] = tree_cb("cut"), + ["c"] = tree_cb("copy"), + ["p"] = tree_cb("paste"), + ["[c"] = tree_cb("prev_git_item"), + ["]c"] = tree_cb("next_git_item"), + ["-"] = tree_cb("dir_up"), + ["q"] = tree_cb("close") +} diff --git a/.config/nvim/lua/_quickscope/init.lua b/.config/nvim/lua/_quickscope/init.lua new file mode 100644 index 0000000..4c70669 --- /dev/null +++ b/.config/nvim/lua/_quickscope/init.lua @@ -0,0 +1,7 @@ +-- Trigger a highlight in the appropriate direction when pressing these keys: +-- vim.cmd('let g:qs_highlight_on_keys = [\'f\', \'F\', \'t\', \'T\']') +vim.g.qs_highlight_on_keys = {'f', 'F', 't', 'T'} + +vim.api.nvim_exec('highlight QuickScopePrimary guifg=\'#00C7DF\' gui=underline ctermfg=155 cterm=underline', false) +vim.cmd('highlight QuickScopeSecondary guifg=\'#eF5F70\' gui=underline ctermfg=81 cterm=underline') +vim.g.qs_max_chars=150 diff --git a/.config/nvim/lua/_rnvimr/init.lua b/.config/nvim/lua/_rnvimr/init.lua new file mode 100644 index 0000000..055326c --- /dev/null +++ b/.config/nvim/lua/_rnvimr/init.lua @@ -0,0 +1,22 @@ +-- Make Ranger replace netrw and be the file explorer +vim.g.rnvimr_ex_enable = 1 +vim.g.rnvimr_draw_border = 1 + +-- Make Ranger to be hidden after picking a file +vim.g.rnvimr_pick_enable = 1 + +-- Make Neovim to wipe the buffers corresponding to the files deleted by Ranger +vim.g.rnvimr_bw_enable = 1 + +-- vim.cmd('nmap r :RnvimrToggle') + +--[[ let g:rnvimr_ranger_cmd = 'ranger --cmd="set column_ratios 1,1"' + " \ --cmd="set draw_borders separators"' +" let g:rnvimr_layout = { 'relative': 'editor', +" \ 'width': float2nr(round(0.6 * &columns)), +" \ 'height': float2nr(round(0.6 * &lines)), +" \ 'col': float2nr(round(0.2 * &columns)), +" \ 'row': float2nr(round(0.2 * &lines)), +" \ 'style': 'minimal' } +let g:rnvimr_presets = [ + \ {'width': 0.800, 'height': 0.800}] ]] diff --git a/.config/nvim/lua/_startify/init.lua b/.config/nvim/lua/_startify/init.lua new file mode 100644 index 0000000..3f627a0 --- /dev/null +++ b/.config/nvim/lua/_startify/init.lua @@ -0,0 +1,41 @@ +vim.g.startify_custom_header = { + ' ##############..... ############## ', + ' ##############......############## ', + ' ##########..........########## ', + ' ##########........########## ', + ' ##########.......########## ', + ' ##########.....##########.. ', + ' ##########....##########..... ', + ' ..##########..##########......... ', + ' ....##########.#########............. ', + ' ..################JJJ............ ', + ' ################............. ', + ' ##############.JJJ.JJJJJJJJJJ ', + ' ############...JJ...JJ..JJ JJ ', + ' ##########....JJ...JJ..JJ JJ ', + ' ########......JJJ..JJJ JJJ JJJ ', + ' ###### ......... ', + ' ..... ', + ' . ', + } + +vim.g.webdevicons_enable_startify = 1 +vim.g.startify_enable_special = 0 +vim.g.startify_session_dir = '~/.config/nvim/session' +vim.g.startify_session_autoload = 1 +vim.g.startify_session_delete_buffers = 1 +vim.g.startify_change_to_vcs_root = 1 +vim.g.startify_fortune_use_unicode = 1 +vim.g.startify_session_persistence = 1 +vim.g.startify_session_dir = '~/.config/nvim/session' + + +vim.api.nvim_exec('let startify_lists = [ { \'type\': \'files\', \'header\': [\' Files\'] }, { \'type\': \'sessions\', \'header\': [\' Sessions\'] }, { \'type\': \'bookmarks\', \'header\': [\' Bookmarks\'] }, ]',true) + +vim.api.nvim_exec('let startify_bookmarks = [ { \'i\': \'~/.config/nvim/init.lua\' }, { \'z\': \'~/.zshrc\' }]', true) + +vim.cmd([[ +function! StartifyEntryFormat() + return 'WebDevIconsGetFileTypeSymbol(absolute_path) ." ". entry_path' +endfunction +]]) diff --git a/.config/nvim/lua/_treesitter/init.lua b/.config/nvim/lua/_treesitter/init.lua new file mode 100644 index 0000000..d202a9f --- /dev/null +++ b/.config/nvim/lua/_treesitter/init.lua @@ -0,0 +1,15 @@ +require'nvim-treesitter.configs'.setup { + ensure_installed = "all", -- one of "all", "maintained" (parsers with maintainers), or a list of languages + highlight = { + enable = true, -- false will disable the whole extension + }, +} + +require "nvim-treesitter.configs".setup { + playground = { + enable = true, + disable = {}, + updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code + persist_queries = false -- Whether the query persists across vim sessions + } +} diff --git a/.config/nvim/lua/_vim-bbye/init.vim b/.config/nvim/lua/_vim-bbye/init.vim new file mode 100644 index 0000000..10ee440 --- /dev/null +++ b/.config/nvim/lua/_vim-bbye/init.vim @@ -0,0 +1 @@ +nnoremap q :Bdelete diff --git a/.config/nvim/lua/_vim-pydocstring/init.vim b/.config/nvim/lua/_vim-pydocstring/init.vim new file mode 100644 index 0000000..e3d5311 --- /dev/null +++ b/.config/nvim/lua/_vim-pydocstring/init.vim @@ -0,0 +1 @@ +let g:pydocstring_formatter = 'google' diff --git a/.config/nvim/lua/_vim-rooter/init.lua b/.config/nvim/lua/_vim-rooter/init.lua new file mode 100644 index 0000000..a873194 --- /dev/null +++ b/.config/nvim/lua/_vim-rooter/init.lua @@ -0,0 +1,2 @@ +-- TODO create file +vim.g.rooter_silent_chdir = 1 diff --git a/.config/nvim/lua/_whichkey/init.vim b/.config/nvim/lua/_whichkey/init.vim new file mode 100644 index 0000000..c8fe9e4 --- /dev/null +++ b/.config/nvim/lua/_whichkey/init.vim @@ -0,0 +1,236 @@ +" Leader Key Maps + +" Timeout +let g:which_key_timeout = 100 + +let g:which_key_display_names = {'': '↵', '': '⇆'} + +" Map leader to which_key +nnoremap :silent :silent WhichKey '' +vnoremap :silent :silent WhichKeyVisual '' + +let g:which_key_map = {} +let g:which_key_sep = '→' + +" Not a fan of floating windows for this +let g:which_key_use_floating_win = 0 +let g:which_key_max_size = 0 + +" Hide status line +autocmd! FileType which_key +autocmd FileType which_key set laststatus=0 noshowmode noruler + \| autocmd BufLeave set laststatus=2 noshowmode ruler + + +" Single mappings +" let g:which_key_map['/'] = [ ':call Comment()' , 'comment' ] +" let g:which_key_map['/'] = { 'name' : 'comment' } +let g:which_key_map['/'] = 'which_key_ignore' +let g:which_key_map['?'] = [ ':NvimTreeFindFile' , 'find current file' ] +let g:which_key_map['e'] = [ ':NvimTreeToggle' , 'explorer' ] +let g:which_key_map['h'] = [ 's' , 'split below'] +let g:which_key_map['n'] = [ ':let @/ = ""' , 'no highlight' ] +let g:which_key_map['r'] = [ ':RnvimrToggle' , 'ranger' ] +" TODO create entire treesitter section +let g:which_key_map['T'] = [ ':TSHighlightCapturesUnderCursor' , 'treesitter highlight' ] +let g:which_key_map['v'] = [ 'v' , 'split right'] +" Add Zen mode, play nice with status line +let g:which_key_map['z'] = [ 'Goyo' , 'zen' ] + +" Group mappings + +" a is for actions +let g:which_key_map.a = { + \ 'name' : '+actions' , + \ 'h' : [':let @/ = ""' , 'remove search highlight'], + \ 'l' : [':Bracey' , 'start live server'], + \ 'L' : [':BraceyStop' , 'stop live server'], + \ 'm' : [':MarkdownPreview' , 'markdown preview'], + \ 'M' : [':MarkdownPreviewStop' , 'markdown preview stop'], + \ 'n' : [':set nonumber!' , 'line-numbers'], + \ 's' : [':s/\%V\(.*\)\%V/"\1"/' , 'surround'], + \ 'r' : [':set norelativenumber!' , 'relative line nums'], + \ 't' : [':FloatermToggle' , 'terminal'], + \ 'v' : [':Codi' , 'virtual repl on'], + \ 'V' : [':Codi!' , 'virtual repl off'], + \ 'w' : [':StripWhitespace' , 'strip whitespace'], + \ } + +" b is for buffer +" let g:which_key_map.b = { +" \ 'name' : '+buffer' , +" \ '>' : [':BufferMoveNext' , 'move next'], +" \ '<' : [':BufferMovePrevious' , 'move prev'], +" \ 'b' : [':BufferPick' , 'pick buffer'], +" \ 'd' : [':Bdelete' , 'delete-buffer'], +" \ 'n' : ['bnext' , 'next-buffer'], +" \ 'p' : ['bprevious' , 'previous-buffer'], +" \ '?' : ['Buffers' , 'fzf-buffer'], +" \ } + +" d is for debug +" let g:which_key_map.d = { +" \ 'name' : '+debug' , +" \ 'b' : ['VimspectorToggleBreakpoint' , 'breakpoint'], +" \ 'B' : ['VimspectorToggleConditionalBreakpoint' , 'conditional breakpoint'], +" \ 'c' : ['VimspectorRunToCursor' , 'run to cursor'], +" \ 'd' : ['VimspectorContinue' , 'continue'], +" \ 'f' : ['VimspectorAddFunctionBreakpoint' , 'function breakpoint'], +" \ 'm' : [':MaximizerToggle' , 'maximize window'], +" \ 'o' : ['VimspectorStepOver' , 'step over'], +" \ 'O' : ['VimspectorStepOut' , 'step out'], +" \ 'i' : ['VimspectorStepInto' , 'step into'], +" \ 'p' : ['VimspectorPause' , 'pause'], +" \ 'r' : ['VimspectorRestart' , 'restart'], +" \ 's' : ['VimspectorStop' , 'stop'], +" \ } + +" F is for fold +let g:which_key_map.F = { + \ 'name': '+fold', + \ 'O' : [':set foldlevel=20', 'open all'], + \ 'C' : [':set foldlevel=0', 'close all'], + \ 'c' : [':foldclose', 'close'], + \ 'o' : [':foldopen', 'open'], + \ '1' : [':set foldlevel=1', 'level1'], + \ '2' : [':set foldlevel=2', 'level2'], + \ '3' : [':set foldlevel=3', 'level3'], + \ '4' : [':set foldlevel=4', 'level4'], + \ '5' : [':set foldlevel=5', 'level5'], + \ '6' : [':set foldlevel=6', 'level6'] + \ } + +" s is for search powered by telescope +let g:which_key_map.s = { + \ 'name' : '+search' , + \ '.' : [':Telescope filetypes' , 'filetypes'], + \ ';' : [':Telescope commands' , 'commands'], + \ 'a' : [':Telescope lsp_code_actions' , 'code_actions'], + \ 'A' : [':Telescope builtin' , 'all'], + \ 'b' : [':Telescope buffers' , 'buffers'], + \ 'B' : [':Telescope git_branches' , 'git branches'], + \ 'd' : [':Telescope lsp_document_diagnostics' , 'document_diagnostics'], + \ 'D' : [':Telescope lsp_workspace_diagnostics' , 'workspace_diagnostics'], + \ 'c' : [':Telescope git_commits' , 'git_commits'], + \ 'C' : [':Telescope git_bcommits' , 'git_bcommits'], + \ 'f' : [':Telescope find_files' , 'files'], + \ 'F' : [':Telescope git_files' , 'git_files'], + \ 'g' : [':Telescope tags' , 'tags'], + \ 'G' : [':Telescope current_buffer_tags' , 'buffer_tags'], + \ 'h' : [':Telescope command_history' , 'history'], + \ 'H' : [':Telescope help_tags' , 'help_tags'], + \ 'i' : [':Telescope media_files' , 'media files'], + \ 'k' : [':Telescope keymaps' , 'keymaps'], + \ 'l' : [':Telescope loclist' , 'loclist'], + \ 'm' : [':Telescope marks' , 'marks'], + \ 'M' : [':Telescope man_pages' , 'man_pages'], + \ 'o' : [':Telescope vim_options' , 'vim_options'], + \ 'O' : [':Telescope oldfiles' , 'oldfiles'], + \ 'p' : [':Telescope fd' , 'fd'], + \ 'P' : [':Telescope spell_suggest' , 'spell_suggest'], + \ 's' : [':Telescope git_status' , 'git_status'], + \ 'S' : [':Telescope grep_string' , 'grep_string'], + \ 't' : [':Telescope live_grep' , 'text'], + \ 'y' : [':Telescope symbols' , 'symbols'], + \ 'Y' : [':Telescope lsp_workspace_symbols' , 'lsp_workspace_symbols'], + \ 'r' : [':Telescope registers' , 'registers'], + \ 'R' : [':Telescope reloader' , 'reloader'], + \ 'w' : [':Telescope file_browser' , 'buf_fuz_find'], + \ 'u' : [':Telescope colorscheme' , 'colorschemes'], + \ 'z' : [':Telescope current_buffer_fuzzy_find' , 'buf_fuz_find'], + \ } + +let g:which_key_map.S = { + \ 'name' : '+Session' , + \ 'c' : [':SClose' , 'Close Session'] , + \ 'd' : [':SDelete' , 'Delete Session'] , + \ 'l' : [':SLoad' , 'Load Session'] , + \ 's' : [':Startify' , 'Start Page'] , + \ 'S' : [':SSave' , 'Save Session'] , + \ } + +" g is for git +" let g:which_key_map.g = { +" \ 'name' : '+git' , +" \ 'a' : [':Git add .' , 'add all'], +" \ 'A' : [':CocCommand fzf-preview.GitStatus' , 'actions'], +" \ 'b' : [':Git blame' , 'blame'], +" \ 'B' : [':GBrowse' , 'browse'], +" \ 'c' : [':Git commit' , 'commit'], +" \ 'd' : [':Git diff' , 'diff'], +" \ 'D' : [':Gdiffsplit' , 'diff split'], +" \ 'g' : [':GGrep' , 'git grep'], +" \ 'G' : [':Gstatus' , 'status'], +" \ 'h' : [':GitGutterLineHighlightsToggle' , 'highlight hunks'], +" \ 'H' : ['(GitGutterPreviewHunk)' , 'preview hunk'], +" \ 'i' : [':Gist -b' , 'post gist'], +" \ 'j' : ['(GitGutterNextHunk)' , 'next hunk'], +" \ 'k' : ['(GitGutterPrevHunk)' , 'prev hunk'], +" \ 'l' : [':Git log' , 'log'], +" \ 'm' : ['(git-messenger)' , 'message'], +" \ 'p' : [':Git push' , 'push'], +" \ 'P' : [':Git pull' , 'pull'], +" \ 'r' : [':GRemove' , 'remove'], +" \ 's' : ['(GitGutterStageHunk)' , 'stage hunk'], +" \ 'S' : [':CocCommand fzf-preview.GitStatus' , 'status'], +" \ 't' : [':GitGutterSignsToggle' , 'toggle signs'], +" \ 'u' : ['(GitGutterUndoHunk)' , 'undo hunk'], +" \ 'v' : [':GV' , 'view commits'], +" \ 'V' : [':GV!' , 'view buffer commits'], +" \ } + " \ 'A' : [':Git add %' , 'add current'], + " \ 'S' : [':!git status' , 'status'], + +" let g:which_key_map.G = { +" \ 'name' : '+gist' , +" \ 'a' : [':Gist -a' , 'post gist anon'], +" \ 'b' : [':Gist -b' , 'post gist browser'], +" \ 'd' : [':Gist -d' , 'delete gist'], +" \ 'e' : [':Gist -e' , 'edit gist'], +" \ 'l' : [':Gist -l' , 'list public gists'], +" \ 's' : [':Gist -ls' , 'list starred gists'], +" \ 'm' : [':Gist -m' , 'post gist all buffers'], +" \ 'p' : [':Gist -P' , 'post public gist '], +" \ 'P' : [':Gist -p' , 'post private gist '], +" \ } + +" l is for language server protocol +let g:which_key_map.l = { + \ 'name' : '+lsp' , + \ 'a' : [':Lspsaga code_action' , 'quickfix'], + \ 'A' : [':Lspsaga range_code_action' , 'selected action'], + \ 'd' : [':Telescope lsp_document_diagnostics' , 'document diagnostics'], + \ 'D' : [':Telescope lsp_workspace_diagnostics', 'workspace diagnostics'], + \ 'f' : [':LspFormatting' , 'format'], + \ 'H' : [':Lspsaga signature_help' , 'signature_help'], + \ 'I' : [':LspInfo' , 'lsp_info'], + \ 'l' : [':Lspsaga lsp_finder' , 'lsp_finder'], + \ 'L' : [':Lspsaga show_line_diagnostics' , 'line_diagnostics'], + \ 'o' : [':Vista!!' , 'outline'], + \ 'p' : [':Lspsaga preview_definition' , 'preview definition'], + \ 'q' : [':Telescope quickfix' , 'quickfix'], + \ 'r' : [':LspRename' , 'rename'], + \ 'T' : [':LspTypeDefinition' , 'type defintion'], + \ 'x' : [':cclose' , 'close quickfix'], + \ 's' : [':Telescope lsp_document_symbols' , 'document symbols'], + \ 'S' : [':Telescope lsp_workspace_symbols' , 'workspace symbols'], + \ } + +" t is for terminal +let g:which_key_map.t = { + \ 'name' : '+terminal' , + \ ';' : [':FloatermNew --wintype=normal --height=6' , 'terminal'], + \ 'f' : [':FloatermNew fzf' , 'fzf'], + \ 'g' : [':FloatermNew lazygit' , 'git'], + \ 'd' : [':FloatermNew lazydocker' , 'docker'], + \ 'n' : [':FloatermNew node' , 'node'], + \ 'N' : [':FloatermNew nnn' , 'nnn'], + \ 'p' : [':FloatermNew python' , 'python'], + \ 'm' : [':FloatermNew lazynpm' , 'npm'], + \ 'r' : [':FloatermNew ranger' , 'ranger'], + \ 't' : [':FloatermToggle' , 'toggle'], + \ 'y' : [':FloatermNew btm' , 'btm'], + \ 'u' : [':FloatermNew ncdu' , 'ncdu'], + \ } + +call which_key#register('', "g:which_key_map") diff --git a/.config/nvim/lua/autopairs/init.lua b/.config/nvim/lua/autopairs/init.lua deleted file mode 100644 index 6810a77..0000000 --- a/.config/nvim/lua/autopairs/init.lua +++ /dev/null @@ -1,40 +0,0 @@ -require('nvim-autopairs').setup() - -local pairs_map = { - ["'"] = "'", - ['"'] = '"', - ['('] = ')', - ['['] = ']', - ['{'] = '}', - ['`'] = '`', -} -local disable_filetype = { "TelescopePrompt" } -local break_line_filetype = nil -- mean all file type -local html_break_line_filetype = {'html' , 'vue' , 'typescriptreact' , 'svelte' , 'javascriptreact'} -local ignored_next_char = "%w" - -local remap = vim.api.nvim_set_keymap -local npairs = require('nvim-autopairs') - --- skip it, if you use another global object -_G.MUtils= {} - -vim.g.completion_confirm_key = "" -MUtils.completion_confirm=function() - if vim.fn.pumvisible() ~= 0 then - if vim.fn.complete_info()["selected"] ~= -1 then - vim.fn["compe#confirm"]() - return npairs.esc("") - else - vim.defer_fn(function() - vim.fn["compe#confirm"]("") - end, 20) - return npairs.esc("") - end - else - return npairs.check_break_line_char() - end -end - - -remap('i' , '','v:lua.MUtils.completion_confirm()', {expr = true , noremap = true}) diff --git a/.config/nvim/lua/barbar/init.lua b/.config/nvim/lua/barbar/init.lua deleted file mode 100644 index e4eb06b..0000000 --- a/.config/nvim/lua/barbar/init.lua +++ /dev/null @@ -1,118 +0,0 @@ -vim.api.nvim_set_keymap('n', '', ':BufferNext', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', '', ':BufferPrevious', { noremap = true, silent = true }) ---[[ nnoremap :BufferPrevious -nnoremap :BufferNext ]] - - ---" These commands will sort buffers by directory, language, or a custom criteria ---nnoremap be :BufferLineSortByExtension ---nnoremap bd :BufferLineSortByDirectory ---nnoremap :lua require'bufferline'.sort_buffers_by(function (buf_a, buf_b) return buf_a.id < buf_b.id end) --- colors for active , inactive buffer tabs ---[[ require "bufferline".setup { - options = { - -- buffer_close_icon = "", - -- modified_icon = "●", - -- close_icon = "", - -- left_trunc_marker = "", - -- right_trunc_marker = "", - -- max_name_length = 14, - -- max_prefix_length = 13, - -- tab_size = 18, - -- enforce_regular_tabs = true, - -- view = "multiwindow", - -- show_buffer_close_icons = true, - -- separator_style = 'slant' - separator_style = "thin" - }, - highlights = { - background = { - guifg = "#abb2bf", - guibg = "#282c34" - }, - fill = { - guifg = "#282c34", - guibg = "#1e1e1e" - }, - buffer_selected = { - guifg = "#abb2bf", - guibg = "#3A3E44", - gui = "bold" - }, - buffer_selected = { - guifg = "#abb2bf", - guibg = "#3A3E44", - gui = "bold" - }, - separator_visible = { - guifg = "#1e1e1e", - guibg = "#1e1e1e" - }, - separator_selected = { - guifg = "#1e1e1e", - guibg = "#1e1e1e" - }, - separator = { - guifg = "#1e1e1e", - guibg = "#1e1e1e" - }, - indicator_selected = { - guifg = "#abb2bf", - guibg = "#3a3e44" - }, - modified_selected = { - guifg = "#abb2bf", - guibg = "#3a3e44" - }, - modified = { - guifg = "#abb2bf", - guibg = "#282c34" - }, - modified_visible = { - guifg = "#abb2bf", - guibg = "#282c34" - }, - duplicate_selected = { - guifg = "#abb3bf", - guibg = "#3a3e44", - -- gui = "italic" - }, - duplicate_visible = { - guifg = "#abb3bf", - guibg = "#282c34", - -- gui = "italic" - }, - duplicate = { - guifg = "#abb3bf", - guibg = "#282c34", - -- gui = "italic" - }, - tab = { - guifg = "#abb3bf", - guibg = "#282c34", - }, - tab_selected = { - guifg = "#abb3bf", - guibg = "#282c34", - }, - tab_close = { - guifg = "#abb3bf", - guibg = "#282c34", - }, - pick_selected = { - guifg = "#abb3bf", - guibg = "#282c34", - gui = "bold,italic" - }, - pick_visible = { - guifg = "#abb3bf", - guibg = "#282c34", - gui = "bold,italic" - }, - pick = { - guifg = "#abb3bf", - guibg = "#282c34", - gui = "bold,italic" - } - } -} ]] diff --git a/.config/nvim/lua/closetag/init.lua b/.config/nvim/lua/closetag/init.lua deleted file mode 100644 index 8c11641..0000000 --- a/.config/nvim/lua/closetag/init.lua +++ /dev/null @@ -1,3 +0,0 @@ -vim.g.closetag_filenames = '*.html,*.xhtml,*.phtml' -vim.g.closetag_xhtml_filenames = '*.xhtml,*.jsx,*.js' -vim.g.closetag_filetypes = 'html,xhtml,phtml,javascript,javascriptreact' diff --git a/.config/nvim/lua/colorizer/init.lua b/.config/nvim/lua/colorizer/init.lua deleted file mode 100644 index 1e25d7d..0000000 --- a/.config/nvim/lua/colorizer/init.lua +++ /dev/null @@ -1,13 +0,0 @@ -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 - }) - diff --git a/.config/nvim/lua/floaterm/init.lua b/.config/nvim/lua/floaterm/init.lua deleted file mode 100644 index 633df35..0000000 --- a/.config/nvim/lua/floaterm/init.lua +++ /dev/null @@ -1,13 +0,0 @@ --- Floaterm -vim.g.floaterm_keymap_toggle = '' -vim.g.floaterm_keymap_next = '' -vim.g.floaterm_keymap_prev = '' -vim.g.floaterm_keymap_new = '' -vim.g.floaterm_title='' - -vim.g.floaterm_gitcommit='floaterm' -vim.g.floaterm_autoinsert=1 -vim.g.floaterm_width=0.8 -vim.g.floaterm_height=0.8 -vim.g.floaterm_wintitle=0 -vim.g.floaterm_autoclose=1 diff --git a/.config/nvim/lua/galaxyline/init.lua b/.config/nvim/lua/galaxyline/init.lua deleted file mode 100644 index 44801cf..0000000 --- a/.config/nvim/lua/galaxyline/init.lua +++ /dev/null @@ -1,233 +0,0 @@ -local cmd = vim.cmd -local fn = vim.fn -local gl = require("galaxyline") -local section = gl.section -gl.short_line_list = {"LuaTree", "packager", "Floaterm", "coc-eplorer"} - - -local colors = { - bg = "#0f1419", - fg = "#d0d0d0", - line_bg = "#0f1419", - fg_green = "#90a959", - yellow = "#f4bf75", - cyan = "#75b5aa", - darkblue = "#6a9fb5", - green = "#90a959", - orange = "#D08770", - purple = "#B48EAD", - magenta = "#aa759f", - gray = "#505050", - blue = "#6a9fb5", - red = "#ac4142" -} - -local buffer_not_empty = function() - if fn.empty(fn.expand("%:t")) ~= 1 then - return true - end - return false -end - -section.left[1] = { - FirstElement = { - -- provider = function() return '▊ ' end, - provider = function() - return " " - end, - highlight = {colors.blue, colors.line_bg} - } -} -section.left[2] = { - ViMode = { - provider = function() - -- auto change color according the vim mode - local mode_color = { - n = colors.magenta, - i = colors.green, - v = colors.blue, - [""] = colors.blue, - V = colors.blue, - c = colors.red, - no = colors.magenta, - s = colors.orange, - S = colors.orange, - [""] = colors.orange, - ic = colors.yellow, - R = colors.purple, - Rv = colors.purple, - cv = colors.red, - ce = colors.red, - r = colors.cyan, - rm = colors.cyan, - ["r?"] = colors.cyan, - ["!"] = colors.red, - t = colors.red - } - cmd("hi GalaxyViMode guifg=" .. mode_color[fn.mode()]) - return "  " - end, - highlight = {colors.red, colors.line_bg, "bold"} - } -} -section.left[3] = { - FileIcon = { - provider = "FileIcon", - condition = buffer_not_empty, - highlight = {require("galaxyline.provider_fileinfo").get_file_icon_color, colors.line_bg} - } -} -section.left[4] = { - FileName = { - -- provider = "FileName", - provider = function() - return fn.expand("%:F") - end, - condition = buffer_not_empty, - separator = " ", - separator_highlight = {colors.purple, colors.bg}, - highlight = {colors.purple, colors.line_bg, "bold"} - } -} - -section.right[1] = { - GitIcon = { - provider = function() - return " " - end, - condition = require("galaxyline.provider_vcs").check_git_workspace, - highlight = {colors.orange, colors.line_bg} - } -} -section.right[2] = { - GitBranch = { - provider = "GitBranch", - condition = require("galaxyline.provider_vcs").check_git_workspace, - separator = "", - separator_highlight = {colors.purple, colors.bg}, - highlight = {colors.orange, colors.line_bg, "bold"} - } -} - -local checkwidth = function() - local squeeze_width = fn.winwidth(0) / 2 - if squeeze_width > 40 then - return true - end - return false -end - -section.right[3] = { - DiffAdd = { - provider = "DiffAdd", - condition = checkwidth, - icon = " ", - highlight = {colors.green, colors.line_bg} - } -} -section.right[4] = { - DiffModified = { - provider = "DiffModified", - condition = checkwidth, - icon = "柳", - highlight = {colors.yellow, colors.line_bg} - } -} -section.right[5] = { - DiffRemove = { - provider = "DiffRemove", - condition = checkwidth, - icon = " ", - highlight = {colors.red, colors.line_bg} - } -} - -section.right[6] = { - LineInfo = { - provider = "LineColumn", - separator = "", - separator_highlight = {colors.blue, colors.line_bg}, - highlight = {colors.gray, colors.line_bg} - } -} --- section.right[7] = { --- FileSize = { --- provider = "FileSize", --- separator = " ", --- condition = buffer_not_empty, --- separator_highlight = {colors.blue, colors.line_bg}, --- highlight = {colors.fg, colors.line_bg} --- } --- } - -section.right[8] = { - DiagnosticError = { - provider = "DiagnosticError", - separator = " ", - icon = " ", - highlight = {colors.red, colors.line_bg}, - separator_highlight = {colors.bg, colors.bg} - } -} -section.right[9] = { - DiagnosticWarn = { - provider = "DiagnosticWarn", - -- separator = " ", - icon = " ", - highlight = {colors.yellow, colors.line_bg}, - separator_highlight = {colors.bg, colors.bg} - } -} - -section.right[10] = { - DiagnosticInfo = { - -- separator = " ", - provider = "DiagnosticInfo", - icon = " ", - highlight = {colors.green, colors.line_bg}, - separator_highlight = {colors.bg, colors.bg} - } -} - -section.right[11] = { - DiagnosticHint = { - provider = "DiagnosticHint", - -- separator = " ", - icon = " ", - highlight = {colors.blue, colors.line_bg}, - separator_highlight = {colors.bg, colors.bg} - } -} - -section.short_line_left[1] = { - BufferType = { - provider = 'FileTypeName', - separator = ' ', - separator_highlight = {'NONE',colors.bg}, - highlight = {colors.blue,colors.bg,'bold'} - } -} - -section.short_line_left[2] = { - SFileName = { - provider = function () - local fileinfo = require('galaxyline.provider_fileinfo') - local fname = fileinfo.get_current_file_name() - for _,v in ipairs(gl.short_line_list) do - if v == vim.bo.filetype then - return '' - end - end - return fname - end, - condition = buffer_not_empty, - highlight = {colors.white,colors.bg,'bold'} - } -} - -section.short_line_right[1] = { - BufferIcon = { - provider= 'BufferIcon', - highlight = {colors.fg,colors.bg} - } -} diff --git a/.config/nvim/lua/gitblame/init.lua b/.config/nvim/lua/gitblame/init.lua deleted file mode 100644 index 12645a7..0000000 --- a/.config/nvim/lua/gitblame/init.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.cmd('highlight default link gitblame SpecialComment') -vim.g.gitblame_enabled = 0 diff --git a/.config/nvim/lua/gitsigns/init.lua b/.config/nvim/lua/gitsigns/init.lua deleted file mode 100644 index b435be7..0000000 --- a/.config/nvim/lua/gitsigns/init.lua +++ /dev/null @@ -1,36 +0,0 @@ -require('gitsigns').setup { - signs = { - -- TODO add hl to colorscheme - add = {hl = 'GitSignsAdd' , text = '▎', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'}, - change = {hl = 'GitSignsChange', text = '▎', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, - delete = {hl = 'GitSignsDelete', text = '契', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, - topdelete = {hl = 'GitSignsDelete', text = '契', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, - changedelete = {hl = 'GitSignsChange', text = '▎', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, - }, - numhl = false, - linehl = false, - keymaps = { - -- Default keymap options - noremap = true, - buffer = true, - - --[[ ['n ]c'] = { expr = true, "&diff ? ']c' : 'lua require\"gitsigns\".next_hunk()'"}, - ['n [c'] = { expr = true, "&diff ? '[c' : 'lua require\"gitsigns\".prev_hunk()'"}, - ['n hs'] = 'lua require"gitsigns".stage_hunk()', - ['n hu'] = 'lua require"gitsigns".undo_stage_hunk()', - ['n hr'] = 'lua require"gitsigns".reset_hunk()', - ['n hp'] = 'lua require"gitsigns".preview_hunk()', - ['n hb'] = 'lua require"gitsigns".blame_line()', ]] - - -- Text objects - --[[ ['o ih'] = ':lua require"gitsigns".text_object()', - ['x ih'] = ':lua require"gitsigns".text_object()' ]] - }, - watch_index = { - interval = 1000 - }, - sign_priority = 6, - update_debounce = 200, - status_formatter = nil, -- Use default - use_decoration_api = false -} diff --git a/.config/nvim/lua/goyo/init.vim b/.config/nvim/lua/goyo/init.vim deleted file mode 100644 index f617194..0000000 --- a/.config/nvim/lua/goyo/init.vim +++ /dev/null @@ -1,2 +0,0 @@ -autocmd! User GoyoEnter Limelight lua require('galaxyline').disable_galaxyline() -autocmd! User GoyoLeave Limelight! lua require('galaxyline').galaxyline_augroup() diff --git a/.config/nvim/lua/hop/init.lua b/.config/nvim/lua/hop/init.lua deleted file mode 100644 index f7dd27d..0000000 --- a/.config/nvim/lua/hop/init.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.api.nvim_set_keymap('n', 's', ":HopChar2", {}) -vim.api.nvim_set_keymap('n', 'S', ":HopWord", {}) diff --git a/.config/nvim/lua/kommentary/init.lua b/.config/nvim/lua/kommentary/init.lua deleted file mode 100644 index dea90f7..0000000 --- a/.config/nvim/lua/kommentary/init.lua +++ /dev/null @@ -1,6 +0,0 @@ -vim.g.kommentary_create_default_mappings = false -vim.api.nvim_set_keymap("n", "/", "kommentary_line_default", {}) -vim.api.nvim_set_keymap("v", "/", "kommentary_visual_default", {}) -require('kommentary.config').configure_language("default", { - prefer_single_line_comments = true, -}) diff --git a/.config/nvim/lua/lightbulb/init.lua b/.config/nvim/lua/lightbulb/init.lua deleted file mode 100644 index 1469c5b..0000000 --- a/.config/nvim/lua/lightbulb/init.lua +++ /dev/null @@ -1,36 +0,0 @@ --- Showing defaults -require'nvim-lightbulb'.update_lightbulb { - sign = { - enabled = true, - -- Priority of the gutter sign - priority = 10, - }, - float = { - enabled = false, - -- Text to show in the popup float - text = "💡", - -- Available keys for window options: - -- - height of floating window - -- - width of floating window - -- - wrap_at character to wrap at for computing height - -- - max_width maximal width of floating window - -- - max_height maximal height of floating window - -- - pad_left number of columns to pad contents at left - -- - pad_right number of columns to pad contents at right - -- - pad_top number of lines to pad contents at top - -- - pad_bottom number of lines to pad contents at bottom - -- - offset_x x-axis offset of the floating window - -- - offset_y y-axis offset of the floating window - -- - anchor corner of float to place at the cursor (NW, NE, SW, SE) - -- - winblend transparency of the window (0-100) - win_opts = {}, - }, - virtual_text = { - enabled = false, - -- Text to show at virtual text - text = "💡", - } -} - - -vim.cmd [[autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb()]] diff --git a/.config/nvim/lua/lsp/bash-ls.lua b/.config/nvim/lua/lsp/bash-ls.lua deleted file mode 100644 index 8be0383..0000000 --- a/.config/nvim/lua/lsp/bash-ls.lua +++ /dev/null @@ -1,2 +0,0 @@ --- npm i -g bash-language-server -require'lspconfig'.bashls.setup{} diff --git a/.config/nvim/lua/lsp/docker-ls.lua b/.config/nvim/lua/lsp/docker-ls.lua deleted file mode 100644 index ad6e220..0000000 --- a/.config/nvim/lua/lsp/docker-ls.lua +++ /dev/null @@ -1,2 +0,0 @@ --- npm install -g dockerfile-language-server-nodejs -require'lspconfig'.dockerls.setup{} diff --git a/.config/nvim/lua/lsp/general.lua b/.config/nvim/lua/lsp/general.lua deleted file mode 100644 index fa28dbc..0000000 --- a/.config/nvim/lua/lsp/general.lua +++ /dev/null @@ -1,15 +0,0 @@ -require"lspconfig".efm.setup { - init_options = {documentFormatting = true}, - filetypes = {"lua"}, - settings = { - rootMarkers = {".git/"}, - languages = { - lua = { - { - formatCommand = "lua-format -i --no-keep-simple-function-one-line --no-break-after-operator --column-limit=150 --break-after-table-lb", - formatStdin = true - } - } - } - } -} diff --git a/.config/nvim/lua/lsp/init.lua b/.config/nvim/lua/lsp/init.lua deleted file mode 100644 index 4515e7c..0000000 --- a/.config/nvim/lua/lsp/init.lua +++ /dev/null @@ -1,19 +0,0 @@ ---TODO figure out why this don't work -vim.fn.sign_define("LspDiagnosticsSignError", {texthl = "LspDiagnosticsSignError", text = "", numhl = "LspDiagnosticsSignError"}) -vim.fn.sign_define("LspDiagnosticsSignWarning", {texthl = "LspDiagnosticsSignWarning", text = "", numhl = "LspDiagnosticsSignWarning"}) -vim.fn.sign_define("LspDiagnosticsSignInformation", {texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"}) -vim.fn.sign_define("LspDiagnosticsSignHint", {texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"}) - -vim.cmd('nnoremap gd lua vim.lsp.buf.definition()') -vim.cmd('nnoremap gD lua vim.lsp.buf.declaration()') -vim.cmd('nnoremap gr lua vim.lsp.buf.references()') -vim.cmd('nnoremap gi lua vim.lsp.buf.implementation()') -vim.cmd('nnoremap ca :Lspsaga code_action') -vim.cmd('nnoremap K :Lspsaga hover_doc') --- vim.cmd('nnoremap lua vim.lsp.buf.signature_help()') -vim.cmd('nnoremap :Lspsaga diagnostic_jump_prev') -vim.cmd('nnoremap :Lspsaga diagnostic_jump_next') --- scroll down hover doc or scroll in definition preview -vim.cmd('nnoremap lua require(\'lspsaga.action\').smart_scroll_with_saga(1)') --- scroll up hover doc -vim.cmd('nnoremap lua require(\'lspsaga.action\').smart_scroll_with_saga(-1)') diff --git a/.config/nvim/lua/lsp/json-ls.lua b/.config/nvim/lua/lsp/json-ls.lua deleted file mode 100644 index d13fed3..0000000 --- a/.config/nvim/lua/lsp/json-ls.lua +++ /dev/null @@ -1,10 +0,0 @@ --- npm install -g vscode-json-languageserver -require'lspconfig'.jsonls.setup { - commands = { - Format = { - function() - vim.lsp.buf.range_formatting({},{0,0},{vim.fn.line("$"),0}) - end - } - } -} diff --git a/.config/nvim/lua/lsp/lua-ls.lua b/.config/nvim/lua/lsp/lua-ls.lua deleted file mode 100644 index c04219a..0000000 --- a/.config/nvim/lua/lsp/lua-ls.lua +++ /dev/null @@ -1,37 +0,0 @@ --- https://github.com/sumneko/lua-language-server/wiki/Build-and-Run-(Standalone) -USER = vim.fn.expand('$USER') - -local sumneko_root_path = "" -local sumneko_binary = "" - -if vim.fn.has("mac") == 1 then - sumneko_root_path = "/Users/" .. USER .. "/.config/nvim/lua-language-server" - sumneko_binary = "/Users/" .. USER .. "/.config/nvim/lua-language-server/bin/macOS/lua-language-server" -elseif vim.fn.has("unix") == 1 then - sumneko_root_path = "/home/" .. USER .. "/.config/nvim/lua-language-server" - sumneko_binary = "/home/" .. USER .. "/.config/nvim/lua-language-server/bin/Linux/lua-language-server" -else - print("Unsupported system for sumneko") -end - -require'lspconfig'.sumneko_lua.setup { - cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"}, - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) - version = 'LuaJIT', - -- Setup your lua path - path = vim.split(package.path, ';') - }, - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = {'vim'} - }, - workspace = { - -- Make the server aware of Neovim runtime files - library = {[vim.fn.expand('$VIMRUNTIME/lua')] = true, [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true} - } - } - } -} diff --git a/.config/nvim/lua/lsp/python-ls.lua b/.config/nvim/lua/lsp/python-ls.lua deleted file mode 100644 index 11eeef9..0000000 --- a/.config/nvim/lua/lsp/python-ls.lua +++ /dev/null @@ -1,2 +0,0 @@ --- npm i -g pyright -require'lspconfig'.pyright.setup{} diff --git a/.config/nvim/lua/lsp/vim.lua b/.config/nvim/lua/lsp/vim.lua deleted file mode 100644 index a7555c6..0000000 --- a/.config/nvim/lua/lsp/vim.lua +++ /dev/null @@ -1,2 +0,0 @@ --- npm install -g vim-language-server -require'lspconfig'.vimls.setup{} diff --git a/.config/nvim/lua/lsp/wrapper.lua b/.config/nvim/lua/lsp/wrapper.lua deleted file mode 100644 index 7f3647c..0000000 --- a/.config/nvim/lua/lsp/wrapper.lua +++ /dev/null @@ -1,129 +0,0 @@ -local lsp_wrapper = {} - --- buf - -function lsp_wrapper.add_to_workspace_folder() - vim.lsp.buf.add_workspace_folder() -end - -function lsp_wrapper.clear_references() - vim.lsp.buf.clear_references() -end - -function lsp_wrapper.code_action() - vim.lsp.buf.code_action() -end - -function lsp_wrapper.declaration() - vim.lsp.buf.declaration() - vim.lsp.buf.clear_references() -end - -function lsp_wrapper.definition() - vim.lsp.buf.definition() - vim.lsp.buf.clear_references() -end - -function lsp_wrapper.document_highlight() - vim.lsp.buf.document_highlight() -end - -function lsp_wrapper.document_symbol() - vim.lsp.buf.document_symbol() -end - -function lsp_wrapper.formatting() - vim.lsp.buf.formatting() -end - -function lsp_wrapper.formatting_sync() - vim.lsp.buf.formatting_sync() -end - -function lsp_wrapper.hover() - vim.lsp.buf.hover() -end - -function lsp_wrapper.implementation() - vim.lsp.buf.implementation() -end - -function lsp_wrapper.incoming_calls() - vim.lsp.buf.incoming_calls() -end - -function lsp_wrapper.list_workspace_folders() - vim.lsp.buf.list_workspace_folders() -end - -function lsp_wrapper.outgoing_calls() - vim.lsp.buf.outgoing_calls() -end - -function lsp_wrapper.range_code_action() - vim.lsp.buf.range_code_action() -end - -function lsp_wrapper.range_formatting() - vim.lsp.buf.range_formatting() -end - -function lsp_wrapper.references() - vim.lsp.buf.references() - vim.lsp.buf.clear_references() -end - -function lsp_wrapper.remove_workspace_folder() - vim.lsp.buf.remove_workspace_folder() -end - -function lsp_wrapper.rename() - vim.lsp.buf.rename() -end - -function lsp_wrapper.signature_help() - vim.lsp.buf.signature_help() -end - -function lsp_wrapper.type_definition() - vim.lsp.buf.type_definition() -end - -function lsp_wrapper.workspace_symbol() - vim.lsp.buf.workspace_symbol() -end - --- diagnostic - -function lsp_wrapper.get_all() - vim.lsp.diagnostic.get_all() -end - -function lsp_wrapper.get_next() - vim.lsp.diagnostic.get_next() -end - -function lsp_wrapper.get_prev() - vim.lsp.diagnostic.get_prev() -end - -function lsp_wrapper.goto_next() - vim.lsp.diagnostic.goto_next() -end - -function lsp_wrapper.goto_prev() - vim.lsp.diagnostic.goto_prev() -end - -function lsp_wrapper.show_line_diagnostics() - vim.lsp.diagnostic.show_line_diagnostics() -end - --- misc - --- :lua print(vim.inspect(vim.lsp.buf_get_clients())) - --- autoformat --- autocmd BufWritePre *.rs lua vim.lsp.buf.formatting_sync(nil, 1000) - -return lsp_wrapper diff --git a/.config/nvim/lua/lsp/yaml-ls.lua b/.config/nvim/lua/lsp/yaml-ls.lua deleted file mode 100644 index 904f20e..0000000 --- a/.config/nvim/lua/lsp/yaml-ls.lua +++ /dev/null @@ -1,2 +0,0 @@ --- npm install -g yaml-language-server -require'lspconfig'.yamlls.setup{} diff --git a/.config/nvim/lua/lspkind/init.lua b/.config/nvim/lua/lspkind/init.lua deleted file mode 100644 index e3c590f..0000000 --- a/.config/nvim/lua/lspkind/init.lua +++ /dev/null @@ -1,26 +0,0 @@ --- symbols for autocomplete -require('lspkind').init({ - with_text = false, - symbol_map = { - Text = '  ', - Method = '  ', - Function = '  ', - Constructor = '  ', - Variable = '[]', - Class = '  ', - Interface = ' 蘒', - Module = '  ', - Property = '  ', - Unit = ' 塞 ', - Value = '  ', - Enum = ' 練', - Keyword = '  ', - Snippet = '  ', - Color = '', - File = '', - Folder = ' ﱮ ', - EnumMember = '  ', - Constant = '  ', - Struct = '  ' - }, -}) diff --git a/.config/nvim/lua/neogit/init.lua b/.config/nvim/lua/neogit/init.lua deleted file mode 100644 index ca38081..0000000 --- a/.config/nvim/lua/neogit/init.lua +++ /dev/null @@ -1 +0,0 @@ -local neogit = require('neogit') diff --git a/.config/nvim/lua/nvimtree/init.lua b/.config/nvim/lua/nvimtree/init.lua deleted file mode 100644 index 3803765..0000000 --- a/.config/nvim/lua/nvimtree/init.lua +++ /dev/null @@ -1,31 +0,0 @@ -local tree_cb = require'nvim-tree.config'.nvim_tree_callback -vim.g.nvim_tree_bindings = { - -- mappings - [""] = tree_cb("edit"), - ["l"] = tree_cb("edit"), - ["o"] = tree_cb("edit"), - ["<2-LeftMouse>"] = tree_cb("edit"), - ["<2-RightMouse>"] = tree_cb("cd"), - [""] = tree_cb("cd"), - ["v"] = tree_cb("vsplit"), - ["s"] = tree_cb("split"), - [""] = tree_cb("tabnew"), - ["h"] = tree_cb("close_node"), - [""] = tree_cb("close_node"), - [""] = tree_cb("close_node"), - [""] = tree_cb("preview"), - ["I"] = tree_cb("toggle_ignored"), - ["H"] = tree_cb("toggle_dotfiles"), - ["R"] = tree_cb("refresh"), - ["a"] = tree_cb("create"), - ["d"] = tree_cb("remove"), - ["r"] = tree_cb("rename"), - [""] = tree_cb("full_rename"), - ["x"] = tree_cb("cut"), - ["c"] = tree_cb("copy"), - ["p"] = tree_cb("paste"), - ["[c"] = tree_cb("prev_git_item"), - ["]c"] = tree_cb("next_git_item"), - ["-"] = tree_cb("dir_up"), - ["q"] = tree_cb("close") -} diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 9bcec6c..1122ba3 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -35,9 +35,9 @@ return require('packer').startup(function() use 'hrsh7th/vim-vsnip-integ' -- Treesitter - use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' } - use 'nvim-treesitter/playground' - use 'p00f/nvim-ts-rainbow' + -- use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' } + -- use 'nvim-treesitter/playground' + -- use 'p00f/nvim-ts-rainbow' -- Icons use 'kyazdani42/nvim-web-devicons' @@ -46,7 +46,6 @@ return require('packer').startup(function() -- Status Line and Bufferline use 'glepnir/galaxyline.nvim' use {'akinsho/nvim-bufferline.lua', requires = 'kyazdani42/nvim-web-devicons'} - use 'romgrk/barbar.nvim' -- Telescope use 'nvim-lua/popup.nvim' @@ -95,5 +94,4 @@ return require('packer').startup(function() use 'junegunn/goyo.vim' use 'junegunn/limelight.vim' use 'vimwiki/vimwiki' - use 'kosayoda/nvim-lightbulb' end) diff --git a/.config/nvim/lua/quickscope/init.lua b/.config/nvim/lua/quickscope/init.lua deleted file mode 100644 index 4c70669..0000000 --- a/.config/nvim/lua/quickscope/init.lua +++ /dev/null @@ -1,7 +0,0 @@ --- Trigger a highlight in the appropriate direction when pressing these keys: --- vim.cmd('let g:qs_highlight_on_keys = [\'f\', \'F\', \'t\', \'T\']') -vim.g.qs_highlight_on_keys = {'f', 'F', 't', 'T'} - -vim.api.nvim_exec('highlight QuickScopePrimary guifg=\'#00C7DF\' gui=underline ctermfg=155 cterm=underline', false) -vim.cmd('highlight QuickScopeSecondary guifg=\'#eF5F70\' gui=underline ctermfg=81 cterm=underline') -vim.g.qs_max_chars=150 diff --git a/.config/nvim/lua/rnvimr/init.lua b/.config/nvim/lua/rnvimr/init.lua deleted file mode 100644 index 055326c..0000000 --- a/.config/nvim/lua/rnvimr/init.lua +++ /dev/null @@ -1,22 +0,0 @@ --- Make Ranger replace netrw and be the file explorer -vim.g.rnvimr_ex_enable = 1 -vim.g.rnvimr_draw_border = 1 - --- Make Ranger to be hidden after picking a file -vim.g.rnvimr_pick_enable = 1 - --- Make Neovim to wipe the buffers corresponding to the files deleted by Ranger -vim.g.rnvimr_bw_enable = 1 - --- vim.cmd('nmap r :RnvimrToggle') - ---[[ let g:rnvimr_ranger_cmd = 'ranger --cmd="set column_ratios 1,1"' - " \ --cmd="set draw_borders separators"' -" let g:rnvimr_layout = { 'relative': 'editor', -" \ 'width': float2nr(round(0.6 * &columns)), -" \ 'height': float2nr(round(0.6 * &lines)), -" \ 'col': float2nr(round(0.2 * &columns)), -" \ 'row': float2nr(round(0.2 * &lines)), -" \ 'style': 'minimal' } -let g:rnvimr_presets = [ - \ {'width': 0.800, 'height': 0.800}] ]] diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index 7ad52c6..e75bb02 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -34,3 +34,14 @@ vim.o.timeoutlen=100 --By default timeoutlen is 1000 ms vim.o.clipboard="unnamedplus" --Copy paste between vim and everything else vim.o.incsearch=true vim.o.guifont="SpaceMono\\ Nerd\\ Font\\ Mono:h18" + +-- relative line numbers +-- vim.cmd('set number relativenumber') +--[[ local u = require('utils') + +u.define_augroups({ + numbertoggle = { + {'BufEnter', 'FocusGained', 'InsertLeave * set relativenumber'}, + {'BufLeave', 'FocusLost', 'InsertEnter * set norelativenumber'}, + }, +}) ]] diff --git a/.config/nvim/lua/startify/init.lua b/.config/nvim/lua/startify/init.lua deleted file mode 100644 index 9b1488b..0000000 --- a/.config/nvim/lua/startify/init.lua +++ /dev/null @@ -1,41 +0,0 @@ -vim.g.startify_custom_header = { - ' ##############..... ############## ', - ' ##############......############## ', - ' ##########..........########## ', - ' ##########........########## ', - ' ##########.......########## ', - ' ##########.....##########.. ', - ' ##########....##########..... ', - ' ..##########..##########......... ', - ' ....##########.#########............. ', - ' ..################JJJ............ ', - ' ################............. ', - ' ##############.JJJ.JJJJJJJJJJ ', - ' ############...JJ...JJ..JJ JJ ', - ' ##########....JJ...JJ..JJ JJ ', - ' ########......JJJ..JJJ JJJ JJJ ', - ' ###### ......... ', - ' ..... ', - ' . ', - } - -vim.g.webdevicons_enable_startify = 1 -vim.g.startify_enable_special = 0 -vim.g.startify_session_dir = '~/.config/nvim/session' -vim.g.startify_session_autoload = 1 -vim.g.startify_session_delete_buffers = 1 -vim.g.startify_change_to_vcs_root = 1 -vim.g.startify_fortune_use_unicode = 1 -vim.g.startify_session_persistence = 1 -vim.g.startify_session_dir = '~/.config/nvim/session' - - -vim.api.nvim_exec('let startify_lists = [ { \'type\': \'files\', \'header\': [\' Files\'] }, { \'type\': \'sessions\', \'header\': [\' Sessions\'] }, { \'type\': \'bookmarks\', \'header\': [\' Bookmarks\'] }, ]',true) - -vim.api.nvim_exec('let startify_bookmarks = [ { \'b\': \'~/Blog\' }, { \'i\': \'~/.config/nvim/init.vim\' }, { \'z\': \'~/.zshrc\' }]', true) - -vim.cmd([[ -function! StartifyEntryFormat() - return 'WebDevIconsGetFileTypeSymbol(absolute_path) ." ". entry_path' -endfunction -]]) diff --git a/.config/nvim/lua/treesitter/init.lua b/.config/nvim/lua/treesitter/init.lua deleted file mode 100644 index d202a9f..0000000 --- a/.config/nvim/lua/treesitter/init.lua +++ /dev/null @@ -1,15 +0,0 @@ -require'nvim-treesitter.configs'.setup { - ensure_installed = "all", -- one of "all", "maintained" (parsers with maintainers), or a list of languages - highlight = { - enable = true, -- false will disable the whole extension - }, -} - -require "nvim-treesitter.configs".setup { - playground = { - enable = true, - disable = {}, - updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code - persist_queries = false -- Whether the query persists across vim sessions - } -} diff --git a/.config/nvim/lua/utils.lua b/.config/nvim/lua/utils.lua index b5f1413..d892729 100644 --- a/.config/nvim/lua/utils.lua +++ b/.config/nvim/lua/utils.lua @@ -29,3 +29,10 @@ define_augroups( }, } ) + +define_augroups({ + numbertoggle = { + {'BufEnter,FocusGained,InsertLeave', '*', 'set relativenumber'}, + {'BufLeave,FocusLost,InsertEnter', '*', 'set norelativenumber'}, + }, +}) diff --git a/.config/nvim/lua/vim-bbye/init.vim b/.config/nvim/lua/vim-bbye/init.vim deleted file mode 100644 index 10ee440..0000000 --- a/.config/nvim/lua/vim-bbye/init.vim +++ /dev/null @@ -1 +0,0 @@ -nnoremap q :Bdelete diff --git a/.config/nvim/lua/vim-pydocstring/init.vim b/.config/nvim/lua/vim-pydocstring/init.vim deleted file mode 100644 index e3d5311..0000000 --- a/.config/nvim/lua/vim-pydocstring/init.vim +++ /dev/null @@ -1 +0,0 @@ -let g:pydocstring_formatter = 'google' diff --git a/.config/nvim/lua/vim-rooter/init.lua b/.config/nvim/lua/vim-rooter/init.lua deleted file mode 100644 index a873194..0000000 --- a/.config/nvim/lua/vim-rooter/init.lua +++ /dev/null @@ -1,2 +0,0 @@ --- TODO create file -vim.g.rooter_silent_chdir = 1 diff --git a/.config/nvim/lua/whichkey/init.vim b/.config/nvim/lua/whichkey/init.vim deleted file mode 100644 index 5491991..0000000 --- a/.config/nvim/lua/whichkey/init.vim +++ /dev/null @@ -1,238 +0,0 @@ -" Leader Key Maps - -" Timeout -let g:which_key_timeout = 100 - -let g:which_key_display_names = {'': '↵', '': '⇆'} - -" Map leader to which_key -nnoremap :silent :silent WhichKey '' -vnoremap :silent :silent WhichKeyVisual '' - -let g:which_key_map = {} -let g:which_key_sep = '→' - -" Not a fan of floating windows for this -let g:which_key_use_floating_win = 0 -let g:which_key_max_size = 0 - -" Hide status line -autocmd! FileType which_key -autocmd FileType which_key set laststatus=0 noshowmode noruler - \| autocmd BufLeave set laststatus=2 noshowmode ruler - - -" Single mappings -" let g:which_key_map['/'] = [ ':call Comment()' , 'comment' ] -" let g:which_key_map['/'] = { 'name' : 'comment' } -let g:which_key_map['/'] = 'which_key_ignore' -let g:which_key_map['?'] = [ ':NvimTreeFindFile' , 'find current file' ] -let g:which_key_map['e'] = [ ':NvimTreeToggle' , 'explorer' ] -let g:which_key_map['h'] = [ 's' , 'split below'] -let g:which_key_map['n'] = [ ':let @/ = ""' , 'no highlight' ] -let g:which_key_map['r'] = [ ':RnvimrToggle' , 'ranger' ] -" TODO create entire treesitter section -let g:which_key_map['T'] = [ ':TSHighlightCapturesUnderCursor' , 'treesitter highlight' ] -let g:which_key_map['v'] = [ 'v' , 'split right'] -" Add Zen mode, play nice with status line -" let g:which_key_map['z'] = [ 'Goyo' , 'zen' ] - -" Group mappings - -" a is for actions -let g:which_key_map.a = { - \ 'name' : '+actions' , - \ 'c' : [':ColorizerToggle' , 'colorizer'], - \ 'e' : [':CocCommand explorer' , 'explorer'], - \ 'h' : [':let @/ = ""' , 'remove search highlight'], - \ 'l' : [':Bracey' , 'start live server'], - \ 'L' : [':BraceyStop' , 'stop live server'], - \ 'm' : [':MarkdownPreview' , 'markdown preview'], - \ 'M' : [':MarkdownPreviewStop' , 'markdown preview stop'], - \ 'n' : [':set nonumber!' , 'line-numbers'], - \ 's' : [':s/\%V\(.*\)\%V/"\1"/' , 'surround'], - \ 'r' : [':set norelativenumber!' , 'relative line nums'], - \ 't' : [':FloatermToggle' , 'terminal'], - \ 'v' : [':Codi' , 'virtual repl on'], - \ 'V' : [':Codi!' , 'virtual repl off'], - \ 'w' : [':StripWhitespace' , 'strip whitespace'], - \ } - -" b is for buffer -" let g:which_key_map.b = { -" \ 'name' : '+buffer' , -" \ '>' : [':BufferMoveNext' , 'move next'], -" \ '<' : [':BufferMovePrevious' , 'move prev'], -" \ 'b' : [':BufferPick' , 'pick buffer'], -" \ 'd' : [':Bdelete' , 'delete-buffer'], -" \ 'n' : ['bnext' , 'next-buffer'], -" \ 'p' : ['bprevious' , 'previous-buffer'], -" \ '?' : ['Buffers' , 'fzf-buffer'], -" \ } - -" d is for debug -" let g:which_key_map.d = { -" \ 'name' : '+debug' , -" \ 'b' : ['VimspectorToggleBreakpoint' , 'breakpoint'], -" \ 'B' : ['VimspectorToggleConditionalBreakpoint' , 'conditional breakpoint'], -" \ 'c' : ['VimspectorRunToCursor' , 'run to cursor'], -" \ 'd' : ['VimspectorContinue' , 'continue'], -" \ 'f' : ['VimspectorAddFunctionBreakpoint' , 'function breakpoint'], -" \ 'm' : [':MaximizerToggle' , 'maximize window'], -" \ 'o' : ['VimspectorStepOver' , 'step over'], -" \ 'O' : ['VimspectorStepOut' , 'step out'], -" \ 'i' : ['VimspectorStepInto' , 'step into'], -" \ 'p' : ['VimspectorPause' , 'pause'], -" \ 'r' : ['VimspectorRestart' , 'restart'], -" \ 's' : ['VimspectorStop' , 'stop'], -" \ } - -" F is for fold -let g:which_key_map.F = { - \ 'name': '+fold', - \ 'O' : [':set foldlevel=20', 'open all'], - \ 'C' : [':set foldlevel=0', 'close all'], - \ 'c' : [':foldclose', 'close'], - \ 'o' : [':foldopen', 'open'], - \ '1' : [':set foldlevel=1', 'level1'], - \ '2' : [':set foldlevel=2', 'level2'], - \ '3' : [':set foldlevel=3', 'level3'], - \ '4' : [':set foldlevel=4', 'level4'], - \ '5' : [':set foldlevel=5', 'level5'], - \ '6' : [':set foldlevel=6', 'level6'] - \ } - -" s is for search powered by telescope -let g:which_key_map.s = { - \ 'name' : '+search' , - \ '.' : [':Telescope filetypes' , 'filetypes'], - \ ';' : [':Telescope commands' , 'commands'], - \ 'a' : [':Telescope lsp_code_actions' , 'code_actions'], - \ 'A' : [':Telescope builtin' , 'all'], - \ 'b' : [':Telescope buffers' , 'buffers'], - \ 'B' : [':Telescope git_branches' , 'git branches'], - \ 'd' : [':Telescope lsp_document_diagnostics' , 'document_diagnostics'], - \ 'D' : [':Telescope lsp_workspace_diagnostics' , 'workspace_diagnostics'], - \ 'c' : [':Telescope git_commits' , 'git_commits'], - \ 'C' : [':Telescope git_bcommits' , 'git_bcommits'], - \ 'f' : [':Telescope find_files' , 'files'], - \ 'F' : [':Telescope git_files' , 'git_files'], - \ 'g' : [':Telescope tags' , 'tags'], - \ 'G' : [':Telescope current_buffer_tags' , 'buffer_tags'], - \ 'h' : [':Telescope command_history' , 'history'], - \ 'H' : [':Telescope help_tags' , 'help_tags'], - \ 'i' : [':Telescope media_files' , 'media files'], - \ 'k' : [':Telescope keymaps' , 'keymaps'], - \ 'l' : [':Telescope loclist' , 'loclist'], - \ 'm' : [':Telescope marks' , 'marks'], - \ 'M' : [':Telescope man_pages' , 'man_pages'], - \ 'o' : [':Telescope vim_options' , 'vim_options'], - \ 'O' : [':Telescope oldfiles' , 'oldfiles'], - \ 'p' : [':Telescope fd' , 'fd'], - \ 'P' : [':Telescope spell_suggest' , 'spell_suggest'], - \ 's' : [':Telescope git_status' , 'git_status'], - \ 'S' : [':Telescope grep_string' , 'grep_string'], - \ 't' : [':Telescope live_grep' , 'text'], - \ 'y' : [':Telescope symbols' , 'symbols'], - \ 'Y' : [':Telescope lsp_workspace_symbols' , 'lsp_workspace_symbols'], - \ 'r' : [':Telescope registers' , 'registers'], - \ 'R' : [':Telescope reloader' , 'reloader'], - \ 'w' : [':Telescope file_browser' , 'buf_fuz_find'], - \ 'u' : [':Telescope colorscheme' , 'colorschemes'], - \ 'z' : [':Telescope current_buffer_fuzzy_find' , 'buf_fuz_find'], - \ } - -let g:which_key_map.S = { - \ 'name' : '+Session' , - \ 'c' : [':SClose' , 'Close Session'] , - \ 'd' : [':SDelete' , 'Delete Session'] , - \ 'l' : [':SLoad' , 'Load Session'] , - \ 's' : [':Startify' , 'Start Page'] , - \ 'S' : [':SSave' , 'Save Session'] , - \ } - -" g is for git -" let g:which_key_map.g = { -" \ 'name' : '+git' , -" \ 'a' : [':Git add .' , 'add all'], -" \ 'A' : [':CocCommand fzf-preview.GitStatus' , 'actions'], -" \ 'b' : [':Git blame' , 'blame'], -" \ 'B' : [':GBrowse' , 'browse'], -" \ 'c' : [':Git commit' , 'commit'], -" \ 'd' : [':Git diff' , 'diff'], -" \ 'D' : [':Gdiffsplit' , 'diff split'], -" \ 'g' : [':GGrep' , 'git grep'], -" \ 'G' : [':Gstatus' , 'status'], -" \ 'h' : [':GitGutterLineHighlightsToggle' , 'highlight hunks'], -" \ 'H' : ['(GitGutterPreviewHunk)' , 'preview hunk'], -" \ 'i' : [':Gist -b' , 'post gist'], -" \ 'j' : ['(GitGutterNextHunk)' , 'next hunk'], -" \ 'k' : ['(GitGutterPrevHunk)' , 'prev hunk'], -" \ 'l' : [':Git log' , 'log'], -" \ 'm' : ['(git-messenger)' , 'message'], -" \ 'p' : [':Git push' , 'push'], -" \ 'P' : [':Git pull' , 'pull'], -" \ 'r' : [':GRemove' , 'remove'], -" \ 's' : ['(GitGutterStageHunk)' , 'stage hunk'], -" \ 'S' : [':CocCommand fzf-preview.GitStatus' , 'status'], -" \ 't' : [':GitGutterSignsToggle' , 'toggle signs'], -" \ 'u' : ['(GitGutterUndoHunk)' , 'undo hunk'], -" \ 'v' : [':GV' , 'view commits'], -" \ 'V' : [':GV!' , 'view buffer commits'], -" \ } - " \ 'A' : [':Git add %' , 'add current'], - " \ 'S' : [':!git status' , 'status'], - -" let g:which_key_map.G = { -" \ 'name' : '+gist' , -" \ 'a' : [':Gist -a' , 'post gist anon'], -" \ 'b' : [':Gist -b' , 'post gist browser'], -" \ 'd' : [':Gist -d' , 'delete gist'], -" \ 'e' : [':Gist -e' , 'edit gist'], -" \ 'l' : [':Gist -l' , 'list public gists'], -" \ 's' : [':Gist -ls' , 'list starred gists'], -" \ 'm' : [':Gist -m' , 'post gist all buffers'], -" \ 'p' : [':Gist -P' , 'post public gist '], -" \ 'P' : [':Gist -p' , 'post private gist '], -" \ } - -" l is for language server protocol -let g:which_key_map.l = { - \ 'name' : '+lsp' , - \ 'a' : [':Lspsaga code_action' , 'quickfix'], - \ 'A' : [':Lspsaga range_code_action' , 'selected action'], - \ 'd' : [':Telescope lsp_document_diagnostics' , 'document diagnostics'], - \ 'D' : [':Telescope lsp_workspace_diagnostics', 'workspace diagnostics'], - \ 'f' : [':LspFormatting' , 'format'], - \ 'H' : [':Lspsaga signature_help' , 'signature_help'], - \ 'I' : [':LspInfo' , 'lsp_info'], - \ 'l' : [':Lspsaga lsp_finder' , 'lsp_finder'], - \ 'L' : [':Lspsaga show_line_diagnostics' , 'line_diagnostics'], - \ 'o' : [':Vista!!' , 'outline'], - \ 'p' : [':Lspsaga preview_definition' , 'preview definition'], - \ 'q' : [':Telescope quickfix' , 'quickfix'], - \ 'r' : [':LspRename' , 'rename'], - \ 'T' : [':LspTypeDefinition' , 'type defintion'], - \ 'x' : [':cclose' , 'close quickfix'], - \ 's' : [':Telescope lsp_document_symbols' , 'document symbols'], - \ 'S' : [':Telescope lsp_workspace_symbols' , 'workspace symbols'], - \ } - -" t is for terminal -let g:which_key_map.t = { - \ 'name' : '+terminal' , - \ ';' : [':FloatermNew --wintype=normal --height=6' , 'terminal'], - \ 'f' : [':FloatermNew fzf' , 'fzf'], - \ 'g' : [':FloatermNew lazygit' , 'git'], - \ 'd' : [':FloatermNew lazydocker' , 'docker'], - \ 'n' : [':FloatermNew node' , 'node'], - \ 'N' : [':FloatermNew nnn' , 'nnn'], - \ 'p' : [':FloatermNew python' , 'python'], - \ 'm' : [':FloatermNew lazynpm' , 'npm'], - \ 'r' : [':FloatermNew ranger' , 'ranger'], - \ 't' : [':FloatermToggle' , 'toggle'], - \ 'y' : [':FloatermNew ytop' , 'ytop'], - \ 'u' : [':FloatermNew ncdu' , 'ncdu'], - \ } - -call which_key#register('', "g:which_key_map") -- cgit v1.2.3-70-g09d2