Updates to fish config, neovim config, vim config, and git config

Fish:
- Call ssh_agent_startup everytime (has its own conditions)
- Add Bun and pnpm bin folders to PATH and aliases
- Change additions to path to use fish_add_path
- Set LIBVA_DRIVER_NAME to nvidia

Neovim:
- Format init.lua
- Add Vue language server
- Change Noice config

Vim:
- Remove eslint and stylelint as fixers
- Add Vue linting/fixing
- Use wombat theme for lightline (gruvbox gone?)
- Add Lua & Markdown formatting
- Update vim-plug

Git:
- Remove --date-order from 'git lola' alias
This commit is contained in:
mitchell 2024-06-28 18:41:12 -04:00
parent 124ea84991
commit 3ad5bd6d2f
8 changed files with 246 additions and 191 deletions

View file

@ -10,10 +10,7 @@ function configure_fish
define_global_variables
import_sources $uname
define_aliases $uname
if status is-login; and not set -qx SSH_CONNECTION
ssh_agent_startup
end
ssh_agent_startup
end
configure_fish

View file

@ -11,6 +11,8 @@ function define_aliases -a uname -d 'Defines aliases for commonly used commands'
alias age-d 'age --decrypt --identity ~/.secrets/id_ed25519'
alias age-e 'age --armor --recipient (cat ~/.secrets/id_ed25519.pub)'
alias age-k 'age --decrypt --identity ~/.secrets/id_ed25519 ~/.secrets/age_keys.age'
alias bb 'bun --bun'
alias pn 'pnpm'
switch "$uname"
case 'Linux'

View file

@ -14,17 +14,25 @@ function define_global_variables -d 'Defines all and exclusively globally export
set -gx GOPATH $HOME/code/go
set -gx GOBIN $GOPATH/bin
set -gx BUN_INSTALL $HOME/.bun
set -gx LIBVIRT_DEFAULT_URI 'qemu:///system'
set -gx ANDROID_HOME $HOME/Android/Sdk
set -gx PATH $PATH $GOBIN \
set -gx LIBVA_DRIVER_NAME nvidia
set -gx PNPM_HOME $HOME/.local/share/pnpm
fish_add_path $GOBIN \
$HOME/.local/bin \
$HOME/.pub-cache/bin \
$HOME/code/scripts \
$HOME/code/flutter/bin \
$HOME/.cargo/bin \
$HOME/.dotnet/tools \
$BUN_INSTALL/bin \
$PNPM_HOME \
$ANDROID_HOME/emulator \
$ANDROID_HOME/platform-tools \
$ANDROID_HOME/build-tools/31.0.0 \

View file

@ -1,5 +1,5 @@
function ssh_agent_startup -d 'Start ssh agent and set env vars'
if test -z "$SSH_AUTH_SOCK"; or test -z "$SSH_AGENT_PID"
if test -z "$SSH_AUTH_SOCK"; and test -z "$SSH_AGENT_PID"
eval (ssh-agent -c) >/dev/null 2>&1
end
end

View file

@ -9,122 +9,148 @@ vim.opt.guifont = { "JetBrainsMono Nerd Font", "h13" }
vim.keymap.set("t", "<Esc>", "<C-\\><C-n>")
vim.api.nvim_create_autocmd("TermOpen", {
pattern = "*",
command = "set nonumber",
pattern = "*",
command = "set nonumber",
})
require('twilight').setup()
require('zen-mode').setup({
window = {
backdrop = 1,
}
require("twilight").setup()
require("zen-mode").setup({
window = {
backdrop = 1,
},
})
require('symbols-outline').setup({
autofold_depth = 2,
require("symbols-outline").setup({
autofold_depth = 2,
})
require('leap').add_default_mappings()
require("leap").add_default_mappings()
require('noice').setup({
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
popupmenu = {
enabled = false,
},
presets = {
long_message_to_split = true, -- long messages will be sent to a split
},
require("noice").setup({
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
},
views = {
notify = {
replace = true,
merge = true,
},
},
})
require('treesitter-context').setup()
require('nvim-treesitter.configs').setup({
-- A list of parser names, or "all" (the four listed parsers should always be installed)
ensure_installed = {
"c",
"lua",
"vim",
"help",
"fish",
"typescript",
"javascript",
"go",
"elixir",
},
require("treesitter-context").setup()
require("nvim-treesitter.configs").setup({
-- A list of parser names, or "all" (the four listed parsers should always be installed)
ensure_installed = {
"c",
"lua",
"vim",
"help",
"fish",
"typescript",
"javascript",
"go",
"elixir",
"vue",
"regex",
},
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = false,
highlight = {
enable = true,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
highlight = {
enable = true,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn", -- set to `false` to disable one of the mappings
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
},
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn", -- set to `false` to disable one of the mappings
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
},
},
indent = {
enable = true
}
indent = {
enable = true,
},
})
-- LSP Mappings.
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
local opts = { noremap=true, silent=true }
vim.keymap.set('n', '<leader>d', vim.diagnostic.open_float, opts)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
local opts = { noremap = true, silent = true }
vim.keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts)
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist, opts)
-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
-- Enable completion triggered by <c-x><c-o>
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
-- Enable completion triggered by <c-x><c-o>
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
-- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local bufopts = { noremap=true, silent=true, buffer=bufnr }
vim.keymap.set('n', '<leader>h', vim.lsp.buf.hover, bufopts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, bufopts)
vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
vim.keymap.set('n', '<leader>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, bufopts)
vim.keymap.set('n', '<leader>m', vim.lsp.buf.code_action, bufopts)
vim.keymap.set('n', '<leader>r', vim.lsp.buf.rename, bufopts)
vim.keymap.set('n', '<leader>F', function() vim.lsp.buf.format { async = true } end, bufopts)
-- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local bufopts = { noremap = true, silent = true, buffer = bufnr }
vim.keymap.set("n", "<leader>h", vim.lsp.buf.hover, bufopts)
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, bufopts)
vim.keymap.set("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, bufopts)
vim.keymap.set("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, bufopts)
vim.keymap.set("n", "<leader>wl", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, bufopts)
vim.keymap.set("n", "<leader>m", vim.lsp.buf.code_action, bufopts)
vim.keymap.set("n", "<leader>r", vim.lsp.buf.rename, bufopts)
vim.keymap.set("n", "<leader>F", function()
vim.lsp.buf.format({ async = true })
end, bufopts)
end
local lspconfig = require "lspconfig"
local coq = require "coq"
local lspconfig = require("lspconfig")
local coq = require("coq")
local lsp_flags = {
-- This is the default in Nvim 0.7+
debounce_text_changes = 150,
-- This is the default in Nvim 0.7+
debounce_text_changes = 150,
}
local servers = { 'tsserver', 'elixirls', 'gopls' }
local vue_plugin_location = vim.fn.expand("$HOME/.bun/install/global/node_modules/@vue/language-server")
lspconfig.tsserver.setup(coq.lsp_ensure_capabilities({
on_attach = on_attach,
flags = lsp_flags,
init_options = {
plugins = {
{
name = "@vue/typescript-plugin",
location = vue_plugin_location,
languages = { "vue" },
},
},
},
filetypes = { "typescript", "javascript", "javascriptreact", "typescriptreact", "vue" },
}))
local servers = { "volar", "elixirls", "gopls", "pylsp" }
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup(coq.lsp_ensure_capabilities({
on_attach = on_attach,
flags = lsp_flags,
}))
lspconfig[lsp].setup(coq.lsp_ensure_capabilities({
on_attach = on_attach,
flags = lsp_flags,
}))
end