From 86475a8e8e6805944f4af2e2ef44fd2f703fc724 Mon Sep 17 00:00:00 2001 From: FaultyBranches Date: Sun, 16 Aug 2026 20:19:05 -0500 Subject: [PATCH] feat: Removing nvim-lspconfig and starting the removal of Mason, adding in LSP definitions for servers that are used, adding in a script to check for LSPs, removing some extraneous items in the tmux conf, moving autopairs to its own file --- deploy.sh | 6 +- lsp_check.sh | 28 +++++ nvim/after/lsp/clangd.lua | 3 + nvim/after/lsp/gdscript.lua | 2 + nvim/after/lsp/jinja_lsp.lua | 14 +-- nvim/after/lsp/lua_ls.lua | 48 ++++++- nvim/after/lsp/marksman.lua | 3 +- nvim/after/lsp/pylsp.lua | 2 + nvim/after/lsp/r_language_server.lua | 1 + nvim/after/lsp/rust_analyzer.lua | 175 ++++++++++++++++++++++++++ nvim/after/lsp/shellcheck.lua | 4 + nvim/after/lsp/yamlls.lua | 2 + nvim/lua/autocmds.lua | 1 - nvim/lua/plugins.lua | 13 +- nvim/lua/plugins/autopairs.lua | 3 + nvim/lua/plugins/gitsigns.lua | 12 +- nvim/lua/plugins/language_support.lua | 30 +++-- nvim/lua/plugins/lualine.lua | 9 +- nvim/lua/plugins/mason.lua | 42 ++++--- nvim/lua/plugins/nvim-cmp.lua | 2 +- nvim/lua/plugins/telescope.lua | 1 - nvim/lua/settings.lua | 2 +- nvim/lua/statusline.lua | 26 ---- tmux.conf | 5 +- zsh/zshrc | 41 +++--- 25 files changed, 352 insertions(+), 123 deletions(-) create mode 100755 lsp_check.sh create mode 100644 nvim/after/lsp/r_language_server.lua create mode 100644 nvim/after/lsp/shellcheck.lua create mode 100644 nvim/lua/plugins/autopairs.lua delete mode 100644 nvim/lua/statusline.lua diff --git a/deploy.sh b/deploy.sh index a3bb989..b77d380 100755 --- a/deploy.sh +++ b/deploy.sh @@ -26,8 +26,10 @@ declare -a config_directories=( "$HOME/.config/zsh" ) -for dir in ${config_directories[@]}; do - mkdir -p ${dir} +echo "----- Creating the install directories and linking config files..." + +for dir in "${config_directories[@]}"; do + mkdir -p "${dir}" done for dotfile in "${!configs[@]}"; do diff --git a/lsp_check.sh b/lsp_check.sh new file mode 100755 index 0000000..6c743a1 --- /dev/null +++ b/lsp_check.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +GREEN='\033[0;32m' +RED='\033[0;31m' +CLEAR='\033[0m' + +declare -A lsp_arr=( + ["pylsp"]="Install the pylsp provider: python-language-server or pylsp" + ["pylint"]="Install the pylint provider: pylint" + ["rust-analyzer"]="Install the rust-analyzer provider" + ["pyright"]="Install the pyright provider" +) + +echo '----- Checking for LSP servers...' + +for lsp in "${!lsp_arr[@]}"; do + echo + echo "Checking for $lsp..." + + which $lsp >/dev/null 2>&1 + + if [[ $? -eq 1 ]]; then + echo -e "${RED} ${lsp_arr[$lsp]} ${CLEAR}" + else + echo -e "${GREEN} Found $lsp ${CLEAR}" + fi +done +echo diff --git a/nvim/after/lsp/clangd.lua b/nvim/after/lsp/clangd.lua index 596d811..9c52b0c 100644 --- a/nvim/after/lsp/clangd.lua +++ b/nvim/after/lsp/clangd.lua @@ -1,3 +1,6 @@ +-- Pulled from the nvim-lspconfig plugin: https://github.com/neovim/nvim-lspconfig/blob/master/lsp/clangd.lua +-- TODO: Review for cleaning up any extraneous items and reduce maint surface + -- https://clangd.llvm.org/extensions.html#switch-between-sourceheader local function switch_source_header(bufnr, client) local method_name = 'textDocument/switchSourceHeader' diff --git a/nvim/after/lsp/gdscript.lua b/nvim/after/lsp/gdscript.lua index 2ddeef7..a4fc426 100644 --- a/nvim/after/lsp/gdscript.lua +++ b/nvim/after/lsp/gdscript.lua @@ -1,3 +1,5 @@ +-- Handles setting up the connection to a locally running Godot instance for LSP responses + return { cmd = vim.lsp.rpc.connect('127.0.0.1', 6005), filetypes = { diff --git a/nvim/after/lsp/jinja_lsp.lua b/nvim/after/lsp/jinja_lsp.lua index 90dcd96..896b9d1 100644 --- a/nvim/after/lsp/jinja_lsp.lua +++ b/nvim/after/lsp/jinja_lsp.lua @@ -1,15 +1,9 @@ -vim.filetype.add { - extension = { - -- tera = 'jinja', - jinja = 'jinja', - jinja2 = 'jinja', - j2 = 'jinja', - } -} +-- Jinja LSP setup tuned to include Tera templates +-- TODO: Not currently working correctly for Tera templates return { name = 'jinja_lsp', cmd = { 'jinja-lsp' }, - filetypes = { 'jinja', 'tera', 'html' }, - -- template_extension = { 'html', 'jinja', 'j2', 'tera' }, + filetypes = { 'jinja', 'tera' }, + root_markers = { '.git' }, } diff --git a/nvim/after/lsp/lua_ls.lua b/nvim/after/lsp/lua_ls.lua index 5a5e953..105d71e 100644 --- a/nvim/after/lsp/lua_ls.lua +++ b/nvim/after/lsp/lua_ls.lua @@ -1,9 +1,47 @@ +-- Lua LSP config handles the initialization of workspace folders to pull in library references for completion return { + cmd = { 'lua-language-server' }, + filetypes = { 'lua' }, + on_init = function (client) + if client.workspace_folders then + local path = client.workspace_folders[1].name + if + path ~= vim.fn.stdpath('config') + and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) + then + return + end + end + + client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { + runtime = { + version = 'LuaJIT', + path = { + 'lua/?.lua', + 'lua/?/init.lua', + }, + }, + workspace = { + checkThirdParty = false, + library = { + vim.env.VIMRUNTIME, + vim.api.nvim_get_runtime_file('lua/lspconfig', false)[1], + }, + }, + }) + end, + root_markers = { + '.emmyrc.json', + '.git', + '.luachecrc', + '.luarc.json', + '.luarc.jsonc', + '.stylua.toml', + }, settings = { Lua = { - diagnostics = { - globals = { 'vim' } - } - } - } + codeLens = { enable = true }, + hint = { enable = true, semicolon = 'Disable' }, + }, + }, } diff --git a/nvim/after/lsp/marksman.lua b/nvim/after/lsp/marksman.lua index 5bb1183..98e0cb1 100644 --- a/nvim/after/lsp/marksman.lua +++ b/nvim/after/lsp/marksman.lua @@ -1,3 +1,4 @@ return { - filetypes = { 'md', 'markdown', 'telekasten' } + cmd = { 'marksman' }, + filetypes = { 'md', 'markdown', 'telekasten' }, } diff --git a/nvim/after/lsp/pylsp.lua b/nvim/after/lsp/pylsp.lua index 78a0e90..c34e25c 100644 --- a/nvim/after/lsp/pylsp.lua +++ b/nvim/after/lsp/pylsp.lua @@ -1,3 +1,5 @@ +-- Python LSP disabling some linting that is not required to enforce + return { cmd = { 'pylsp' }, filetypes = { 'python' }, diff --git a/nvim/after/lsp/r_language_server.lua b/nvim/after/lsp/r_language_server.lua new file mode 100644 index 0000000..a564707 --- /dev/null +++ b/nvim/after/lsp/r_language_server.lua @@ -0,0 +1 @@ +return {} diff --git a/nvim/after/lsp/rust_analyzer.lua b/nvim/after/lsp/rust_analyzer.lua index 3c6b814..693c016 100644 --- a/nvim/after/lsp/rust_analyzer.lua +++ b/nvim/after/lsp/rust_analyzer.lua @@ -1,4 +1,179 @@ +-- Rust LSP adding in some additions for extensive diagnostics + +-- Section from nvim-lspconfig +-- local function reload_workspace() +-- local clients = vim.lsp.get_clients { bufnr = bufnr, name = 'rust_analyzer' } +-- for _, client in ipairs(clients) do +-- vim.notify 'Reloading Cargo Workspace' +-- client:request('rust-analyzer/reloadWorkspace', nil, function(err) +-- if err then +-- error(tostring(err)) +-- end +-- vim.notify 'Cargo workspace reloaded' +-- end, 0) +-- end +-- end +-- +-- local function user_sysroot_src() +-- return vim.tbl_get(vim.lsp.config['rust_analyzer'], 'settings', 'rust-analyzer', 'cargo', 'sysrootSrc') +-- end +-- +-- local function default_sysroot_src() +-- local sysroot = vim.tbl_get(vim.lsp.config['rust_analyzer'], 'settings', 'rust-analyzer', 'cargo', 'sysroot') +-- if not sysroot then +-- local rustc = os.getenv 'RUSTC' or 'rustc' +-- local result = vim.system({ rustc, '--print', 'sysroot' }, { text = true }):wait() +-- +-- local stdout = result.stdout +-- +-- if result.code == 0 and stdout then +-- if string.sub(stdout, #stdout) == '\n' then +-- if #stdout > 1 then +-- sysroot = string.sub(stdout, 1, #stdout - 1) +-- else +-- sysroot = '' +-- end +-- else +-- sysroot = stdout +-- end +-- end +-- end +-- +-- return sysroot and vim.fs.joinpath(sysroot, 'lib/rustlib/src/rust/library') or nil +-- end +-- +-- local function is_library(fname) +-- local user_home = vim.fs.normalize(vim.env.HOME) +-- local cargo_home = os.getenv 'CARGO_HOME' or user_home .. '/.cargo' +-- local registry = cargo_home .. '/registry/src' +-- local git_registry = cargo_home .. '/git/checkouts' +-- +-- local rustup_home = os.getenv 'RUSTUP_HOME' or user_home .. '/.rustup' +-- local toolchains = rustup_home .. '/toolchains' +-- +-- local sysroot_src = user_sysroot_src() or default_sysroot_src() +-- +-- for _, item in ipairs { toolchains, registry, git_registry, sysroot_src } do +-- if item and vim.fs.relpath(item, fname) then +-- local clients = vim.lsp.get_clients { name = 'rust_analyzer' } +-- return #clients > 0 and clients[#clients].config.root_dir or nil +-- end +-- end +-- end +-- +-- return { +-- cmd = { 'rust-analyzer' }, +-- filetypes = { 'rust' }, +-- root_dir = function(bufnr, on_dir) +-- local fname = vim.api.nvim_buf_get_name(bufnr) +-- local reused_dir = is_library(fname) +-- if reused_dir then +-- on_dir(reused_dir) +-- return +-- end +-- +-- local cargo_crate_dir = vim.fs.root(fname, { 'Cargo.toml' }) +-- local cargo_workspace_root +-- +-- if cargo_crate_dir == nil then +-- on_dir( +-- vim.fs.root(fname, { 'rust-project.json' }) +-- or vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]) +-- ) +-- return +-- end +-- +-- local cmd = { +-- 'cargo', +-- 'metadata', +-- '--no-deps', +-- '--format-version', +-- '1', +-- '--manifest-path', +-- cargo_crate_dir .. '/Cargo.toml', +-- } +-- +-- vim.system(cmd, { text = true }, function(output) +-- if output.code == 0 then +-- if output.stdout then +-- local result = vim.json.decode(output.stdout) +-- if result['workspace_root'] then +-- cargo_workspace_root = vim.fs.normalize(result['workspace_root']) +-- end +-- end +-- +-- on_dir(cargo_workspace_root or cargo_crate_dir) +-- else +-- vim.schedule(function() +-- vim.notify(('[rust_analyzer] cmd failed with code %d: %s\n%s'):format(output.code, cmd, output.stderr)) +-- end) +-- end +-- end) +-- end, +-- capabilities = { +-- experimental = { +-- serverStatusNotification = true, +-- commands = { +-- commands = { +-- 'rust-analyzer.showReferences', +-- 'rust-analyzer.runSingle', +-- 'rust-analyzer.debugSingle', +-- }, +-- }, +-- }, +-- }, +-- ---@type lspconfig.settings.rust_analyzer +-- settings = { +-- ['rust-analyzer'] = { +-- lens = { +-- debug = { enable = true }, +-- enable = true, +-- implementations = { enable = true }, +-- references = { +-- adt = { enable = true }, +-- enumVariant = { enable = true }, +-- method = { enable = true }, +-- trait = { enable = true }, +-- }, +-- run = { enable = true }, +-- updateTest = { enable = true }, +-- }, +-- }, +-- }, +-- before_init = function(init_params, config) +-- -- See https://github.com/rust-lang/rust-analyzer/blob/eb5da56d839ae0a9e9f50774fa3eb78eb0964550/docs/dev/lsp-extensions.md?plain=1#L26 +-- if config.settings and config.settings['rust-analyzer'] then +-- init_params.initializationOptions = config.settings['rust-analyzer'] +-- end +-- ---@param command table{ title: string, command: string, arguments: any[] } +-- vim.lsp.commands['rust-analyzer.runSingle'] = function(command) +-- local r = command.arguments[1] +-- local cmd = { 'cargo', unpack(r.args.cargoArgs) } +-- if r.args.executableArgs and #r.args.executableArgs > 0 then +-- vim.list_extend(cmd, { '--', unpack(r.args.executableArgs) }) +-- end +-- +-- local proc = vim.system(cmd, { cwd = r.args.cwd, env = r.args.environment }) +-- +-- local result = proc:wait() +-- +-- if result.code == 0 then +-- vim.notify(result.stdout, vim.log.levels.INFO) +-- else +-- vim.notify(result.stderr, vim.log.levels.ERROR) +-- end +-- end +-- end, +-- on_attach = function(_, bufnr) +-- vim.api.nvim_buf_create_user_command(bufnr, 'LspCargoReload', function() +-- reload_workspace(bufnr) +-- end, { desc = 'Reload current cargo workspace' }) +-- end, +-- } + return { + cmd = { 'rust-analyzer' }, + filetypes = { 'rust' }, settings = { ['rust_analyzer'] = { check = { diff --git a/nvim/after/lsp/shellcheck.lua b/nvim/after/lsp/shellcheck.lua new file mode 100644 index 0000000..31da212 --- /dev/null +++ b/nvim/after/lsp/shellcheck.lua @@ -0,0 +1,4 @@ +return { + cmd = { 'shellcheck' }, + filetypes = { 'zsh', 'bash', 'sh' }, +} diff --git a/nvim/after/lsp/yamlls.lua b/nvim/after/lsp/yamlls.lua index 12b77be..430f80b 100644 --- a/nvim/after/lsp/yamlls.lua +++ b/nvim/after/lsp/yamlls.lua @@ -1,3 +1,5 @@ +-- YAML LSP specific settings with a number of custom tags specifically for use with AWS CloudFormation templates + return { settings = { redhat = { telemetry = { enabled = false } }, diff --git a/nvim/lua/autocmds.lua b/nvim/lua/autocmds.lua index 2881519..d9b3e81 100644 --- a/nvim/lua/autocmds.lua +++ b/nvim/lua/autocmds.lua @@ -39,5 +39,4 @@ vim.api.nvim_create_autocmd({ 'BufWinEnter' }, { end end }) - -- End large file handling diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index 60b785c..4c1e891 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -1,7 +1,6 @@ -- Load the following plugins eagerly to prevent visual oddities require('plugins.gruvbox') -- Colorscheme setup require('plugins.lualine') -- Status line plugin --- require('statusline') -- vim.schedule defers plugin loading for after the main loop starts -- Startup is cleaner and faster than ever @@ -13,20 +12,16 @@ vim.schedule(function() require('plugins.luasnip') -- Snippet engine require('plugins.telescope') -- Floating window fuzzy searching different sources require('plugins.telekasten') -- Note taking plugin - require('plugins.mason') -- LSP and DAP manager require('plugins.render-markdown') -- Render markdown directly in neovim vim.pack.add({ - 'https://github.com/windwp/nvim-autopairs', -- Autocomplete symbol pairs when typing TODO: disabled for now, using snippets instead. remove if that feels better + 'https://github.com/windwp/nvim-autopairs', -- Autocomplete symbol pairs when typing 'https://github.com/tpope/vim-surround', -- Change surrounding characters (doesn't need setup called) 'https://github.com/tpope/vim-fugitive', -- _The_ Git integration plugin people have been using forever 'https://github.com/habamax/vim-godot' -- Godot specific bindings and debug }) - require('nvim-autopairs').setup() -- Automatic pair completion of paranteticals, braces, quotes, etc. - require('plugins.dap') -- DAP debugging plugin TODO: cleanup - require('plugins.dap-python') -- Debug plugin settings specifically for python TODO: cleanup - - -- Experimental - -- require('plugins.note_taking') -- In house note taking plugin (TODO: rename once the plugin name is solidified) + require('plugins.autopairs') -- Automatic pair completion of paranteticals, braces, quotes, etc. + require('plugins.dap') -- DAP debugging plugin TODO: cleanup + require('plugins.dap-python') -- Debug plugin settings specifically for python TODO: cleanup end) diff --git a/nvim/lua/plugins/autopairs.lua b/nvim/lua/plugins/autopairs.lua new file mode 100644 index 0000000..6b8bbf8 --- /dev/null +++ b/nvim/lua/plugins/autopairs.lua @@ -0,0 +1,3 @@ +vim.pack.add({'https://github.com/nvim-autopairs'}) + +require('nvim-autopairs').setup() diff --git a/nvim/lua/plugins/gitsigns.lua b/nvim/lua/plugins/gitsigns.lua index 8957fc2..508ed0a 100644 --- a/nvim/lua/plugins/gitsigns.lua +++ b/nvim/lua/plugins/gitsigns.lua @@ -31,19 +31,19 @@ require('gitsigns').setup { end) -- Actions - map('n', 'gs', gitsigns.stage_hunk) -- TODO: Overlaps with LSP keymappings + -- map('n', 'gs', gitsigns.stage_hunk) -- TODO: Overlaps with LSP keymappings map('n', 'gu', gitsigns.undo_stage_hunk) - map('n', 'gr', gitsigns.reset_hunk) -- TODO: Overlaps with LSP keymappings - map('v', 'gs', function() gitsigns.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end) -- TODO: Overlaps with LSP keymappings + -- map('n', 'gr', gitsigns.reset_hunk) -- TODO: Overlaps with LSP keymappings + -- map('v', 'gs', function() gitsigns.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end) -- TODO: Overlaps with LSP keymappings map('v', 'gu', function() gitsigns.undo_stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end) - map('v', 'gr', function() gitsigns.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end) -- TODO: Overlaps with LSP keymappings + -- map('v', 'gr', function() gitsigns.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end) -- TODO: Overlaps with LSP keymappings map('n', 'gS', gitsigns.stage_buffer) map('n', 'gR', gitsigns.reset_buffer) map('n', 'gp', gitsigns.preview_hunk) map('n', 'gb', function() gitsigns.blame_line { full = true } end) map('n', 'gtb', gitsigns.toggle_current_line_blame) - map('n', 'gd', gitsigns.diffthis) -- TODO: Overlaps with LSP keymappings - map('n', 'gD', function() gitsigns.diffthis('~') end) -- TODO: Overlaps with LSP keymappings + -- map('n', 'gd', gitsigns.diffthis) -- TODO: Overlaps with LSP keymappings + -- map('n', 'gD', function() gitsigns.diffthis('~') end) -- TODO: Overlaps with LSP keymappings map('n', 'gtd', gitsigns.toggle_deleted) -- Text object diff --git a/nvim/lua/plugins/language_support.lua b/nvim/lua/plugins/language_support.lua index 99f9c69..4b0b313 100644 --- a/nvim/lua/plugins/language_support.lua +++ b/nvim/lua/plugins/language_support.lua @@ -17,18 +17,18 @@ vim.diagnostic.config({ underline = true, virtual_text = { prefix = "●", - source = 'always', + source = true, }, severity_sort = true, float = { - source = 'always' + source = true } }) -- Install and enable the language server settings from nvim-lspconfig -vim.pack.add({ - 'https://github.com/neovim/nvim-lspconfig', -}) +-- vim.pack.add({ +-- 'https://github.com/neovim/nvim-lspconfig', +-- }) -- Auto set keymaps and other settings on LSP attach vim.api.nvim_create_autocmd('LspAttach', { @@ -37,29 +37,33 @@ vim.api.nvim_create_autocmd('LspAttach', { local bufnr = args.buf local bufopts = { noremap = true, silent = true, buffer = bufnr } + vim.keymap.set('i', '', vim.lsp.completion.get, bufopts) vim.keymap.set('n', '', function() vim.diagnostic.jump({ count = -1, float = true }) end, bufopts) vim.keymap.set('n', '', function() vim.diagnostic.jump({ count = 1, float = true }) end, bufopts) - vim.keymap.set('n', 'ga', vim.lsp.buf.code_action, bufopts) - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) - vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) - vim.keymap.set('n', 'gs', vim.lsp.buf.signature_help, bufopts) - vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, bufopts) vim.keymap.set('n', 'for', function() vim.lsp.buf.format { async = true } end, bufopts) vim.keymap.set('n', 'r', vim.lsp.buf.rename, bufopts) - vim.keymap.set('i', '', vim.lsp.completion.get, bufopts) + vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) + vim.keymap.set('n', 'ga', vim.lsp.buf.code_action, bufopts) + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) + vim.keymap.set('n', 'gs', vim.lsp.buf.signature_help, bufopts) end, }) -- Enable LSP engines local enabled_lsps = { 'clangd', + 'bashls', 'gdscript', 'jinja_lsp', + 'lua_ls', 'pylsp', 'r_language_server', + 'rust_analyzer', + 'yamlls', } for _, lsp in pairs(enabled_lsps) do diff --git a/nvim/lua/plugins/lualine.lua b/nvim/lua/plugins/lualine.lua index e50acc5..122f439 100644 --- a/nvim/lua/plugins/lualine.lua +++ b/nvim/lua/plugins/lualine.lua @@ -20,8 +20,15 @@ require('lualine').setup { } }, sections = { + lualine_c = { + 'filename', + 'lsp_status', + }, lualine_x = { - 'encoding', 'fileformat', 'filetype', get_schema + 'encoding', + 'fileformat', + 'filetype', + get_schema, }, } } diff --git a/nvim/lua/plugins/mason.lua b/nvim/lua/plugins/mason.lua index 9ad49c9..e7fdb24 100644 --- a/nvim/lua/plugins/mason.lua +++ b/nvim/lua/plugins/mason.lua @@ -1,21 +1,23 @@ -vim.pack.add({ - 'https://github.com/mason-org/mason.nvim', - 'https://github.com/mason-org/mason-lspconfig.nvim', -}) +-- vim.pack.add({ +-- 'https://github.com/mason-org/mason.nvim', +-- 'https://github.com/mason-org/mason-lspconfig.nvim', +-- }) -require('mason').setup() -require('mason-lspconfig').setup { - automatic_enable = true, - ensure_installed = { - 'ansiblels', -- Ansible - 'arduino_language_server', -- Arduino specific C - 'bashls', -- Bash - 'clangd', -- C/C++ - 'intelephense', -- PHP - 'lua_ls', -- Lua - 'marksman', -- markdown - 'pylsp', -- Python - 'rust_analyzer', -- Rust - 'yamlls', -- YAML - } -} +-- require('mason').setup() +-- require('mason-lspconfig').setup { +-- automatic_enable = true, +-- ensure_installed = { + -- 'ansiblels', -- Ansible + -- 'arduino_language_server', -- Arduino specific C + -- 'bashls', -- Bash + -- 'clangd', -- C/C++ + -- 'intelephense', -- PHP + -- 'jinja_lsp', -- Jinja2 + -- 'lua_ls', -- Lua + -- 'marksman', -- markdown + -- 'pylsp', -- Python + -- 'rust_analyzer', -- Rust + -- 'shellcheck', -- Bash + -- 'yamlls', -- YAML +-- } +-- } diff --git a/nvim/lua/plugins/nvim-cmp.lua b/nvim/lua/plugins/nvim-cmp.lua index d9bfbc3..11f863d 100644 --- a/nvim/lua/plugins/nvim-cmp.lua +++ b/nvim/lua/plugins/nvim-cmp.lua @@ -21,7 +21,7 @@ cmp.setup { [''] = cmp.mapping.select_prev_item(), [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), -- TODO: Overlaps with completion(? possibly doesn't due to state) + [''] = cmp.mapping.complete(), [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true, diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua index b4ab0ff..67e582c 100644 --- a/nvim/lua/plugins/telescope.lua +++ b/nvim/lua/plugins/telescope.lua @@ -20,7 +20,6 @@ require('telescope').setup { 'node_modules', }, layout_config = { prompt_position = 'bottom' }, - -- layout_strategy = 'vertical', mappings = { i = { [''] = require('telescope.actions').close, }, }, diff --git a/nvim/lua/settings.lua b/nvim/lua/settings.lua index 97b337d..a8ac5e1 100644 --- a/nvim/lua/settings.lua +++ b/nvim/lua/settings.lua @@ -19,11 +19,11 @@ vim.opt.mouse = 'a' -- Enable mouse vim.opt.number = true -- Show the line number in the gutter. vim.opt.pumheight = 15 -- Maximum height of the auto complete floating window vim.opt.relativenumber = true -- Show the relative line numbers -vim.opt.sidescrolloff = 8 -- Side scrolling leadoff to keep the cursor a few characters from the screen edge instead of going all the way to it vim.opt.shiftround = true -- Round indentation to shiftwidth vim.opt.shiftwidth = 4 -- Number of spaces a tab counts for when converting tabs to spaces vim.opt.shortmess = 'at' -- Abbreviations and truncation of cmd messages vim.opt.showmatch = true -- Show matching bracket +vim.opt.sidescrolloff = 8 -- Side scrolling leadoff to keep the cursor a few characters from the screen edge instead of going all the way to it vim.opt.signcolumn = 'yes' -- Always show the gutter vim.opt.smartcase = true -- Keeps searches Case-insensitive until the search has an upper case character vim.opt.smartindent = true -- Attempt to insert indentation to fit traditional languages. diff --git a/nvim/lua/statusline.lua b/nvim/lua/statusline.lua deleted file mode 100644 index d2b3333..0000000 --- a/nvim/lua/statusline.lua +++ /dev/null @@ -1,26 +0,0 @@ -local function lsp_status() - local attached_clients = vim.lsp.get_clients({ bufnr = 0 }) - if #attached_clients == 0 then - return '' - end - local names = vim.iter(attached_clients) - :map(function (client) - local name = client.name:gsub('language.server', 'ls') - return name - end) - :totable() - return '[' .. table.concat(names, ', ') .. ']' -end - -function _G.statusline() - return table.concat({ - '%f', - '%h%w%m%r', - '%=', - lsp_status(), - ' %-14(%l,%c%V%)', - '%P', - }, ' ') -end - -vim.o.statusline = '%{%v:lua._G.statusline()%}' diff --git a/tmux.conf b/tmux.conf index 33344be..af35cfb 100644 --- a/tmux.conf +++ b/tmux.conf @@ -19,15 +19,12 @@ setw -g mode-keys vi set -g focus-events on -# Window resizing on host shell size changes TODO: needs testing with pair coding +# Window resizing on host shell size changes set -g window-size latest setw -g aggressive-resize on -# set -g default-command 'reattach-to-user-namespace -l $SHELL' # TODO: Is this necessary for Mac still? - # Allow for external system clipboard set-option -g set-clipboard external -# set-option -g allow-passthrough on # Allow mouse interactions set -g mouse on diff --git a/zsh/zshrc b/zsh/zshrc index 2e87cca..3614be8 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -5,18 +5,18 @@ path=( /opt/homebrew/bin /opt/homebrew/sbin - $GOPATH/bin - $HOME/.cargo/bin - $HOME/.local/bin + "$GOPATH/bin" + "$HOME/.cargo/bin" + "$HOME/.local/bin" $path ) # De-dupe path entries typeset -U path -path=($^path(N-/)) +# path=($^path(N-/)) # Install oh-my-zsh if it doesn't exist -if [ ! -d $HOME/.oh-my-zsh/ ] +if [ ! -d "$HOME/.oh-my-zsh/" ] then sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" fi @@ -24,9 +24,9 @@ fi export ZSH="$HOME/.oh-my-zsh" # Install the zsh-autosuggestions plugin if it doesn't exist -if [ ! -d ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions ] +if [ ! -d "${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions" ] then - git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions + git clone https://github.com/zsh-users/zsh-autosuggestions "${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions" fi plugins=( @@ -38,10 +38,10 @@ plugins=( # Disable the startup update checks zstyle ':omz:update' mode disabled -ZSH_THEME="fb-custom" +export ZSH_THEME="fb-custom" # Hyphen insensitive completion, `-` and `_` are treated as interchangeable -HYPHEN_INSENSITIVE="true" +export HYPHEN_INSENSITIVE="true" # Vim mode setup set -o vi @@ -67,32 +67,29 @@ zstyle ':completion:*:warnings' format '%BNo matches for: %d%b' # Autoload keychain for ssh-agent handling if it is installed if command -v keychain &> /dev/null then - eval $(keychain --eval --quiet --nogui --noask) + eval "$(keychain --eval --quiet --nogui --noask)" fi -# TODO: Replace above with GPG agent -# GPG Agent handling of ssh key authorization and unlocks - # Inclusion of files to extend the configuration # From a theme to local specific changes, and grouping functions/aliases/exports include_files=( - "$HOME/.config/zsh/zsh_local.zsh" - "$HOME/.config/zsh/zsh_aliases.zsh" - "$HOME/.config/zsh/zsh_exports.zsh" - "$HOME/.config/zsh/zsh_functions.zsh" + ".config/zsh/zsh_local.zsh" + ".config/zsh/zsh_aliases.zsh" + ".config/zsh/zsh_exports.zsh" + ".config/zsh/zsh_functions.zsh" ) -for file in $include_files; do - if [ ! -f $file ] +for file in "${include_files[@]}"; do + if [ ! -f "$HOME/$file" ] then # Create files even if they aren't overriden in the environment - touch $file + touch "$HOME/$file" fi - source $file + source "$HOME/$file" done -source $ZSH/oh-my-zsh.sh +source "$ZSH/oh-my-zsh.sh" # Call to zprof for startup timings # zprof