Compare commits

17 Commits

Author SHA1 Message Date
7e7c0adfff feat: Adding nvim-lspconfig and Mason back in for now to get the config
working well for production work.
2026-09-01 09:29:47 -05:00
cad2a2f287 fix: Adding back the nvim-lspconfig plugin for now to resolve some LSP
loading issues and decrease the amount of work of lifting from the
remote repo to local.
2026-08-31 06:57:57 -05:00
a82bbcd531 feat: Changing the signature_help shortcut to ctrl+shift+k.
Changing double quotes to single quotes.
2026-08-30 17:35:49 -05:00
dd26af461d feat: Working on filling in the gaps of LSPs, this time with html
language support.
2026-08-30 08:52:28 -05:00
f9d056668d feat: Adding back in an rsync "move" that shows progress when moving
files and can work across remote systems if need be.
2026-08-30 08:51:12 -05:00
089ba53e8b feat: Adding LSP configs for ansiblels, arduino_language_server,
marksman. Adding documentation for LSP configs. Removing Mason config
and the reference to nvim-lspconfig.
2026-08-18 19:55:33 -05:00
76845fee2c fix: Adding in yamlls setup with the newer lspconfig arrangement 2026-08-17 10:02:56 -05:00
baa8f03870 fix: Updating the zshrc file to remove the explicit MacOS homebrew paths
from the shell path and relying upon local overrides for adding these
(prompted by additional needs on MacOS to override things like gnu-sed
and other binaries to use updated and standard binary calls)
2026-08-17 08:59:37 -05:00
c9b6dfea14 fix: Removing the extra settings that are already covered by
`share_history` and also may have been interferring with its operation
(per the notes in the man file calling out to disable the other settings)
2026-08-17 08:35:23 -05:00
a2b5bc9e0d fix: Updating with double quotations after determining the issue was
with the optional overwriting of the oh-my-zsh plugin install not
playing well. Removed the overwriting as it is not needed.
2026-08-17 06:05:40 -05:00
72a3d27d35 fix: The quotations suggested by shellcheck are causing issues with
substitutions and creating new incorrect directories. Removing for now.
2026-08-16 20:37:11 -05:00
86475a8e8e 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
2026-08-16 20:19:05 -05:00
5608ade094 Merge branch 'main' into development 2026-08-12 11:08:14 -05:00
Joshua Finch
779aba5270 Merge branch 'main' into development 2026-08-12 09:47:50 -05:00
377aaf83cf feat: Starting the cleanup on DAP plugins and adding a basic statusline
to futz around with potential replacement of more external plugins.
2026-06-07 14:21:19 -05:00
e6e0ca0cca Merge branch 'main' into development 2026-06-07 14:20:56 -05:00
9f5007cbc3 feat: Adding the new FaultyBranches created note_taking plugin that may
take over for telekasten
2026-06-04 18:31:02 -05:00
37 changed files with 582 additions and 221 deletions

2
.shellcheckrc Normal file
View File

@@ -0,0 +1,2 @@
external-sources=false
disable=SC1090

View File

@@ -48,6 +48,8 @@ The configs are an attempt at including some IDE functionalities
- Markdown in editor rendering - Markdown in editor rendering
- Telescope fuzzy search for files and file contents - Telescope fuzzy search for files and file contents
LSP configurations for additional servers can be created from the form of already configured ones or the original source of configurations can be used: https://github.com/neovim/nvim-lspconfig
### Tmux ### Tmux
_The_ terminal multiplexer for windowing and pane setups for long running shell sessions. _The_ terminal multiplexer for windowing and pane setups for long running shell sessions.

View File

@@ -26,8 +26,10 @@ declare -a config_directories=(
"$HOME/.config/zsh" "$HOME/.config/zsh"
) )
for dir in ${config_directories[@]}; do echo "----- Creating the install directories and linking config files..."
mkdir -p ${dir}
for dir in "${config_directories[@]}"; do
mkdir -p "${dir}"
done done
for dotfile in "${!configs[@]}"; do for dotfile in "${!configs[@]}"; do

30
lsp_check.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
GREEN='\033[0;32m'
RED='\033[0;31m'
CLEAR='\033[0m'
declare -A lsp_arr=(
["pylsp"]="pylsp provider: python-language-server or pylsp"
["pylint"]="pylint provider: pylint"
["rust-analyzer"]="rust-analyzer provider"
["yaml-language-server"]="yamlls provider: yaml-language-server (via npm globally or system package)"
["ansible-language-server"]="ansiblels provider: "
["jinja-lsp"]="jinja-lsp provider: cargo install jinja-lsp"
)
echo '----- Checking for LSP servers...'
for lsp in "${!lsp_arr[@]}"; do
echo
which $lsp >/dev/null 2>&1
if [[ $? -eq 1 ]]; then
echo "Checking for $lsp..."
echo -e "${RED} Install the ${lsp_arr[$lsp]} ${CLEAR}"
else
echo -e "Checking for $lsp...${GREEN} Found${CLEAR}"
fi
done
echo

View File

@@ -0,0 +1,25 @@
return {
cmd = { 'ansible-language-server', '--stdio' },
settings = {
ansible = {
python = {
interpreterPath = 'python',
},
ansible = {
path = 'ansible',
},
executionEnvironment = {
enabled = false,
},
validation = {
enabled = true,
lint = {
enabled = true,
path = 'ansible-lint',
},
},
},
},
filetypes = { 'yaml.ansible' },
root_markers = { 'ansible.cfg', '.ansible-lint' },
}

View File

@@ -0,0 +1,20 @@
-- local util = require 'lspconfig.util'
return {
filetypes = { 'arduino' },
root_dir = function(bufnr, on_dir)
local fname = vim.api.nvim_buf_get_name(bufnr)
-- on_dir(util.root_pattern('*.ino')(fname))
end,
cmd = {
'arduino-language-server',
},
capabilities = {
textDocument = {
semanticTokens = vim.NIL,
},
workspace = {
semanticTokens = vim.NIL,
},
},
}

View File

@@ -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 -- https://clangd.llvm.org/extensions.html#switch-between-sourceheader
local function switch_source_header(bufnr, client) local function switch_source_header(bufnr, client)
local method_name = 'textDocument/switchSourceHeader' local method_name = 'textDocument/switchSourceHeader'

View File

@@ -1,7 +1,7 @@
-- Handles setting up the connection to a locally running Godot instance for LSP responses
return { return {
cmd = vim.lsp.rpc.connect('127.0.0.1', 6005), cmd = vim.lsp.rpc.connect('127.0.0.1', 6005),
filetypes = { filetypes = { 'gdscript' },
'gd', 'gdscript', 'gdscript3'
},
root_markers = { 'project.godot', '.git' }, root_markers = { 'project.godot', '.git' },
} }

19
nvim/after/lsp/html.lua Normal file
View File

@@ -0,0 +1,19 @@
return {
cmd = function(dispatchers, _)
return vim.lsp.rpc.start({'vscode-html-language-server', '--stdio' }, dispatchers)
end,
filetypes = { 'html' },
init_options = {
provideFormatter = true,
configurationSection = { 'html', 'css', 'javascript' },
embeddedLanguages = {
css = true,
javascript = true
}
},
root_markers = { 'package.json', '.git' },
-- root_dir = function(fname)
-- return root_pattern(fname) or vim.loop.os_homedir()
-- end,
settings = {},
}

View File

@@ -1,15 +1,3 @@
vim.filetype.add {
extension = {
-- tera = 'jinja',
jinja = 'jinja',
jinja2 = 'jinja',
j2 = 'jinja',
}
}
return { return {
name = 'jinja_lsp', filetypes = { 'tera', 'jinja2' },
cmd = { 'jinja-lsp' },
filetypes = { 'jinja', 'tera', 'html' },
-- template_extension = { 'html', 'jinja', 'j2', 'tera' },
} }

View File

@@ -1,9 +1,47 @@
-- Lua LSP config handles the initialization of workspace folders to pull in library references for completion
return { 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 = { settings = {
Lua = { Lua = {
diagnostics = { codeLens = { enable = true },
globals = { 'vim' } hint = { enable = true, semicolon = 'Disable' },
} },
} },
}
} }

View File

@@ -1,3 +1,5 @@
return { return {
filetypes = { 'md', 'markdown', 'telekasten' } cmd = { 'marksman', 'server' },
filetypes = { 'markdown', 'markdown.mdx' },
root_markers = { '.marksman.toml', '.git' },
} }

View File

@@ -1,3 +1,5 @@
-- Python LSP disabling some linting that is not required to enforce
return { return {
cmd = { 'pylsp' }, cmd = { 'pylsp' },
filetypes = { 'python' }, filetypes = { 'python' },

View File

@@ -0,0 +1,8 @@
return {
cmd = { 'R', '--slave', '-e', 'languageserver::run()' },
filetypes = { 'r', 'rmd' },
log_level = 2,
root_dir = function(fname)
return util.find_git_ancestor(fname) or vim.loop.os_homedir()
end,
}

View File

@@ -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 { return {
cmd = { 'rust-analyzer' },
filetypes = { 'rust' },
settings = { settings = {
['rust_analyzer'] = { ['rust_analyzer'] = {
check = { check = {

View File

@@ -0,0 +1,4 @@
return {
cmd = { 'shellcheck' },
filetypes = { 'zsh', 'bash', 'sh' },
}

View File

@@ -1,31 +1,46 @@
-- YAML LSP specific settings with a number of custom tags specifically for use with AWS CloudFormation templates
return { return {
cmd = function (dispatchers, _)
return vim.lsp.rpc.start({'yaml-language-server', '--stdio'}, dispatchers)
end,
filetypes = { 'yaml', 'yaml.docker-compose', 'yaml.gitlab', 'yaml.helm-values' },
root_markers = { '.git' },
settings = { settings = {
redhat = { telemetry = { enabled = false } }, redhat = { telemetry = { enabled = false } },
yaml = { yaml = {
customTags = { customTags = {
"!fn", '!fn',
"!And", '!And',
"!If", '!If',
"!Not", '!Not',
"!Equals", '!Equals',
"!Or", '!Or',
"!FindInMap sequence", '!FindInMap sequence',
"!Base64", '!Base64',
"!Cidr", '!Cidr',
"!Ref", '!Ref',
"!Ref Scalar", '!Ref Scalar',
"!Sub", '!Sub',
"!GetAtt", '!GetAtt',
"!GetAZs", '!GetAZs',
"!ImportValue", '!ImportValue',
"!Select", '!Select',
"!Split", '!Split',
"!Join sequence" '!Join sequence'
}, },
format = { enable = true, singleQuote = true }, format = { enable = true, singleQuote = true },
hover = true, hover = true,
schemaStore = { enable = true }, schemaStore = { enable = true },
validate = true, validate = true,
} }
} },
on_init = function(client)
-- From nvim-lspconfig's yamlls.lua
--- https://github.com/neovim/nvim-lspconfig/pull/4016
--- Since formatting is disabled by default if you check `client:supports_method('textDocument/formatting')`
--- during `LspAttach` it will return `false`. This hack sets the capability to `true` to facilitate
--- autocmd's which check this capability
client.server_capabilities.documentFormattingProvider = true
end,
} }

View File

@@ -39,5 +39,4 @@ vim.api.nvim_create_autocmd({ 'BufWinEnter' }, {
end end
end end
}) })
-- End large file handling -- End large file handling

View File

@@ -12,17 +12,16 @@ vim.schedule(function()
require('plugins.luasnip') -- Snippet engine require('plugins.luasnip') -- Snippet engine
require('plugins.telescope') -- Floating window fuzzy searching different sources require('plugins.telescope') -- Floating window fuzzy searching different sources
require('plugins.telekasten') -- Note taking plugin require('plugins.telekasten') -- Note taking plugin
require('plugins.mason') -- LSP and DAP manager
require('plugins.render-markdown') -- Render markdown directly in neovim require('plugins.render-markdown') -- Render markdown directly in neovim
vim.pack.add({ 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-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/tpope/vim-fugitive', -- _The_ Git integration plugin people have been using forever
'https://github.com/habamax/vim-godot' -- Godot specific bindings and debug '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.autopairs') -- Automatic pair completion of paranteticals, braces, quotes, etc.
require('plugins.dap') -- DAP debugging plugin require('plugins.dap') -- DAP debugging plugin TODO: cleanup
require('plugins.dap-python') -- Debug plugin settings specifically for python require('plugins.dap-python') -- Debug plugin settings specifically for python TODO: cleanup
end) end)

View File

@@ -0,0 +1,3 @@
vim.pack.add({'https://github.com/nvim-autopairs'})
require('nvim-autopairs').setup()

View File

@@ -5,6 +5,8 @@ vim.pack.add({
'https://github.com/theHamsta/nvim-dap-virtual-text', 'https://github.com/theHamsta/nvim-dap-virtual-text',
}) })
-- TODO: Needs a pass to remove hardcoding, potentially cut out mason completely and general cleanup
require('dapui').setup({ require('dapui').setup({
mappings = { mappings = {
open = 'o', open = 'o',
@@ -49,64 +51,64 @@ require('dapui').setup({
}) })
require('nvim-dap-virtual-text').setup() require('nvim-dap-virtual-text').setup()
-- local mason_dap = require('mason-nvim-dap') -- local mason_dap = require('mason-nvim-dap')
local dap, dapui = require('dap'), require('dapui') local dap, dapui = require('dap'), require('dapui')
-- mason_dap.setup({ -- mason_dap.setup({
-- ensure_installed = { -- ensure_installed = {
-- 'codelldb', -- 'codelldb',
-- 'debugpy', -- 'debugpy',
-- }, -- },
-- automatic_installation = true, -- automatic_installation = true,
-- handlers = { -- handlers = {
-- function(config) -- function(config)
-- require('mason-nvim-dap').default_setup(config) -- require('mason-nvim-dap').default_setup(config)
-- end, -- end,
-- } -- }
-- }) -- })
dap.listeners.before.attach.dapui_config = function() dap.listeners.before.attach.dapui_config = function()
dapui.open() dapui.open()
end end
dap.listeners.before.launch.dapui_config = function() dap.listeners.before.launch.dapui_config = function()
dapui.open() dapui.open()
end end
dap.listeners.before.event_terminated.dapui_config = function() dap.listeners.before.event_terminated.dapui_config = function()
dapui.close() dapui.close()
end end
dap.listeners.before.event_exited.dapui_config = function() dap.listeners.before.event_exited.dapui_config = function()
dapui.close() dapui.close()
end end
-- vim.fn.sign_define('DapBreakpoint', { text = 'ᛒ', texthl = '', lineh = '', numhl = '' }) -- vim.fn.sign_define('DapBreakpoint', { text = 'ᛒ', texthl = '', lineh = '', numhl = '' })
vim.fn.sign_define('DapBreakpoint', { text = '🟥', texthl = '', lineh = '', numhl = '' }) vim.fn.sign_define('DapBreakpoint', { text = '🟥', texthl = '', lineh = '', numhl = '' })
vim.fn.sign_define('DapBreakpointCondition', { text = '🝌', texthl = '', lineh = '', numhl = '' }) vim.fn.sign_define('DapBreakpointCondition', { text = '🝌', texthl = '', lineh = '', numhl = '' })
vim.fn.sign_define('DapStopped', { text = '▶️' }) vim.fn.sign_define('DapStopped', { text = '▶️' })
dap.adapters.gdb = { dap.adapters.gdb = {
type = 'executable', type = 'executable',
command = 'gdb', command = 'gdb',
args = { '-i', 'dap' }, args = { '-i', 'dap' },
} }
dap.adapters.lldb = { dap.adapters.lldb = {
command = 'lldb', command = 'lldb',
type = 'executable', type = 'executable',
} }
dap.adapters.debugpy = { dap.adapters.debugpy = {
command = 'debugpy', command = 'debugpy',
type = 'executable', type = 'executable',
} }
dap.configurations = { dap.configurations = {
rust = { rust = {
{ {
type = 'lldb', type = 'lldb',
name = 'Debug', name = 'Debug',
request = 'launch', request = 'launch',
program = function() program = function()
return vim.fn.getcwd() .. '/target/debug/faultybranches' return vim.fn.getcwd() .. '/target/debug/faultybranches' -- TODO: remove the testing hardcoded path
end, end,
stopAtBeginningOfMainSubprogram = true, stopAtBeginningOfMainSubprogram = true,
}, },
@@ -126,13 +128,13 @@ require('nvim-dap-virtual-text').setup()
end end
} }
} }
} }
vim.keymap.set('n', '<leader>b', function () vim.keymap.set('n', '<leader>b', function()
require('dap').toggle_breakpoint() require('dap').toggle_breakpoint()
end) end)
vim.keymap.set('n', '<leader>B', function() require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: ')) end) vim.keymap.set('n', '<leader>B', function() require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: ')) end)
vim.keymap.set({'n', 'v'}, '<leader>dh', function() require('dap.ui.widgets').hover() end) vim.keymap.set({ 'n', 'v' }, '<leader>dh', function() require('dap.ui.widgets').hover() end)
vim.keymap.set('n', '<F5>', function() require('dap').continue() end) vim.keymap.set('n', '<F5>', function() require('dap').continue() end)
vim.keymap.set('n', '<F6>', function() require('dap').run_to_cursor() end) vim.keymap.set('n', '<F6>', function() require('dap').run_to_cursor() end)
vim.keymap.set('n', '<F8>', function() require('dap').terminate() end) vim.keymap.set('n', '<F8>', function() require('dap').terminate() end)

View File

@@ -31,19 +31,19 @@ require('gitsigns').setup {
end) end)
-- Actions -- Actions
map('n', '<leader>gs', gitsigns.stage_hunk) -- TODO: Overlaps with LSP keymappings -- map('n', '<leader>gs', gitsigns.stage_hunk) -- TODO: Overlaps with LSP keymappings
map('n', '<leader>gu', gitsigns.undo_stage_hunk) map('n', '<leader>gu', gitsigns.undo_stage_hunk)
map('n', '<leader>gr', gitsigns.reset_hunk) -- TODO: Overlaps with LSP keymappings -- map('n', '<leader>gr', gitsigns.reset_hunk) -- TODO: Overlaps with LSP keymappings
map('v', '<leader>gs', function() gitsigns.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end) -- TODO: Overlaps with LSP keymappings -- map('v', '<leader>gs', function() gitsigns.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end) -- TODO: Overlaps with LSP keymappings
map('v', '<leader>gu', function() gitsigns.undo_stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end) map('v', '<leader>gu', function() gitsigns.undo_stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end)
map('v', '<leader>gr', function() gitsigns.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end) -- TODO: Overlaps with LSP keymappings -- map('v', '<leader>gr', function() gitsigns.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end) -- TODO: Overlaps with LSP keymappings
map('n', '<leader>gS', gitsigns.stage_buffer) map('n', '<leader>gS', gitsigns.stage_buffer)
map('n', '<leader>gR', gitsigns.reset_buffer) map('n', '<leader>gR', gitsigns.reset_buffer)
map('n', '<leader>gp', gitsigns.preview_hunk) map('n', '<leader>gp', gitsigns.preview_hunk)
map('n', '<leader>gb', function() gitsigns.blame_line { full = true } end) map('n', '<leader>gb', function() gitsigns.blame_line { full = true } end)
map('n', '<leader>gtb', gitsigns.toggle_current_line_blame) map('n', '<leader>gtb', gitsigns.toggle_current_line_blame)
map('n', '<leader>gd', gitsigns.diffthis) -- TODO: Overlaps with LSP keymappings -- map('n', '<leader>gd', gitsigns.diffthis) -- TODO: Overlaps with LSP keymappings
map('n', '<leader>gD', function() gitsigns.diffthis('~') end) -- TODO: Overlaps with LSP keymappings -- map('n', '<leader>gD', function() gitsigns.diffthis('~') end) -- TODO: Overlaps with LSP keymappings
map('n', '<leader>gtd', gitsigns.toggle_deleted) map('n', '<leader>gtd', gitsigns.toggle_deleted)
-- Text object -- Text object

View File

@@ -1,5 +1,5 @@
-- Treesitter -- Treesitter
local rocks_path = os.getenv('HOME') .. "/.luarocks/lib/luarocks/rocks-5.1" local rocks_path = os.getenv('HOME') .. '/.luarocks/lib/luarocks/rocks-5.1'
-- Pick up the installed parsers in the install dir -- Pick up the installed parsers in the install dir
for _, parser_dir in ipairs(vim.fn.glob(rocks_path .. '/tree-sitter-*/*/', true, true)) do for _, parser_dir in ipairs(vim.fn.glob(rocks_path .. '/tree-sitter-*/*/', true, true)) do
@@ -7,7 +7,7 @@ for _, parser_dir in ipairs(vim.fn.glob(rocks_path .. '/tree-sitter-*/*/', true,
end end
-- Start treesitter parsing on the current buffer -- Start treesitter parsing on the current buffer
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd('FileType', {
callback = function(ev) callback = function(ev)
pcall(vim.treesitter.start, ev.buf) pcall(vim.treesitter.start, ev.buf)
end end
@@ -16,20 +16,15 @@ vim.api.nvim_create_autocmd("FileType", {
vim.diagnostic.config({ vim.diagnostic.config({
underline = true, underline = true,
virtual_text = { virtual_text = {
prefix = "", prefix = '',
source = 'always', source = true,
}, },
severity_sort = true, severity_sort = true,
float = { float = {
source = 'always' source = true
} }
}) })
-- Install and enable the language server settings from nvim-lspconfig
vim.pack.add({
'https://github.com/neovim/nvim-lspconfig',
})
-- Auto set keymaps and other settings on LSP attach -- Auto set keymaps and other settings on LSP attach
vim.api.nvim_create_autocmd('LspAttach', { vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('my.lsp', {}), group = vim.api.nvim_create_augroup('my.lsp', {}),
@@ -37,29 +32,76 @@ vim.api.nvim_create_autocmd('LspAttach', {
local bufnr = args.buf local bufnr = args.buf
local bufopts = { noremap = true, silent = true, buffer = bufnr } local bufopts = { noremap = true, silent = true, buffer = bufnr }
vim.keymap.set('n', '<C-[>', function() vim.diagnostic.jump({ count = -1, float = true }) end, bufopts) vim.keymap.set('i', '<c-space>', vim.lsp.completion.get, bufopts)
vim.keymap.set('n', '<C-]>', function() vim.diagnostic.jump({ count = 1, float = true }) end, bufopts) vim.keymap.set('n', '<c-[>', 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', '<c-]>', function() vim.diagnostic.jump({ count = 1, float = true }) end, 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', '<leader>D', vim.lsp.buf.type_definition, bufopts) vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts)
vim.keymap.set('n', '<leader>for', function() vim.lsp.buf.format { async = true } end, bufopts) vim.keymap.set('n', '<leader>for', function() vim.lsp.buf.format { async = true } end, bufopts)
vim.keymap.set('n', '<leader>r', vim.lsp.buf.rename, bufopts) vim.keymap.set('n', '<leader>re', vim.lsp.buf.rename, bufopts)
vim.keymap.set('i', '<c-space>', 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', '<c-s-K>', vim.lsp.buf.signature_help, bufopts)
end, end,
}) })
vim.pack.add({
'https://github.com/neovim/nvim-lspconfig',
'https://github.com/mason-org/mason-lspconfig.nvim',
'https://github.com/mason-org/mason.nvim',
})
require('mason').setup()
require('mason-lspconfig').setup {
automatic_enable = true,
ensure_installed = {
-- 'ansible-lint',
'ansiblels',
'arduino_language_server',
'bashls',
-- 'cfn-lint',
'clangd',
'html',
-- 'htmlhint',
'intelephense',
'jinja_lsp',
'lua_ls',
'marksman',
'pylsp',
'r_language_server',
'rust_analyzer',
-- 'shellcheck',
'yamlls',
}
}
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
vim.lsp.config('*', {
capabilities = capabilities,
})
-- Enable LSP engines -- Enable LSP engines
local enabled_lsps = { local enabled_lsps = {
'ansiblels',
'arduino_language_server',
'clangd', 'clangd',
'gdscript', 'bashls',
'gdscript', -- Local only config
'html',
'intelephense',
'jinja_lsp', 'jinja_lsp',
'lua_ls',
'marksman',
'pylsp', 'pylsp',
'r_language_server', 'r_language_server',
'rust_analyzer',
'yamlls',
} }
for _, lsp in pairs(enabled_lsps) do for _, lsp in pairs(enabled_lsps) do

View File

@@ -20,8 +20,15 @@ require('lualine').setup {
} }
}, },
sections = { sections = {
lualine_c = {
'filename',
'lsp_status',
},
lualine_x = { lualine_x = {
'encoding', 'fileformat', 'filetype', get_schema 'encoding',
'fileformat',
'filetype',
get_schema,
}, },
} }
} }

View File

@@ -40,7 +40,7 @@ require('luasnip').setup {
} }
require('luasnip.loaders.from_vscode').lazy_load() require('luasnip.loaders.from_vscode').lazy_load()
require('luasnip.loaders.from_lua').lazy_load({ paths = "./snippets" }) require('luasnip.loaders.from_lua').lazy_load({ paths = './snippets' })
-- TODO: Figure out keymappings that make sense -- TODO: Figure out keymappings that make sense
vim.keymap.set({ 'i' }, '<C-K>', function() require('luasnip').expand() end, { silent = true }) vim.keymap.set({ 'i' }, '<C-K>', function() require('luasnip').expand() end, { silent = true })

View File

@@ -1,21 +0,0 @@
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
}
}

View File

@@ -0,0 +1,6 @@
vim.pack.add({
-- 'https://git.faultybranches.dev/FaultyBranches_Public/faultynotes.git'
'~/repos/code/faultynotes'
})
require('faultynotes').setup()

View File

@@ -21,7 +21,7 @@ cmp.setup {
['<C-p>'] = cmp.mapping.select_prev_item(), ['<C-p>'] = cmp.mapping.select_prev_item(),
['<C-j>'] = cmp.mapping.scroll_docs(-4), ['<C-j>'] = cmp.mapping.scroll_docs(-4),
['<C-k>'] = cmp.mapping.scroll_docs(4), ['<C-k>'] = cmp.mapping.scroll_docs(4),
['<C-space>'] = cmp.mapping.complete(), -- TODO: Overlaps with completion(? possibly doesn't due to state) ['<C-space>'] = cmp.mapping.complete(),
['<C-y>'] = cmp.mapping.confirm({ ['<C-y>'] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Insert, behavior = cmp.ConfirmBehavior.Insert,
select = true, select = true,

View File

@@ -20,7 +20,6 @@ require('telescope').setup {
'node_modules', 'node_modules',
}, },
layout_config = { prompt_position = 'bottom' }, layout_config = { prompt_position = 'bottom' },
-- layout_strategy = 'vertical',
mappings = { mappings = {
i = { ['<ESC>'] = require('telescope.actions').close, }, i = { ['<ESC>'] = require('telescope.actions').close, },
}, },

View File

@@ -10,10 +10,10 @@ require('twilight').setup({
context = 6, context = 6,
treesitter = true, treesitter = true,
expand = { expand = {
"function", 'function',
"method", 'method',
"table", 'table',
"if_statement", 'if_statement',
} }
}) })

View File

@@ -1,5 +1,5 @@
vim.opt.background = 'dark' -- Force a dark background for the colorscheme vim.opt.background = 'dark' -- Force a dark background for the colorscheme
vim.opt.clipboard = 'unnamed,unnamedplus' -- Use both the "*" and "+" registers for yanks and deletes (puts things in the system clipboard) vim.opt.clipboard = 'unnamed,unnamedplus' -- Use both the '*' and '+' registers for yanks and deletes (puts things in the system clipboard)
vim.opt.completeopt = 'fuzzy,menuone,noinsert,popup' -- Change how the completion menu is interacted with and displays vim.opt.completeopt = 'fuzzy,menuone,noinsert,popup' -- Change how the completion menu is interacted with and displays
vim.opt.cursorcolumn = true -- Highlight the column the cursor is on vim.opt.cursorcolumn = true -- Highlight the column the cursor is on
vim.opt.cursorline = true -- Highlight the line the cursor is on. vim.opt.cursorline = true -- Highlight the line the cursor is on.
@@ -19,11 +19,11 @@ vim.opt.mouse = 'a' -- Enable mouse
vim.opt.number = true -- Show the line number in the gutter. 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.pumheight = 15 -- Maximum height of the auto complete floating window
vim.opt.relativenumber = true -- Show the relative line numbers 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.shiftround = true -- Round indentation to shiftwidth
vim.opt.shiftwidth = 4 -- Number of spaces a tab counts for when converting tabs to spaces 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.shortmess = 'at' -- Abbreviations and truncation of cmd messages
vim.opt.showmatch = true -- Show matching bracket 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.signcolumn = 'yes' -- Always show the gutter
vim.opt.smartcase = true -- Keeps searches Case-insensitive until the search has an upper case character 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. vim.opt.smartindent = true -- Attempt to insert indentation to fit traditional languages.

View File

@@ -3,6 +3,6 @@
require('vim._core.ui2').enable { require('vim._core.ui2').enable {
enable = true, enable = true,
msg = { msg = {
targets = "msg", -- Displays in a floating text format targets = 'msg', -- Displays in a floating text format
} }
} }

View File

@@ -14,8 +14,8 @@
-- return s({ trig = pair_begin, wordTrig = false }, { -- return s({ trig = pair_begin, wordTrig = false }, {
-- t({ pair_begin }), -- t({ pair_begin }),
-- c(1, { -- c(1, {
-- r(1, "content", i(1)), -- r(1, 'content', i(1)),
-- sn(nil, { t({"", "\t"}), r(1, "content", i(1)), t({ "", "" }) }), -- sn(nil, { t({ '', '\t' }), r(1, 'content', i(1)), t({ '', '' }) }),
-- }), -- }),
-- t({ pair_end }), -- t({ pair_end }),
-- }) -- })

View File

@@ -19,15 +19,12 @@ setw -g mode-keys vi
set -g focus-events on 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 set -g window-size latest
setw -g aggressive-resize on 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 # Allow for external system clipboard
set-option -g set-clipboard external set-option -g set-clipboard external
# set-option -g allow-passthrough on
# Allow mouse interactions # Allow mouse interactions
set -g mouse on set -g mouse on

View File

@@ -6,6 +6,7 @@ alias du="du -h -d 1" # Always use human readable format and only for the curren
alias k="killall" # Quick killall alias k="killall" # Quick killall
alias p="ps ux | grep $1" # Quick process search alias p="ps ux | grep $1" # Quick process search
alias n="$EDITOR" # Just open the usual editor alias n="$EDITOR" # Just open the usual editor
alias mvr="rsync -aP --remove-source-files"
# Switch directories # Switch directories
alias repos="cd ~/repos/" alias repos="cd ~/repos/"

View File

@@ -1,8 +1,7 @@
### Custom functions ### Custom functions
# Timing function for checking zsh load speed # Timing function for checking zsh load speed
function timezsh() { function timezsh() {
shell=$SHELL for _ in $(seq 1 10)
for i in $(seq 1 10)
do do
ts=$(date +%s%N) ts=$(date +%s%N)
$SHELL -i -c exit $SHELL -i -c exit
@@ -18,5 +17,5 @@ function timezsh() {
# } # }
function path() { function path() {
echo -e ${PATH//:/\\n} echo -e "${PATH//:/\\n}"
} }

View File

@@ -3,20 +3,17 @@
# zmodload zsh/zprof # zmodload zsh/zprof
path=( path=(
/opt/homebrew/bin "$GOPATH/bin"
/opt/homebrew/sbin "$HOME/.cargo/bin"
$GOPATH/bin "$HOME/.local/bin"
$HOME/.cargo/bin
$HOME/.local/bin
$path $path
) )
# De-dupe path entries # De-dupe path entries
typeset -U path typeset -U path
path=($^path(N-/))
# Install oh-my-zsh if it doesn't exist # Install oh-my-zsh if it doesn't exist
if [ ! -d $HOME/.oh-my-zsh/ ] if [ ! -d "$HOME/.oh-my-zsh/" ]
then then
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
fi fi
@@ -24,9 +21,9 @@ fi
export ZSH="$HOME/.oh-my-zsh" export ZSH="$HOME/.oh-my-zsh"
# Install the zsh-autosuggestions plugin if it doesn't exist # Install the zsh-autosuggestions plugin if it doesn't exist
if [ ! -d ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions ] if [ ! -d "$HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions" ]
then 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 "$HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions"
fi fi
plugins=( plugins=(
@@ -38,10 +35,10 @@ plugins=(
# Disable the startup update checks # Disable the startup update checks
zstyle ':omz:update' mode disabled zstyle ':omz:update' mode disabled
ZSH_THEME="fb-custom" export ZSH_THEME="fb-custom"
# Hyphen insensitive completion, `-` and `_` are treated as interchangeable # Hyphen insensitive completion, `-` and `_` are treated as interchangeable
HYPHEN_INSENSITIVE="true" export HYPHEN_INSENSITIVE="true"
# Vim mode setup # Vim mode setup
set -o vi set -o vi
@@ -50,12 +47,11 @@ set -o vi
setopt no_clobber # Do not clobber files by default setopt no_clobber # Do not clobber files by default
setopt hist_ignore_all_dups # Replace old history with the newest call to an identical call setopt hist_ignore_all_dups # Replace old history with the newest call to an identical call
setopt hist_ignore_space # Remove history lines that start with spaces setopt hist_ignore_space # Remove history lines that start with spaces
setopt share_history # Share history between zsh instances without needing explicit sharing setopt share_history # Share history between zsh instances smoothly
setopt auto_param_slash # Auto append a slash instead of a space if the completion is a dir setopt auto_param_slash # Auto append a slash instead of a space if the completion is a dir
setopt extended_glob null_glob # Use Bash-like globbing setopt extended_glob null_glob # Use Bash-like globbing
# Experimental # Experimental
setopt append_history inc_append_history
setopt no_case_glob no_case_match setopt no_case_glob no_case_match
# Completion options # Completion options
@@ -67,32 +63,29 @@ zstyle ':completion:*:warnings' format '%BNo matches for: %d%b'
# Autoload keychain for ssh-agent handling if it is installed # Autoload keychain for ssh-agent handling if it is installed
if command -v keychain &> /dev/null if command -v keychain &> /dev/null
then then
eval $(keychain --eval --quiet --nogui --noask) eval "$(keychain --eval --quiet --nogui --noask)"
fi fi
# TODO: Replace above with GPG agent
# GPG Agent handling of ssh key authorization and unlocks
# Inclusion of files to extend the configuration # Inclusion of files to extend the configuration
# From a theme to local specific changes, and grouping functions/aliases/exports # From a theme to local specific changes, and grouping functions/aliases/exports
include_files=( include_files=(
"$HOME/.config/zsh/zsh_local.zsh" ".config/zsh/zsh_local.zsh"
"$HOME/.config/zsh/zsh_aliases.zsh" ".config/zsh/zsh_aliases.zsh"
"$HOME/.config/zsh/zsh_exports.zsh" ".config/zsh/zsh_exports.zsh"
"$HOME/.config/zsh/zsh_functions.zsh" ".config/zsh/zsh_functions.zsh"
) )
for file in $include_files; do for file in "${include_files[@]}"; do
if [ ! -f $file ] full_path="$HOME/$file"
then
# Create files even if they aren't overriden in the environment if [ ! -f "$full_path" ]; then
touch $file touch "$full_path"
fi fi
source $file source "$full_path"
done done
source $ZSH/oh-my-zsh.sh source "$ZSH/oh-my-zsh.sh"
# Call to zprof for startup timings # Call to zprof for startup timings
# zprof # zprof