From 474f961b2a31c0fe8281188150c08cc2849bf4df Mon Sep 17 00:00:00 2001 From: Christian Chiarulli Date: Tue, 9 Mar 2021 23:55:11 -0500 Subject: Native LSP, more Lua, less CoC --- lua/config-telescope.lua | 76 ----------- lua/lsp-wrapper.lua | 258 ++++++++++++++++++++++++++++++++++++ lua/lsp-wrapper.vim | 27 ++++ lua/lsp/bash-ls.lua | 3 + lua/lsp/css-ls.lua | 3 + lua/lsp/docker-ls.lua | 3 + lua/lsp/graphql-ls.lua | 3 + lua/lsp/html-ls.lua | 11 ++ lua/lsp/javascript-ls.lua | 3 + lua/lsp/json-ls.lua | 11 ++ lua/lsp/lsp-config.lua | 61 +++++++++ lua/lsp/lsp-kind.lua | 27 ++++ lua/lsp/lua-ls.lua | 42 ++++++ lua/lsp/python-ls.lua | 3 + lua/lsp/vim-ls.lua | 3 + lua/lsp/yaml-ls.lua | 3 + lua/nvcodeline.lua | 271 -------------------------------------- lua/plug-colorizer.lua | 15 --- lua/plugins/colorizer-config.lua | 15 +++ lua/plugins/compe-config.lua | 73 ++++++++++ lua/plugins/galaxyline-config.lua | 271 ++++++++++++++++++++++++++++++++++++++ lua/plugins/lspsaga-config.lua | 2 + lua/plugins/nvimtree-config.lua | 31 +++++ lua/plugins/telescope-config.lua | 76 +++++++++++ lua/plugins/treesitter-config.lua | 33 +++++ lua/treesitter.lua | 33 ----- 26 files changed, 962 insertions(+), 395 deletions(-) delete mode 100644 lua/config-telescope.lua create mode 100644 lua/lsp-wrapper.lua create mode 100644 lua/lsp-wrapper.vim create mode 100644 lua/lsp/bash-ls.lua create mode 100644 lua/lsp/css-ls.lua create mode 100644 lua/lsp/docker-ls.lua create mode 100644 lua/lsp/graphql-ls.lua create mode 100644 lua/lsp/html-ls.lua create mode 100644 lua/lsp/javascript-ls.lua create mode 100644 lua/lsp/json-ls.lua create mode 100644 lua/lsp/lsp-config.lua create mode 100644 lua/lsp/lsp-kind.lua create mode 100644 lua/lsp/lua-ls.lua create mode 100644 lua/lsp/python-ls.lua create mode 100644 lua/lsp/vim-ls.lua create mode 100644 lua/lsp/yaml-ls.lua delete mode 100644 lua/nvcodeline.lua delete mode 100644 lua/plug-colorizer.lua create mode 100644 lua/plugins/colorizer-config.lua create mode 100644 lua/plugins/compe-config.lua create mode 100644 lua/plugins/galaxyline-config.lua create mode 100644 lua/plugins/lspsaga-config.lua create mode 100644 lua/plugins/nvimtree-config.lua create mode 100644 lua/plugins/telescope-config.lua create mode 100644 lua/plugins/treesitter-config.lua delete mode 100644 lua/treesitter.lua (limited to 'lua') diff --git a/lua/config-telescope.lua b/lua/config-telescope.lua deleted file mode 100644 index d8e38ca8..00000000 --- a/lua/config-telescope.lua +++ /dev/null @@ -1,76 +0,0 @@ -local actions = require('telescope.actions') --- Global remapping ------------------------------- - -- '--color=never', -require('telescope').setup{ - defaults = { - vimgrep_arguments = { - 'rg', - '--no-heading', - '--with-filename', - '--line-number', - '--column', - '--smart-case' - }, - prompt_position = "bottom", - prompt_prefix = " ", - selection_caret = " ", - entry_prefix = " ", - initial_mode = "insert", - selection_strategy = "reset", - sorting_strategy = "descending", - layout_strategy = "horizontal", - layout_defaults = { - horizontal = { - mirror = false, - }, - vertical = { - mirror = false, - }, - }, - file_sorter = require'telescope.sorters'.get_fuzzy_file, - file_ignore_patterns = {}, - generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter, - shorten_path = true, - winblend = 0, - width = 0.75, - preview_cutoff = 120, - results_height = 1, - results_width = 0.8, - border = {}, - borderchars = { '─', '│', '─', '│', '╭', '╮', '╯', '╰' }, - color_devicons = true, - use_less = true, - set_env = { ['COLORTERM'] = 'truecolor' }, -- default = nil, - file_previewer = require'telescope.previewers'.vim_buffer_cat.new, - grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new, - qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new, - - -- Developer configurations: Not meant for general override - buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker, - mappings = { - i = { - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - -- To disable a keymap, put [map] = false - -- So, to not map "", just put - -- [""] = false, - - -- Otherwise, just set the mapping to the function that you want it to be. - -- [""] = actions.select_horizontal, - - -- Add up multiple actions - [""] = actions.select_default + actions.center, - - -- You can perform as many actions in a row as you like - -- [""] = actions.select_default + actions.center + my_cool_custom_action, - }, - n = { - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - -- [""] = actions.close, - -- [""] = my_cool_custom_action, - }, - }, - } -} diff --git a/lua/lsp-wrapper.lua b/lua/lsp-wrapper.lua new file mode 100644 index 00000000..7df60a7f --- /dev/null +++ b/lua/lsp-wrapper.lua @@ -0,0 +1,258 @@ +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 + + + + +-- You can see more about the differences in types here: +-- https://microsoft.github.io/language-server-protocol/specification#textDocument_documentHighlight + +-- *hl-LspReferenceText* +-- LspReferenceText used for highlighting "text" references +-- *hl-LspReferenceRead* +-- LspReferenceRead used for highlighting "read" references +-- *hl-LspReferenceWrite* +-- LspReferenceWrite used for highlighting "write" references + + +-- *lsp-highlight-diagnostics* +-- All highlights defined for diagnostics begin with `LspDiagnostics` followed by +-- the type of highlight (e.g., `Sign`, `Underline`, etc.) and then the Severity +-- of the highlight (e.g. `Error`, `Warning`, etc.) + +-- Sign, underline and virtual text highlights (by default) are linked to their +-- corresponding LspDiagnosticsDefault highlight. + +-- For example, the default highlighting for |hl-LspDiagnosticsSignError| is +-- linked to |hl-LspDiagnosticsDefaultError|. To change the default (and +-- therefore the linked highlights), use the |:highlight| command: > + +-- highlight LspDiagnosticsDefaultError guifg="BrightRed" +-- < + +-- *hl-LspDiagnosticsDefaultError* +-- LspDiagnosticsDefaultError +-- Used as the base highlight group. +-- Other LspDiagnostic highlights link to this by default (except Underline) + +-- *hl-LspDiagnosticsDefaultWarning* +-- LspDiagnosticsDefaultWarning +-- Used as the base highlight group. +-- Other LspDiagnostic highlights link to this by default (except Underline) + +-- *hl-LspDiagnosticsDefaultInformation* +-- LspDiagnosticsDefaultInformation +-- Used as the base highlight group. +-- Other LspDiagnostic highlights link to this by default (except Underline) + +-- *hl-LspDiagnosticsDefaultHint* +-- LspDiagnosticsDefaultHint +-- Used as the base highlight group. +-- Other LspDiagnostic highlights link to this by default (except Underline) + +-- *hl-LspDiagnosticsVirtualTextError* +-- LspDiagnosticsVirtualTextError +-- Used for "Error" diagnostic virtual text. +-- See |vim.lsp.diagnostic.set_virtual_text()| + +-- *hl-LspDiagnosticsVirtualTextWarning* +-- LspDiagnosticsVirtualTextWarning +-- Used for "Warning" diagnostic virtual text. +-- See |vim.lsp.diagnostic.set_virtual_text()| + +-- *hl-LspDiagnosticsVirtualTextInformation* +-- LspDiagnosticsVirtualTextInformation +-- Used for "Information" diagnostic virtual text. +-- See |vim.lsp.diagnostic.set_virtual_text()| + +-- *hl-LspDiagnosticsVirtualTextHint* +-- LspDiagnosticsVirtualTextHint +-- Used for "Hint" diagnostic virtual text. +-- See |vim.lsp.diagnostic.set_virtual_text()| + +-- *hl-LspDiagnosticsUnderlineError* +-- LspDiagnosticsUnderlineError +-- Used to underline "Error" diagnostics. +-- See |vim.lsp.diagnostic.set_underline()| + +-- *hl-LspDiagnosticsUnderlineWarning* +-- LspDiagnosticsUnderlineWarning +-- Used to underline "Warning" diagnostics. +-- See |vim.lsp.diagnostic.set_underline()| + +-- *hl-LspDiagnosticsUnderlineInformation* +-- LspDiagnosticsUnderlineInformation +-- Used to underline "Information" diagnostics. +-- See |vim.lsp.diagnostic.set_underline()| + +-- *hl-LspDiagnosticsUnderlineHint* +-- LspDiagnosticsUnderlineHint +-- Used to underline "Hint" diagnostics. +-- See |vim.lsp.diagnostic.set_underline()| + +-- *hl-LspDiagnosticsFloatingError* +-- LspDiagnosticsFloatingError +-- Used to color "Error" diagnostic messages in diagnostics float. +-- See |vim.lsp.diagnostic.show_line_diagnostics()| + +-- *hl-LspDiagnosticsFloatingWarning* +-- LspDiagnosticsFloatingWarning +-- Used to color "Warning" diagnostic messages in diagnostics float. +-- See |vim.lsp.diagnostic.show_line_diagnostics()| + +-- *hl-LspDiagnosticsFloatingInformation* +-- LspDiagnosticsFloatingInformation +-- Used to color "Information" diagnostic messages in diagnostics float. +-- See |vim.lsp.diagnostic.show_line_diagnostics()| + +-- *hl-LspDiagnosticsFloatingHint* +-- LspDiagnosticsFloatingHint +-- Used to color "Hint" diagnostic messages in diagnostics float. +-- See |vim.lsp.diagnostic.show_line_diagnostics()| + +-- *hl-LspDiagnosticsSignError* +-- LspDiagnosticsSignError +-- Used for "Error" signs in sign column. +-- See |vim.lsp.diagnostic.set_signs()| + +-- *hl-LspDiagnosticsSignWarning* +-- LspDiagnosticsSignWarning +-- Used for "Warning" signs in sign column. +-- See |vim.lsp.diagnostic.set_signs()| + +-- *hl-LspDiagnosticsSignInformation* +-- LspDiagnosticsSignInformation +-- Used for "Information" signs in sign column. +-- See |vim.lsp.diagnostic.set_signs()| + +-- *hl-LspDiagnosticsSignHint* +-- LspDiagnosticsSignHint +-- Used for "Hint" signs in sign column. +-- See |vim.lsp.diagnostic.set_signs()| diff --git a/lua/lsp-wrapper.vim b/lua/lsp-wrapper.vim new file mode 100644 index 00000000..cd3dc165 --- /dev/null +++ b/lua/lsp-wrapper.vim @@ -0,0 +1,27 @@ +command! LspCodeAction lua require 'lsp-wrapper'.code_action() +command! LspDeclaration lua require 'lsp-wrapper'.declaration() +command! LspDefinition lua require 'lsp-wrapper'.definition() +command! LspDocumentSymbol lua require 'lsp-wrapper'.document_symbol() +command! LspFormatting lua require 'lsp-wrapper'.formatting() +command! LspFormattingSync lua require 'lsp-wrapper'.formatting_sync() +command! LspHover lua require 'lsp-wrapper'.hover() +command! LspImplementation lua require 'lsp-wrapper'.implementation() +command! LspRangeCodeAction lua require 'lsp-wrapper'.range_code_action() +command! LspRangeFormatting lua require 'lsp-wrapper'.range_formatting() +command! LspReferences lua require 'lsp-wrapper'.references() +command! LspRename lua require 'lsp-wrapper'.rename() +command! LspTypeDefinition lua require 'lsp-wrapper'.type_definition() +command! LspWorkspaceSymbol lua require 'lsp-wrapper'.workspace_symbol() +command! LspGotoNext lua require 'lsp-wrapper'.goto_next() +command! LspGotoPrev lua require 'lsp-wrapper'.goto_prev() +command! LspShowLineDiagnostics lua require 'lsp-wrapper'.show_line_diagnostics() +" command! LspAddToWorkspaceFolder lua require 'lsp-wrapper'.add_to_workspace_folder() +" command! LspRemoveWorkspaceFolder lua require 'lsp-wrapper'.remove_workspace_folder() +" command! LspListWorkspaceFolders lua require 'lsp-wrapper'.list_workspace_folders() +" command! LspClearReferences lua require 'lsp-wrapper'.clear_references() +" command! LspGetNext lua require 'lsp-wrapper'.get_next() +" command! LspGetPrev lua require 'lsp-wrapper'.get_prev() +" command! LspGetAll lua require 'lsp-wrapper'.get_all() +" command! LspIncomingCalls lua require 'lsp-wrapper'.incoming_calls() +" command! LspOutGoingCalls lua require 'lsp-wrapper'.outgoing_calls() +" command! LspDocumentHighlight lua require 'lsp-wrapper'.document_highlight() diff --git a/lua/lsp/bash-ls.lua b/lua/lsp/bash-ls.lua new file mode 100644 index 00000000..ae3e7d70 --- /dev/null +++ b/lua/lsp/bash-ls.lua @@ -0,0 +1,3 @@ +-- npm i -g bash-language-server +require'lspconfig'.bashls.setup{} + diff --git a/lua/lsp/css-ls.lua b/lua/lsp/css-ls.lua new file mode 100644 index 00000000..337fd585 --- /dev/null +++ b/lua/lsp/css-ls.lua @@ -0,0 +1,3 @@ +-- npm install -g vscode-css-languageserver-bin +require'lspconfig'.cssls.setup{} + diff --git a/lua/lsp/docker-ls.lua b/lua/lsp/docker-ls.lua new file mode 100644 index 00000000..32b8b946 --- /dev/null +++ b/lua/lsp/docker-ls.lua @@ -0,0 +1,3 @@ +-- npm install -g dockerfile-language-server-nodejs +require'lspconfig'.dockerls.setup{} + diff --git a/lua/lsp/graphql-ls.lua b/lua/lsp/graphql-ls.lua new file mode 100644 index 00000000..6369446d --- /dev/null +++ b/lua/lsp/graphql-ls.lua @@ -0,0 +1,3 @@ +-- npm install -g graphql-language-service-cli +require'lspconfig'.graphql.setup{} + diff --git a/lua/lsp/html-ls.lua b/lua/lsp/html-ls.lua new file mode 100644 index 00000000..b27650a6 --- /dev/null +++ b/lua/lsp/html-ls.lua @@ -0,0 +1,11 @@ +-- npm install -g vscode-html-languageserver-bin +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.html.setup { + capabilities = capabilities, +} + + +require'lspconfig'.html.setup{} diff --git a/lua/lsp/javascript-ls.lua b/lua/lsp/javascript-ls.lua new file mode 100644 index 00000000..62ca0675 --- /dev/null +++ b/lua/lsp/javascript-ls.lua @@ -0,0 +1,3 @@ +-- npm install -g typescript typescript-language-server +require'lspconfig'.tsserver.setup{} + diff --git a/lua/lsp/json-ls.lua b/lua/lsp/json-ls.lua new file mode 100644 index 00000000..474f1803 --- /dev/null +++ b/lua/lsp/json-ls.lua @@ -0,0 +1,11 @@ +-- 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/lua/lsp/lsp-config.lua b/lua/lsp/lsp-config.lua new file mode 100644 index 00000000..74b82865 --- /dev/null +++ b/lua/lsp/lsp-config.lua @@ -0,0 +1,61 @@ +-- local nvim_lsp = require('lspconfig') +-- local on_attach = function(client, bufnr) +-- local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end +-- local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end + +-- buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') + +-- -- Mappings. +-- local opts = { noremap=true, silent=true } +-- buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) +-- -- buf_set_keymap('n', 'gd', ':lua vim.lsp.buf.definition()') +-- buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) +-- buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) +-- buf_set_keymap('n', '', 'lua vim.lsp.buf.signature_help()', opts) +-- buf_set_keymap('n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) +-- buf_set_keymap('n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) +-- buf_set_keymap('n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) +-- buf_set_keymap('n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) +-- buf_set_keymap('n', 'D', 'lua vim.lsp.buf.type_definition()', opts) +-- buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) +-- -- buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) +-- buf_set_keymap('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) +-- buf_set_keymap('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()', opts) +-- buf_set_keymap('n', ']d', 'lua vim.lsp.diagnostic.goto_next()', opts) +-- buf_set_keymap('n', 'q', 'lua vim.lsp.diagnostic.set_loclist()', opts) + +-- -- *vim.lsp.buf.code_action() + +-- -- Set some keybinds conditional on server capabilities +-- if client.resolved_capabilities.document_formatting then +-- buf_set_keymap("n", "f", "lua vim.lsp.buf.formatting()", opts) +-- elseif client.resolved_capabilities.document_range_formatting then +-- buf_set_keymap("n", "f", "lua vim.lsp.buf.range_formatting()", opts) +-- end +-- -- Set autocommands conditional on server_capabilities +-- -- if client.resolved_capabilities.document_highlight then +-- -- vim.api.nvim_exec([[ +-- -- hi LspReferenceRead cterm=bold ctermbg=red guibg=Pink +-- -- hi LspReferenceText cterm=bold ctermbg=red guibg=Pink +-- -- hi LspReferenceWrite cterm=bold ctermbg=red guibg=Pink +-- -- augroup lsp_document_highlight +-- -- autocmd! * +-- -- autocmd CursorHold lua vim.lsp.buf.document_highlight() +-- -- autocmd CursorMoved lua vim.lsp.buf.clear_references() +-- -- augroup END +-- -- ]], false) +-- -- end +-- end + +-- -- Use a loop to conveniently both setup defined servers +-- -- and map buffer local keybindings when the language server attaches +-- local servers = { "pyright", "rust_analyzer", "tsserver" } +-- for _, lsp in ipairs(servers) do +-- nvim_lsp[lsp].setup { on_attach = on_attach } +-- end + + +vim.fn.sign_define("LspDiagnosticsSignError", {text = "", numhl = "LspDiagnosticsDefaultError"}) +vim.fn.sign_define("LspDiagnosticsSignWarning", {text = "", numhl = "LspDiagnosticsDefaultWarning"}) +vim.fn.sign_define("LspDiagnosticsSignInformation", {text = "", numhl = "LspDiagnosticsDefaultInformation"}) +vim.fn.sign_define("LspDiagnosticsSignHint", {text = "", numhl = "LspDiagnosticsDefaultHint"}) diff --git a/lua/lsp/lsp-kind.lua b/lua/lsp/lsp-kind.lua new file mode 100644 index 00000000..7ac3fefa --- /dev/null +++ b/lua/lsp/lsp-kind.lua @@ -0,0 +1,27 @@ +-- commented options are defaults +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/lua/lsp/lua-ls.lua b/lua/lsp/lua-ls.lua new file mode 100644 index 00000000..95e72216 --- /dev/null +++ b/lua/lsp/lua-ls.lua @@ -0,0 +1,42 @@ +-- https://github.com/sumneko/lua-language-server/wiki/Build-and-Run-(Standalone) +-- TODO fix for different systems and put variable for user + +-- local system_name +-- if vim.fn.has("mac") == 1 then +-- system_name = "macOS" +-- elseif vim.fn.has("unix") == 1 then +-- system_name = "Linux" +-- elseif vim.fn.has('win32') == 1 then +-- system_name = "Windows" +-- else +-- print("Unsupported system for sumneko") +-- end + +-- set the path to the sumneko installation; if you previously installed via the now deprecated :LspInstall, use +local sumneko_root_path = "/Users/chris/.config/nvim/lua-language-server" +local sumneko_binary = "/Users/chris/.config/nvim/lua-language-server/bin/macOS/lua-language-server" + +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/lua/lsp/python-ls.lua b/lua/lsp/python-ls.lua new file mode 100644 index 00000000..0be71acb --- /dev/null +++ b/lua/lsp/python-ls.lua @@ -0,0 +1,3 @@ +-- npm i -g pyright +require'lspconfig'.pyright.setup{} + diff --git a/lua/lsp/vim-ls.lua b/lua/lsp/vim-ls.lua new file mode 100644 index 00000000..ac1e6e19 --- /dev/null +++ b/lua/lsp/vim-ls.lua @@ -0,0 +1,3 @@ +-- npm install -g vim-language-server +require'lspconfig'.vimls.setup{} + diff --git a/lua/lsp/yaml-ls.lua b/lua/lsp/yaml-ls.lua new file mode 100644 index 00000000..6b2de91e --- /dev/null +++ b/lua/lsp/yaml-ls.lua @@ -0,0 +1,3 @@ +-- npm install -g yaml-language-server +require'lspconfig'.yamlls.setup{} + diff --git a/lua/nvcodeline.lua b/lua/nvcodeline.lua deleted file mode 100644 index e416b2c3..00000000 --- a/lua/nvcodeline.lua +++ /dev/null @@ -1,271 +0,0 @@ --- require'nvim-web-devicons'.setup() - -local gl = require('galaxyline') -local gls = gl.section -gl.short_line_list = {'LuaTree','vista','dbui'} - -local colors = { - bg = '#282c34', - yellow = '#fabd2f', - cyan = '#008080', - darkblue = '#081633', - green = '#608B4E', - orange = '#FF8800', - purple = '#5d4d7a', - magenta = '#d16d9e', - grey = '#c0c0c0', - blue = '#569CD6', - red = '#D16969' -} - -local buffer_not_empty = function() - if vim.fn.empty(vim.fn.expand('%:t')) ~= 1 then - return true - end - return false -end - --- gls.left[1] = { --- FirstElement = { --- -- provider = function() return '▋' end, --- provider = function() return ' ' end, --- highlight = {colors.bg,colors.bg} --- }, --- } --- gls.left[2] = { --- ViMode = { --- provider = function() --- local alias = {n = 'NORMAL',i = 'INSERT',c= 'COMMAND',V= 'VISUAL', [''] = 'VISUAL'} --- return alias[vim.fn.mode()] --- end, --- separator = ' ', --- separator_highlight = {colors.yellow,function() --- if not buffer_not_empty() then --- return colors.purple --- end --- return colors.purple --- end}, --- highlight = {colors.grey,colors.purple,'bold'}, --- }, --- } -gls.left[2] = { - ViMode = { - provider = function() - -- auto change color according the vim mode - local mode_color = {n = colors.purple, - i = colors.green, - v = colors.blue, - [''] = colors.blue, - V = colors.blue, - c = colors.purple, - no = colors.magenta, - s = colors.orange, - S = colors.orange, - [''] = colors.orange, - ic = colors.yellow, - R = colors.red, - Rv = colors.red, - cv = colors.red, - ce=colors.red, - r = colors.cyan, - rm = colors.cyan, - ['r?'] = colors.cyan, - ['!'] = colors.red, - t = colors.red} - vim.api.nvim_command('hi GalaxyViMode guibg='..mode_color[vim.fn.mode()]) - return ' NVCode ' - end, - separator = ' ', - separator_highlight = {colors.yellow,function() - if not buffer_not_empty() then - return colors.bg - end - return colors.bg - end}, - highlight = {colors.grey,colors.bg,'bold'}, - }, -} --- gls.left[3] ={ --- FileIcon = { --- separator = ' ', --- provider = 'FileIcon', --- condition = buffer_not_empty, --- highlight = {require('galaxyline.provider_fileinfo').get_file_icon_color,colors.bg}, --- }, --- } --- gls.left[4] = { --- FileName = { --- provider = {'FileSize'}, --- condition = buffer_not_empty, --- separator = ' ', --- separator_highlight = {colors.purple,colors.bg}, --- highlight = {colors.magenta,colors.bg} --- } --- } - -gls.left[3] = { - GitIcon = { - provider = function() return ' ' end, - condition = buffer_not_empty, - highlight = {colors.orange,colors.bg}, - } -} -gls.left[4] = { - GitBranch = { - provider = 'GitBranch', - separator = ' ', - separator_highlight = {colors.purple,colors.bg}, - condition = buffer_not_empty, - highlight = {colors.grey,colors.bg}, - } -} - -local checkwidth = function() - local squeeze_width = vim.fn.winwidth(0) / 2 - if squeeze_width > 40 then - return true - end - return false -end - -gls.left[5] = { - DiffAdd = { - provider = 'DiffAdd', - condition = checkwidth, - -- separator = ' ', - -- separator_highlight = {colors.purple,colors.bg}, - icon = '  ', - highlight = {colors.green,colors.bg}, - } -} -gls.left[6] = { - DiffModified = { - provider = 'DiffModified', - condition = checkwidth, - -- separator = ' ', - -- separator_highlight = {colors.purple,colors.bg}, - icon = '  ', - highlight = {colors.blue,colors.bg}, - } -} -gls.left[7] = { - DiffRemove = { - provider = 'DiffRemove', - condition = checkwidth, - -- separator = ' ', - -- separator_highlight = {colors.purple,colors.bg}, - icon = '  ', - highlight = {colors.red,colors.bg}, - } -} -gls.left[8] = { - LeftEnd = { - provider = function() return ' ' end, - separator = ' ', - separator_highlight = {colors.purple,colors.bg}, - highlight = {colors.purple,colors.bg} - } -} -gls.left[9] = { - DiagnosticError = { - provider = 'DiagnosticError', - icon = '  ', - highlight = {colors.red,colors.bg} - } -} -gls.left[10] = { - Space = { - provider = function () return '' end - } -} -gls.left[11] = { - DiagnosticWarn = { - provider = 'DiagnosticWarn', - icon = '  ', - highlight = {colors.yellow,colors.bg}, - } -} -gls.left[12] = { - DiagnosticHint = { - provider = 'DiagnosticHint', - icon = '  ', - highlight = {colors.blue,colors.bg}, - } -} -gls.left[13] = { - DiagnosticInfo = { - provider = 'DiagnosticInfo', - icon = '  ', - highlight = {colors.orange,colors.bg}, - } -} -gls.right[1]= { - FileFormat = { - provider = 'FileFormat', - separator = ' ', - separator_highlight = {colors.bg,colors.bg}, - highlight = {colors.grey,colors.bg}, - } -} -gls.right[2] = { - LineInfo = { - provider = 'LineColumn', - separator = ' | ', - separator_highlight = {colors.darkblue,colors.bg}, - highlight = {colors.grey,colors.bg}, - }, -} -gls.right[3] = { - PerCent = { - provider = 'LinePercent', - separator = ' |', - separator_highlight = {colors.darkblue,colors.bg}, - highlight = {colors.grey,colors.bg}, - } -} -gls.right[4] = { - ScrollBar = { - provider = 'ScrollBar', - highlight = {colors.yellow,colors.purple}, - } -} - --- gls.short_line_left[1] = { --- BufferType = { --- provider = 'FileTypeName', --- separator = ' ', --- separator_highlight = {colors.purple,colors.bg}, --- highlight = {colors.grey,colors.purple} --- } --- } - -gls.short_line_left[1] = { - LeftEnd = { - provider = function() return ' ' end, - separator = ' ', - separator_highlight = {colors.purple,colors.bg}, - highlight = {colors.purple,colors.bg} - } -} - --- gls.short_line_right[1] = { --- BufferIcon = { --- provider= 'BufferIcon', --- separator = ' ', --- separator_highlight = {colors.purple,colors.bg}, --- highlight = {colors.grey,colors.purple} --- } --- } --- function! s:my_bookmark_color() abort --- let s:scl_guibg = matchstr(execute('hi SignColumn'), 'guibg=\zs\S*') --- if empty(s:scl_guibg) --- let s:scl_guibg = 'NONE' --- endif --- exe 'hi MyBookmarkSign guifg=' . s:scl_guibg --- endfunction --- call s:my_bookmark_color() " don't remove this line! - --- augroup UserGitSignColumnColor --- autocmd! --- autocmd ColorScheme * call s:my_bookmark_color() --- augroup END diff --git a/lua/plug-colorizer.lua b/lua/plug-colorizer.lua deleted file mode 100644 index e990d505..00000000 --- a/lua/plug-colorizer.lua +++ /dev/null @@ -1,15 +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/lua/plugins/colorizer-config.lua b/lua/plugins/colorizer-config.lua new file mode 100644 index 00000000..e990d505 --- /dev/null +++ b/lua/plugins/colorizer-config.lua @@ -0,0 +1,15 @@ +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/lua/plugins/compe-config.lua b/lua/plugins/compe-config.lua new file mode 100644 index 00000000..6033c0e7 --- /dev/null +++ b/lua/plugins/compe-config.lua @@ -0,0 +1,73 @@ +-- TODO we need snippet support and to maybe get better docs idk + +vim.o.completeopt = "menuone,noselect" + +require'compe'.setup { + enabled = true; + autocomplete = true; + debug = false; + min_length = 1; + preselect = 'enable'; + throttle_time = 80; + source_timeout = 200; + incomplete_delay = 400; + max_abbr_width = 100; + max_kind_width = 100; + max_menu_width = 100; + documentation = false; + + source = { + path = true; + buffer = true; + calc = true; + vsnip = true; + nvim_lsp = true; + nvim_lua = true; + spell = true; + tags = true; + snippets_nvim = true; + treesitter = true; + }; +} + +local t = function(str) + return vim.api.nvim_replace_termcodes(str, true, true, true) +end + +-- local check_back_space = function() +-- local col = vim.fn.col('.') - 1 +-- if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then +-- return true +-- else +-- return false +-- end +-- end + +-- Use (s-)tab to: +--- move to prev/next item in completion menuone +--- jump to prev/next snippet's placeholder +-- _G.tab_complete = function() +-- if vim.fn.pumvisible() == 1 then +-- return t "" + -- elseif vim.fn.call("vsnip#available", {1}) == 1 then + -- return t "(vsnip-expand-or-jump)" + -- elseif check_back_space() then + -- return t "" + -- else + -- return vim.fn['compe#complete']() + -- end +-- end +_G.s_tab_complete = function() + if vim.fn.pumvisible() == 1 then + return t "" + elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then + return t "(vsnip-jump-prev)" + else + return t "" + end +end + +-- vim.api.nvim_set_keymap("i", "", "v:lua.tab_complete()", {expr = true}) +vim.api.nvim_set_keymap("s", "", "v:lua.tab_complete()", {expr = true}) +vim.api.nvim_set_keymap("i", "", "v:lua.s_tab_complete()", {expr = true}) +vim.api.nvim_set_keymap("s", "", "v:lua.s_tab_complete()", {expr = true}) diff --git a/lua/plugins/galaxyline-config.lua b/lua/plugins/galaxyline-config.lua new file mode 100644 index 00000000..e416b2c3 --- /dev/null +++ b/lua/plugins/galaxyline-config.lua @@ -0,0 +1,271 @@ +-- require'nvim-web-devicons'.setup() + +local gl = require('galaxyline') +local gls = gl.section +gl.short_line_list = {'LuaTree','vista','dbui'} + +local colors = { + bg = '#282c34', + yellow = '#fabd2f', + cyan = '#008080', + darkblue = '#081633', + green = '#608B4E', + orange = '#FF8800', + purple = '#5d4d7a', + magenta = '#d16d9e', + grey = '#c0c0c0', + blue = '#569CD6', + red = '#D16969' +} + +local buffer_not_empty = function() + if vim.fn.empty(vim.fn.expand('%:t')) ~= 1 then + return true + end + return false +end + +-- gls.left[1] = { +-- FirstElement = { +-- -- provider = function() return '▋' end, +-- provider = function() return ' ' end, +-- highlight = {colors.bg,colors.bg} +-- }, +-- } +-- gls.left[2] = { +-- ViMode = { +-- provider = function() +-- local alias = {n = 'NORMAL',i = 'INSERT',c= 'COMMAND',V= 'VISUAL', [''] = 'VISUAL'} +-- return alias[vim.fn.mode()] +-- end, +-- separator = ' ', +-- separator_highlight = {colors.yellow,function() +-- if not buffer_not_empty() then +-- return colors.purple +-- end +-- return colors.purple +-- end}, +-- highlight = {colors.grey,colors.purple,'bold'}, +-- }, +-- } +gls.left[2] = { + ViMode = { + provider = function() + -- auto change color according the vim mode + local mode_color = {n = colors.purple, + i = colors.green, + v = colors.blue, + [''] = colors.blue, + V = colors.blue, + c = colors.purple, + no = colors.magenta, + s = colors.orange, + S = colors.orange, + [''] = colors.orange, + ic = colors.yellow, + R = colors.red, + Rv = colors.red, + cv = colors.red, + ce=colors.red, + r = colors.cyan, + rm = colors.cyan, + ['r?'] = colors.cyan, + ['!'] = colors.red, + t = colors.red} + vim.api.nvim_command('hi GalaxyViMode guibg='..mode_color[vim.fn.mode()]) + return ' NVCode ' + end, + separator = ' ', + separator_highlight = {colors.yellow,function() + if not buffer_not_empty() then + return colors.bg + end + return colors.bg + end}, + highlight = {colors.grey,colors.bg,'bold'}, + }, +} +-- gls.left[3] ={ +-- FileIcon = { +-- separator = ' ', +-- provider = 'FileIcon', +-- condition = buffer_not_empty, +-- highlight = {require('galaxyline.provider_fileinfo').get_file_icon_color,colors.bg}, +-- }, +-- } +-- gls.left[4] = { +-- FileName = { +-- provider = {'FileSize'}, +-- condition = buffer_not_empty, +-- separator = ' ', +-- separator_highlight = {colors.purple,colors.bg}, +-- highlight = {colors.magenta,colors.bg} +-- } +-- } + +gls.left[3] = { + GitIcon = { + provider = function() return ' ' end, + condition = buffer_not_empty, + highlight = {colors.orange,colors.bg}, + } +} +gls.left[4] = { + GitBranch = { + provider = 'GitBranch', + separator = ' ', + separator_highlight = {colors.purple,colors.bg}, + condition = buffer_not_empty, + highlight = {colors.grey,colors.bg}, + } +} + +local checkwidth = function() + local squeeze_width = vim.fn.winwidth(0) / 2 + if squeeze_width > 40 then + return true + end + return false +end + +gls.left[5] = { + DiffAdd = { + provider = 'DiffAdd', + condition = checkwidth, + -- separator = ' ', + -- separator_highlight = {colors.purple,colors.bg}, + icon = '  ', + highlight = {colors.green,colors.bg}, + } +} +gls.left[6] = { + DiffModified = { + provider = 'DiffModified', + condition = checkwidth, + -- separator = ' ', + -- separator_highlight = {colors.purple,colors.bg}, + icon = '  ', + highlight = {colors.blue,colors.bg}, + } +} +gls.left[7] = { + DiffRemove = { + provider = 'DiffRemove', + condition = checkwidth, + -- separator = ' ', + -- separator_highlight = {colors.purple,colors.bg}, + icon = '  ', + highlight = {colors.red,colors.bg}, + } +} +gls.left[8] = { + LeftEnd = { + provider = function() return ' ' end, + separator = ' ', + separator_highlight = {colors.purple,colors.bg}, + highlight = {colors.purple,colors.bg} + } +} +gls.left[9] = { + DiagnosticError = { + provider = 'DiagnosticError', + icon = '  ', + highlight = {colors.red,colors.bg} + } +} +gls.left[10] = { + Space = { + provider = function () return '' end + } +} +gls.left[11] = { + DiagnosticWarn = { + provider = 'DiagnosticWarn', + icon = '  ', + highlight = {colors.yellow,colors.bg}, + } +} +gls.left[12] = { + DiagnosticHint = { + provider = 'DiagnosticHint', + icon = '  ', + highlight = {colors.blue,colors.bg}, + } +} +gls.left[13] = { + DiagnosticInfo = { + provider = 'DiagnosticInfo', + icon = '  ', + highlight = {colors.orange,colors.bg}, + } +} +gls.right[1]= { + FileFormat = { + provider = 'FileFormat', + separator = ' ', + separator_highlight = {colors.bg,colors.bg}, + highlight = {colors.grey,colors.bg}, + } +} +gls.right[2] = { + LineInfo = { + provider = 'LineColumn', + separator = ' | ', + separator_highlight = {colors.darkblue,colors.bg}, + highlight = {colors.grey,colors.bg}, + }, +} +gls.right[3] = { + PerCent = { + provider = 'LinePercent', + separator = ' |', + separator_highlight = {colors.darkblue,colors.bg}, + highlight = {colors.grey,colors.bg}, + } +} +gls.right[4] = { + ScrollBar = { + provider = 'ScrollBar', + highlight = {colors.yellow,colors.purple}, + } +} + +-- gls.short_line_left[1] = { +-- BufferType = { +-- provider = 'FileTypeName', +-- separator = ' ', +-- separator_highlight = {colors.purple,colors.bg}, +-- highlight = {colors.grey,colors.purple} +-- } +-- } + +gls.short_line_left[1] = { + LeftEnd = { + provider = function() return ' ' end, + separator = ' ', + separator_highlight = {colors.purple,colors.bg}, + highlight = {colors.purple,colors.bg} + } +} + +-- gls.short_line_right[1] = { +-- BufferIcon = { +-- provider= 'BufferIcon', +-- separator = ' ', +-- separator_highlight = {colors.purple,colors.bg}, +-- highlight = {colors.grey,colors.purple} +-- } +-- } +-- function! s:my_bookmark_color() abort +-- let s:scl_guibg = matchstr(execute('hi SignColumn'), 'guibg=\zs\S*') +-- if empty(s:scl_guibg) +-- let s:scl_guibg = 'NONE' +-- endif +-- exe 'hi MyBookmarkSign guifg=' . s:scl_guibg +-- endfunction +-- call s:my_bookmark_color() " don't remove this line! + +-- augroup UserGitSignColumnColor +-- autocmd! +-- autocmd ColorScheme * call s:my_bookmark_color() +-- augroup END diff --git a/lua/plugins/lspsaga-config.lua b/lua/plugins/lspsaga-config.lua new file mode 100644 index 00000000..139597f9 --- /dev/null +++ b/lua/plugins/lspsaga-config.lua @@ -0,0 +1,2 @@ + + diff --git a/lua/plugins/nvimtree-config.lua b/lua/plugins/nvimtree-config.lua new file mode 100644 index 00000000..8eeec88d --- /dev/null +++ b/lua/plugins/nvimtree-config.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/lua/plugins/telescope-config.lua b/lua/plugins/telescope-config.lua new file mode 100644 index 00000000..d8e38ca8 --- /dev/null +++ b/lua/plugins/telescope-config.lua @@ -0,0 +1,76 @@ +local actions = require('telescope.actions') +-- Global remapping +------------------------------ + -- '--color=never', +require('telescope').setup{ + defaults = { + vimgrep_arguments = { + 'rg', + '--no-heading', + '--with-filename', + '--line-number', + '--column', + '--smart-case' + }, + prompt_position = "bottom", + prompt_prefix = " ", + selection_caret = " ", + entry_prefix = " ", + initial_mode = "insert", + selection_strategy = "reset", + sorting_strategy = "descending", + layout_strategy = "horizontal", + layout_defaults = { + horizontal = { + mirror = false, + }, + vertical = { + mirror = false, + }, + }, + file_sorter = require'telescope.sorters'.get_fuzzy_file, + file_ignore_patterns = {}, + generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter, + shorten_path = true, + winblend = 0, + width = 0.75, + preview_cutoff = 120, + results_height = 1, + results_width = 0.8, + border = {}, + borderchars = { '─', '│', '─', '│', '╭', '╮', '╯', '╰' }, + color_devicons = true, + use_less = true, + set_env = { ['COLORTERM'] = 'truecolor' }, -- default = nil, + file_previewer = require'telescope.previewers'.vim_buffer_cat.new, + grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new, + qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new, + + -- Developer configurations: Not meant for general override + buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker, + mappings = { + i = { + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + -- To disable a keymap, put [map] = false + -- So, to not map "", just put + -- [""] = false, + + -- Otherwise, just set the mapping to the function that you want it to be. + -- [""] = actions.select_horizontal, + + -- Add up multiple actions + [""] = actions.select_default + actions.center, + + -- You can perform as many actions in a row as you like + -- [""] = actions.select_default + actions.center + my_cool_custom_action, + }, + n = { + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + -- [""] = actions.close, + -- [""] = my_cool_custom_action, + }, + }, + } +} diff --git a/lua/plugins/treesitter-config.lua b/lua/plugins/treesitter-config.lua new file mode 100644 index 00000000..b9549a46 --- /dev/null +++ b/lua/plugins/treesitter-config.lua @@ -0,0 +1,33 @@ +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 + } +} + +-- require'nvim-treesitter.configs'.setup { +-- refactor = { +-- highlight_current_scope = { enable = false }, +-- }, +-- } + +-- require'nvim-treesitter.configs'.setup { +-- refactor = { +-- smart_rename = { +-- enable = true, +-- keymaps = { +-- smart_rename = "grr", +-- }, +-- }, +-- }, +-- } + diff --git a/lua/treesitter.lua b/lua/treesitter.lua deleted file mode 100644 index b9549a46..00000000 --- a/lua/treesitter.lua +++ /dev/null @@ -1,33 +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 - } -} - --- require'nvim-treesitter.configs'.setup { --- refactor = { --- highlight_current_scope = { enable = false }, --- }, --- } - --- require'nvim-treesitter.configs'.setup { --- refactor = { --- smart_rename = { --- enable = true, --- keymaps = { --- smart_rename = "grr", --- }, --- }, --- }, --- } - -- cgit v1.2.3