From 4528c89adfc3e5ed2ac9d53de7f2a29206dd5895 Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Sat, 11 Mar 2023 11:28:57 -0500 Subject: [PATCH] Nvim updates --- nvim/lua/config/lsp.lua | 66 +++++++++++++++++++---------------- nvim/lua/config/nvim-tree.lua | 10 +++--- nvim/lua/settings.lua | 4 +-- 3 files changed, 42 insertions(+), 38 deletions(-) diff --git a/nvim/lua/config/lsp.lua b/nvim/lua/config/lsp.lua index 1f23ad0..9b7c3a9 100644 --- a/nvim/lua/config/lsp.lua +++ b/nvim/lua/config/lsp.lua @@ -45,8 +45,8 @@ end -- Use a loop to conveniently call 'setup' on multiple servers and -- map buffer local keybindings when the language server attaches -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities) +--local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities = require("cmp_nvim_lsp").default_capabilities() local servers = { "gopls", "bashls", "jedi_language_server", "dockerls", "terraformls", @@ -147,35 +147,39 @@ for _, lsp in ipairs(servers) do }) end -local sumneko_root_path = os.getenv("HOME") .. ".cache/lua-language-server" -local sumneko_binary = "/usr/bin/lua-language-server" -require"lspconfig".sumneko_lua.setup { - cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"}, - capabilities = capabilities, - on_attach = on_attach, - settings = { - Lua = { - runtime = {version = "LuaJIT", path = vim.split(package.path, ";")}, - completion = {enable = true, callSnippet = "Both"}, - diagnostics = { - enable = true, - globals = {"vim", "describe"}, - disable = {"lowercase-global"} - }, - workspace = { - library = { - [vim.fn.expand("$VIMRUNTIME/lua")] = true, - [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true, - [vim.fn.expand("/usr/share/awesome/lib")] = true - }, - -- adjust these two values if your performance is not optimal - maxPreload = 2000, - preloadFileSize = 1000 - }, - telemetry = {enable = false} - } - } -} +-- Test source-kit +--require'lspconfig'.sourcekit.setup{} + + +-- local sumneko_root_path = os.getenv("HOME") .. ".cache/lua-language-server" +-- local sumneko_binary = "/usr/bin/lua-language-server" +-- require"lspconfig".sumneko_lua.setup { +-- cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"}, +-- capabilities = capabilities, +-- on_attach = on_attach, +-- settings = { +-- Lua = { +-- runtime = {version = "LuaJIT", path = vim.split(package.path, ";")}, +-- completion = {enable = true, callSnippet = "Both"}, +-- diagnostics = { +-- enable = true, +-- globals = {"vim", "describe"}, +-- disable = {"lowercase-global"} +-- }, +-- workspace = { +-- library = { +-- [vim.fn.expand("$VIMRUNTIME/lua")] = true, +-- [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true, +-- [vim.fn.expand("/usr/share/awesome/lib")] = true +-- }, +-- -- adjust these two values if your performance is not optimal +-- maxPreload = 2000, +-- preloadFileSize = 1000 +-- }, +-- telemetry = {enable = false} +-- } +-- } +-- } -- alternative to formatter but yamlfix is not working and I need this for respecting yamllint config diff --git a/nvim/lua/config/nvim-tree.lua b/nvim/lua/config/nvim-tree.lua index dbe34c4..81d5147 100644 --- a/nvim/lua/config/nvim-tree.lua +++ b/nvim/lua/config/nvim-tree.lua @@ -43,7 +43,7 @@ require("nvim-tree").setup { -- will not open on setup if the filetype is in this list ignore_ft_on_setup = {}, -- closes neovim automatically when the tree is the last **WINDOW** in the view - auto_close = true, + --auto_close = true, -- opens the tree when changing/opening a new tab if the tree wasn't previously opened open_on_tab = true, -- hijack the cursor in the tree to put it at the start of the filename @@ -51,11 +51,11 @@ require("nvim-tree").setup { -- updates the root directory of the tree on `DirChanged` (when your run `:cd` usually) update_cwd = true, -- this option hides files and folders starting with a dot `.` - hide_dotfiles = true, + --hide_dotfiles = true, -- show lsp diagnostics in the signcolumn diagnostics = { - enabled = true, - icon = {hint = "", info = "", warning = "", error = ""} + enable = true, + icons = {hint = "", info = "", warning = "", error = ""} }, git = {ignore = true}, -- update the focused file on `BufEnter`, un-collapses the folders recursively until it finds the file @@ -88,7 +88,7 @@ require("nvim-tree").setup { -- side of the tree, can be one of 'left' | 'right' | 'top' | 'bottom' side = "left", -- if true the tree will resize itself after opening a file - auto_resize = true, + --auto_resize = true, mappings = { -- custom only false will merge the list with the default mappings -- if true, it will only use your list to set the mappings diff --git a/nvim/lua/settings.lua b/nvim/lua/settings.lua index 59bb230..7826dc0 100644 --- a/nvim/lua/settings.lua +++ b/nvim/lua/settings.lua @@ -33,11 +33,11 @@ o.shiftwidth = 2 -- the number of spaces inserted for each indentation o.tabstop = 2 -- how many columns a tab counts for o.termguicolors = true -- set term gui colors (most terminals support this) o.cursorline = true -- highlight the current line -o.scrolloff = 3 -- Minimal number of screen lines to keep above and below the cursor +o.scrolloff = 8 -- Minimal number of screen lines to keep above and below the cursor o.sidescrolloff = 5 -- The minimal number of columns to scroll horizontally o.hlsearch = true -- highlight all matches on previous search pattern o.ignorecase = true -- ignore case in search patterns -o.foldenable = true -- disable folding; enable with zi +o.foldenable = false -- disable folding; enable with zi o.foldmethod = "expr" o.foldexpr = "nvim_treesitter#foldexpr()" -- o.listchars = "eol:¬,tab:>·,trail:~,extends:>,precedes:<"