From 8ccc48b440624c3e7821b120655e36818ec4b502 Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Sat, 24 Apr 2021 11:48:47 +0200 Subject: [PATCH] add more stuff --- files/.config/nvim/fnl/keybinds.fnl | 34 +++++++++---------- files/.config/nvim/fnl/plugins/lsp.fnl | 5 ++- files/.config/nvim/lua/keybinds.lua | 2 +- files/.config/nvim/lua/plugins/lsp.lua | 8 +++-- files/.config/nvim/plugin/packer_compiled.vim | 4 +++ files/.config/nvim/plugins.lua | 2 ++ 6 files changed, 33 insertions(+), 22 deletions(-) diff --git a/files/.config/nvim/fnl/keybinds.fnl b/files/.config/nvim/fnl/keybinds.fnl index 158341b..de14f04 100644 --- a/files/.config/nvim/fnl/keybinds.fnl +++ b/files/.config/nvim/fnl/keybinds.fnl @@ -37,23 +37,23 @@ "o" ["foldopen" "open fold"]} "m" { :name "+Code-actions" - "d" [ ":Lspsaga hover_doc" "show documentation"] - "b" [ ":Lspsaga lsp_finder" "find stuff"] - "x" [ ":Lspsaga preview_definition" "Preview definition"] - "o" [ ":Telescope lsp_document_symbols" "symbols in document"] - "s" [ ":Telescope lsp_workspace_symbols" "symbols in workspace"] - "t" [ ":Lspsaga signature_help" "Show signature help"] - "n" [ ":Lspsaga rename" "rename"] - "v" [ ":Lspsaga code_action" "apply codeaction"] - "a" [ ":Lspsaga show_cursor_diagnostics" "Cursor diagnostics"] - "A" [ ":Lspsaga show_line_diagnostics" "Line diagnostics"] - "E" [ ":Telescope lsp_workspace_diagnostics" "List diagnostics"] - "e" [ (le "vim.lsp.diagnostic.goto_next()") "Jump to the next error"] - "g" [ (le "vim.lsp.buf.definition()") "go to definition"] - "i" [ (le "vim.lsp.buf.implementation()") "show implementation"] - ;"r" [ (le "vim.lsp.buf.references()") "show references"] - "r" [ ":Telescope lsp_references" "show references"] - "f" [ (le "vim.lsp.buf.formatting()") "format file"]} + "d" [ ":Lspsaga hover_doc" "show documentation"] + "b" [ ":Lspsaga lsp_finder" "find stuff"] + "x" [ ":Lspsaga preview_definition" "Preview definition"] + "o" [ ":SymbolsOutline" "Outline"] + "S" [ ":Telescope lsp_document_symbols" "symbols in document"] + "s" [ ":Telescope lsp_dynamic_workspace_symbols" "symbols in workspace"] + "t" [ ":Lspsaga signature_help" "Show signature help"] + "n" [ ":Lspsaga rename" "rename"] + "v" [ ":Lspsaga code_action" "apply codeaction"] + "a" [ ":Lspsaga show_cursor_diagnostics" "Cursor diagnostics"] + "A" [ ":Lspsaga show_line_diagnostics" "Line diagnostics"] + "E" [ ":Telescope lsp_workspace_diagnostics" "List diagnostics"] + "e" [ (le "vim.lsp.diagnostic.goto_next()") "Jump to the next error"] + "g" [ (le "vim.lsp.buf.definition()") "go to definition"] + "i" [ (le "vim.lsp.buf.implementation()") "show implementation"] + "r" [ ":Telescope lsp_references" "show references"] + "f" [ (le "vim.lsp.buf.formatting()") "format file"]} "f" { :name "+folds" diff --git a/files/.config/nvim/fnl/plugins/lsp.fnl b/files/.config/nvim/fnl/plugins/lsp.fnl index 7647104..a962b30 100644 --- a/files/.config/nvim/fnl/plugins/lsp.fnl +++ b/files/.config/nvim/fnl/plugins/lsp.fnl @@ -7,7 +7,8 @@ saga lspsaga utils utils compe compe - lsp_signature lsp_signature} + lsp_signature lsp_signature + symbols-outline symbols-outline} require-macros [macros]}) (fn on_attach [client bufnr] @@ -60,6 +61,8 @@ ;(lsp.vimls.setup { :on_attach on_attach}) +(symbols-outline.setup { :highlight_hovered_item true :show_guides true}) + (compe.setup { :enabled true diff --git a/files/.config/nvim/lua/keybinds.lua b/files/.config/nvim/lua/keybinds.lua index d61d782..35dd089 100644 --- a/files/.config/nvim/lua/keybinds.lua +++ b/files/.config/nvim/lua/keybinds.lua @@ -46,6 +46,6 @@ local function le(s) end nvim.g.which_key_map = {} nvim.command("call which_key#register('', \"g:which_key_map\")") -nvim.g.which_key_map = {[":"] = {":Commands", "Search command with fzf"}, ["["] = {"(YoinkPostPasteSwapBack)", "Swap last paste backwards"}, ["]"] = {"(YoinkPostPasteSwapForward)", "Swap last paste backwards"}, b = {b = {":Buffers", "select open buffer"}, c = {":bdelete!", "close open buffer"}, name = "+buffers", w = {":bwipeout!", "wipeout open buffer"}}, c = {name = "+comment_out"}, e = {name = "+emmet"}, f = {j = {"zj", "jump to next fold"}, k = {"zk", "jump to previous fold"}, n = {":foldclose", "close fold"}, name = "+folds", o = {":foldopen", "open fold"}}, h = {":bprevious", "previous buffer"}, l = {":bnext", "next buffer"}, m = {A = {":Lspsaga show_line_diagnostics", "Line diagnostics"}, E = {":Telescope lsp_workspace_diagnostics", "List diagnostics"}, a = {":Lspsaga show_cursor_diagnostics", "Cursor diagnostics"}, b = {":Lspsaga lsp_finder", "find stuff"}, d = {":Lspsaga hover_doc", "show documentation"}, e = {le("vim.lsp.diagnostic.goto_next()"), "Jump to the next error"}, f = {le("vim.lsp.buf.formatting()"), "format file"}, g = {le("vim.lsp.buf.definition()"), "go to definition"}, i = {le("vim.lsp.buf.implementation()"), "show implementation"}, n = {":Lspsaga rename", "rename"}, name = "+Code-actions", o = {":Telescope lsp_document_symbols", "symbols in document"}, r = {":Telescope lsp_references", "show references"}, s = {":Telescope lsp_workspace_symbols", "symbols in workspace"}, t = {":Lspsaga signature_help", "Show signature help"}, v = {":Lspsaga code_action", "apply codeaction"}, x = {":Lspsaga preview_definition", "Preview definition"}}, o = {":Telescope live_grep", "Grep files"}, p = {":Telescope file_browser", "Open file-browser"}, s = "which_key_ignore", v = {g = {":Goyo | set linebreak", "toggle focus mode"}, i = {":IndentGuidesToggle", "toggle indent guides"}, m = {":set nonumber! norelativenumber", "toggle numbers"}, n = {":set relativenumber!", "toggle relative numbers"}, name = "+view-and-layout"}, z = {c = {"foldclose", "close fold"}, name = "+folds", o = {"foldopen", "open fold"}}} +nvim.g.which_key_map = {[":"] = {":Commands", "Search command with fzf"}, ["["] = {"(YoinkPostPasteSwapBack)", "Swap last paste backwards"}, ["]"] = {"(YoinkPostPasteSwapForward)", "Swap last paste backwards"}, b = {b = {":Buffers", "select open buffer"}, c = {":bdelete!", "close open buffer"}, name = "+buffers", w = {":bwipeout!", "wipeout open buffer"}}, c = {name = "+comment_out"}, e = {name = "+emmet"}, f = {j = {"zj", "jump to next fold"}, k = {"zk", "jump to previous fold"}, n = {":foldclose", "close fold"}, name = "+folds", o = {":foldopen", "open fold"}}, h = {":bprevious", "previous buffer"}, l = {":bnext", "next buffer"}, m = {A = {":Lspsaga show_line_diagnostics", "Line diagnostics"}, E = {":Telescope lsp_workspace_diagnostics", "List diagnostics"}, S = {":Telescope lsp_document_symbols", "symbols in document"}, a = {":Lspsaga show_cursor_diagnostics", "Cursor diagnostics"}, b = {":Lspsaga lsp_finder", "find stuff"}, d = {":Lspsaga hover_doc", "show documentation"}, e = {le("vim.lsp.diagnostic.goto_next()"), "Jump to the next error"}, f = {le("vim.lsp.buf.formatting()"), "format file"}, g = {le("vim.lsp.buf.definition()"), "go to definition"}, i = {le("vim.lsp.buf.implementation()"), "show implementation"}, n = {":Lspsaga rename", "rename"}, name = "+Code-actions", o = {":SymbolsOutline", "Outline"}, r = {":Telescope lsp_references", "show references"}, s = {":Telescope lsp_dynamic_workspace_symbols", "symbols in workspace"}, t = {":Lspsaga signature_help", "Show signature help"}, v = {":Lspsaga code_action", "apply codeaction"}, x = {":Lspsaga preview_definition", "Preview definition"}}, o = {":Telescope live_grep", "Grep files"}, p = {":Telescope file_browser", "Open file-browser"}, s = "which_key_ignore", v = {g = {":Goyo | set linebreak", "toggle focus mode"}, i = {":IndentGuidesToggle", "toggle indent guides"}, m = {":set nonumber! norelativenumber", "toggle numbers"}, n = {":set relativenumber!", "toggle relative numbers"}, name = "+view-and-layout"}, z = {c = {"foldclose", "close fold"}, name = "+folds", o = {"foldopen", "open fold"}}} nvim.o.timeoutlen = 200 return nvim.command("autocmd! VimEnter * :unmap ig\n autocmd! FileType which_key") \ No newline at end of file diff --git a/files/.config/nvim/lua/plugins/lsp.lua b/files/.config/nvim/lua/plugins/lsp.lua index 46c4422..8a92179 100644 --- a/files/.config/nvim/lua/plugins/lsp.lua +++ b/files/.config/nvim/lua/plugins/lsp.lua @@ -19,11 +19,11 @@ end local function _1_(...) local ok_3f_0_, val_0_ = nil, nil local function _1_() - return {require("aniseed.core"), require("compe"), require("aniseed.fennel"), require("lspconfig"), require("lspconfig.configs"), require("lsp_signature"), require("aniseed.nvim"), require("lspsaga"), require("utils")} + return {require("aniseed.core"), require("compe"), require("aniseed.fennel"), require("lspconfig"), require("lspconfig.configs"), require("lsp_signature"), require("aniseed.nvim"), require("lspsaga"), require("symbols-outline"), require("utils")} end ok_3f_0_, val_0_ = pcall(_1_) if ok_3f_0_ then - _0_0["aniseed/local-fns"] = {["require-macros"] = {macros = true}, require = {["lsp-configs"] = "lspconfig.configs", a = "aniseed.core", compe = "compe", fennel = "aniseed.fennel", lsp = "lspconfig", lsp_signature = "lsp_signature", nvim = "aniseed.nvim", saga = "lspsaga", utils = "utils"}} + _0_0["aniseed/local-fns"] = {["require-macros"] = {macros = true}, require = {["lsp-configs"] = "lspconfig.configs", ["symbols-outline"] = "symbols-outline", a = "aniseed.core", compe = "compe", fennel = "aniseed.fennel", lsp = "lspconfig", lsp_signature = "lsp_signature", nvim = "aniseed.nvim", saga = "lspsaga", utils = "utils"}} return val_0_ else return print(val_0_) @@ -31,6 +31,7 @@ local function _1_(...) end local _local_0_ = _1_(...) local a = _local_0_[1] +local utils = _local_0_[10] local compe = _local_0_[2] local fennel = _local_0_[3] local lsp = _local_0_[4] @@ -38,7 +39,7 @@ local lsp_configs = _local_0_[5] local lsp_signature = _local_0_[6] local nvim = _local_0_[7] local saga = _local_0_[8] -local utils = _local_0_[9] +local symbols_outline = _local_0_[9] local _2amodule_2a = _0_0 local _2amodule_name_2a = "plugins.lsp" do local _ = ({nil, _0_0, {{nil}, nil, nil, nil}})[2] end @@ -80,6 +81,7 @@ init_lsp("erlangls") init_lsp("yamlls") init_lsp("html") init_lsp("cssls") +symbols_outline.setup({highlight_hovered_item = true, show_guides = true}) compe.setup({autocomplete = false, debug = false, documentation = true, enabled = true, incomplete_delay = 400, max_abbr_width = 100, max_kind_width = 100, max_menu_width = 100, min_length = 1, preselect = "enable", source = {buffer = true, calc = true, nvim_lsp = true, nvim_lua = true, path = true, vsnip = false}, source_timeout = 200, throttle_time = 80}) saga.init_lsp_saga({border_style = 1, code_action_keys = {exec = "", quit = ""}, finder_action_keys = {open = "", quit = "", scroll_down = "", scroll_up = "", split = "b", vsplit = "v"}, rename_action_keys = {exec = "", quit = ""}}) utils.highlight("LspSagaCodeActionTitle", {fg = "#8ec07c"}) diff --git a/files/.config/nvim/plugin/packer_compiled.vim b/files/.config/nvim/plugin/packer_compiled.vim index 35a00a2..a58dc8c 100644 --- a/files/.config/nvim/plugin/packer_compiled.vim +++ b/files/.config/nvim/plugin/packer_compiled.vim @@ -194,6 +194,10 @@ _G.packer_plugins = { loaded = true, path = "/home/leon/.local/share/nvim/site/pack/packer/start/startuptime.vim" }, + ["symbols-outline.nvim"] = { + loaded = true, + path = "/home/leon/.local/share/nvim/site/pack/packer/start/symbols-outline.nvim" + }, tabular = { loaded = true, path = "/home/leon/.local/share/nvim/site/pack/packer/start/tabular" diff --git a/files/.config/nvim/plugins.lua b/files/.config/nvim/plugins.lua index a95cca7..61b8d18 100644 --- a/files/.config/nvim/plugins.lua +++ b/files/.config/nvim/plugins.lua @@ -15,6 +15,8 @@ require("packer").startup(function(use) use_rocks "rtsisyk/fun" + use "simrat39/symbols-outline.nvim" + -- better quickfix window use "kevinhwang91/nvim-bqf"