Compare commits
10 Commits
e59edbd7ea
...
main
Author | SHA1 | Date | |
---|---|---|---|
61d14ba3b2 | |||
2c8f3e5a04 | |||
fd6618262c | |||
77bf610632 | |||
6cba1e35d5 | |||
6543069666 | |||
2d51753876 | |||
dced909d5a | |||
7277a80fe3 | |||
117b024c85 |
3
README.md
Normal file
3
README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Config files for various applications
|
||||||
|
|
||||||
|
## TODO: create a justfile for managing everything
|
6
fish/README.md
Normal file
6
fish/README.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
My config files for the fish shell.
|
||||||
|
|
||||||
|
Install using
|
||||||
|
```
|
||||||
|
ln -s $PWD/fish ~/.config/fish
|
||||||
|
```
|
2
fish/fish/conf.d/fnm.fish
Normal file
2
fish/fish/conf.d/fnm.fish
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# https://github.com/Schniz/fnm?tab=readme-ov-file#shell-setup
|
||||||
|
fnm env --use-on-cd --shell fish | source
|
1
fish/fish/conf.d/rustup.fish
Normal file
1
fish/fish/conf.d/rustup.fish
Normal file
@ -0,0 +1 @@
|
|||||||
|
source "$HOME/.cargo/env.fish"
|
10
fish/fish/config.fish
Normal file
10
fish/fish/config.fish
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
if status is-interactive
|
||||||
|
# Commands to run in interactive sessions can go here
|
||||||
|
alias --save !! $(history -1)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Set the default editor to be nvim
|
||||||
|
setenv EDITOR nvim
|
||||||
|
setenv BEESHOME /.beeshome/
|
||||||
|
setenv FZF_DEFAULT_COMMAND 'fd --type file --follow'
|
||||||
|
setenv FZF_CTRL_T_COMMAND 'fd --type file --follow'
|
32
fish/fish/fish_variables
Normal file
32
fish/fish/fish_variables
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# This file contains fish universal variable definitions.
|
||||||
|
# VERSION: 3.0
|
||||||
|
SETUVAR __fish_initialized:3800
|
||||||
|
SETUVAR fish_color_autosuggestion:brblack
|
||||||
|
SETUVAR fish_color_cancel:\x2dr
|
||||||
|
SETUVAR fish_color_command:blue
|
||||||
|
SETUVAR fish_color_comment:red
|
||||||
|
SETUVAR fish_color_cwd:green
|
||||||
|
SETUVAR fish_color_cwd_root:red
|
||||||
|
SETUVAR fish_color_end:green
|
||||||
|
SETUVAR fish_color_error:brred
|
||||||
|
SETUVAR fish_color_escape:brcyan
|
||||||
|
SETUVAR fish_color_history_current:\x2d\x2dbold
|
||||||
|
SETUVAR fish_color_host:normal
|
||||||
|
SETUVAR fish_color_host_remote:yellow
|
||||||
|
SETUVAR fish_color_normal:normal
|
||||||
|
SETUVAR fish_color_operator:brcyan
|
||||||
|
SETUVAR fish_color_param:cyan
|
||||||
|
SETUVAR fish_color_quote:yellow
|
||||||
|
SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold
|
||||||
|
SETUVAR fish_color_search_match:white\x1e\x2d\x2dbackground\x3dbrblack
|
||||||
|
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
|
||||||
|
SETUVAR fish_color_status:red
|
||||||
|
SETUVAR fish_color_user:brgreen
|
||||||
|
SETUVAR fish_color_valid_path:\x2d\x2dunderline
|
||||||
|
SETUVAR fish_key_bindings:fish_default_key_bindings
|
||||||
|
SETUVAR fish_pager_color_completion:normal
|
||||||
|
SETUVAR fish_pager_color_description:yellow\x1e\x2di
|
||||||
|
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
|
||||||
|
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
|
||||||
|
SETUVAR fish_pager_color_selected_background:\x2dr
|
||||||
|
SETUVAR fish_user_paths:/opt/homebrew/opt/php\x408\x2e1/bin\x1e/Users/arc/\x2ecargo/bin\x1e/opt/homebrew/bin\x1e/usr/local/libexec\x1e/home/arc/\x2elocal/share/fnm
|
4
fish/fish/functions/!!.fish
Normal file
4
fish/fish/functions/!!.fish
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
function !! --wraps=nvim --description 'alias !! nvim'
|
||||||
|
nvim $argv
|
||||||
|
|
||||||
|
end
|
@ -1,5 +1,10 @@
|
|||||||
This config should be located at `~/.config/nvim/init.lua`.
|
This config should be located at `~/.config/nvim/init.lua`.
|
||||||
|
|
||||||
|
Install this config with:
|
||||||
|
```
|
||||||
|
ln -s $PWD/nvim/ ~/.config/nvim
|
||||||
|
```
|
||||||
|
|
||||||
Dependencies can be installed (via brew) with:
|
Dependencies can be installed (via brew) with:
|
||||||
```
|
```
|
||||||
brew install fzf bat ripgrep the_silver_searcher perl universal-ctags fd
|
brew install fzf bat ripgrep the_silver_searcher perl universal-ctags fd
|
||||||
|
@ -1 +0,0 @@
|
|||||||
/Users/arc/.config/nvim/
|
|
663
neovim/nvim/init.lua
Normal file
663
neovim/nvim/init.lua
Normal file
@ -0,0 +1,663 @@
|
|||||||
|
-- always set leader first!
|
||||||
|
vim.keymap.set("n", "<Space>", "<Nop>", { silent = true })
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
--
|
||||||
|
-- preferences
|
||||||
|
--
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
-- never ever folding
|
||||||
|
vim.opt.foldenable = false
|
||||||
|
vim.opt.foldmethod = 'manual'
|
||||||
|
vim.opt.foldlevelstart = 99
|
||||||
|
-- very basic "continue indent" mode (autoindent) is always on in neovim
|
||||||
|
-- could try smartindent/cindent, but meh.
|
||||||
|
-- vim.opt.cindent = true
|
||||||
|
-- XXX
|
||||||
|
-- vim.opt.cmdheight = 2
|
||||||
|
-- vim.opt.completeopt = 'menuone,noinsert,noselect'
|
||||||
|
-- not setting updatedtime because I use K to manually trigger hover effects
|
||||||
|
-- and lowering it also changes how frequently files are written to swap.
|
||||||
|
-- Uncommented to see if it'll make tooltips pop up automatically
|
||||||
|
vim.opt.updatetime = 300
|
||||||
|
-- if key combos seem to be "lagging"
|
||||||
|
-- http://stackoverflow.com/questions/2158516/delay-before-o-opens-a-new-line
|
||||||
|
-- vim.opt.timeoutlen = 300
|
||||||
|
-- keep more context on screen while scrolling
|
||||||
|
vim.opt.scrolloff = 2
|
||||||
|
-- never show me line breaks if they're not there
|
||||||
|
vim.opt.wrap = false
|
||||||
|
-- always draw sign column. prevents buffer moving when adding/deleting sign
|
||||||
|
vim.opt.signcolumn = 'yes'
|
||||||
|
-- sweet sweet relative line numbers
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
-- and show the absolute line number for the current line
|
||||||
|
vim.opt.number = true
|
||||||
|
-- keep current content top + left when splitting
|
||||||
|
vim.opt.splitright = true
|
||||||
|
vim.opt.splitbelow = true
|
||||||
|
-- infinite undo!
|
||||||
|
-- NOTE: ends up in ~/.local/state/nvim/undo/
|
||||||
|
vim.opt.undofile = true
|
||||||
|
--" Decent wildmenu
|
||||||
|
-- in completion, when there is more than one match,
|
||||||
|
-- list all matches, and only complete to longest common match
|
||||||
|
vim.opt.wildmode = 'list:longest'
|
||||||
|
-- when opening a file with a command (like :e),
|
||||||
|
-- don't suggest files like there:
|
||||||
|
vim.opt.wildignore = '.hg,.svn,*~,*.png,*.jpg,*.gif,*.min.js,*.swp,*.o,vendor,dist,_site'
|
||||||
|
-- tabs: go big or go home
|
||||||
|
vim.opt.shiftwidth = 4
|
||||||
|
vim.opt.softtabstop = 4
|
||||||
|
vim.opt.tabstop = 8
|
||||||
|
vim.opt.expandtab = false
|
||||||
|
-- case-insensitive search/replace
|
||||||
|
vim.opt.ignorecase = true
|
||||||
|
-- unless uppercase in search term
|
||||||
|
vim.opt.smartcase = true
|
||||||
|
-- never ever make my terminal beep
|
||||||
|
vim.opt.vb = true
|
||||||
|
-- more useful diffs (nvim -d)
|
||||||
|
--- by ignoring whitespace
|
||||||
|
vim.opt.diffopt:append('iwhite')
|
||||||
|
--- and using a smarter algorithm
|
||||||
|
--- https://vimways.org/2018/the-power-of-diff/
|
||||||
|
--- https://stackoverflow.com/questions/32365271/whats-the-difference-between-git-diff-patience-and-git-diff-histogram
|
||||||
|
--- https://luppeng.wordpress.com/2020/10/10/when-to-use-each-of-the-git-diff-algorithms/
|
||||||
|
vim.opt.diffopt:append('algorithm:histogram')
|
||||||
|
vim.opt.diffopt:append('indent-heuristic')
|
||||||
|
-- show a column at 80 characters as a guide for long lines
|
||||||
|
vim.opt.colorcolumn = '80'
|
||||||
|
--- except in Rust where the rule is 100 characters
|
||||||
|
vim.api.nvim_create_autocmd('Filetype', { pattern = 'rust', command = 'set colorcolumn=100' })
|
||||||
|
-- show more hidden characters
|
||||||
|
-- also, show tabs nicer
|
||||||
|
vim.opt.listchars = 'tab:^ ,nbsp:¬,extends:»,precedes:«,trail:•'
|
||||||
|
|
||||||
|
-- Arc, March 20, 2025
|
||||||
|
-- Setting the filetype for Verilog
|
||||||
|
vim.api.nvim_create_autocmd(
|
||||||
|
{"BufNewFile", "BufRead"}, {
|
||||||
|
pattern = {"*.v"},
|
||||||
|
command = "set filetype=verilog",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
--
|
||||||
|
-- hotkeys
|
||||||
|
--
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
-- quick-open
|
||||||
|
-- Replaced with FZF instead of Files because files pulls up empty for some reason - 2024-10-2
|
||||||
|
vim.keymap.set('', '<C-p>', '<cmd>FZF<cr>')
|
||||||
|
-- vim.keymap.set('', '<C-p>', '<cmd>Files<cr>')
|
||||||
|
-- search buffers
|
||||||
|
vim.keymap.set('n', '<leader>;', '<cmd>Buffers<cr>')
|
||||||
|
-- quick-save
|
||||||
|
vim.keymap.set('n', '<leader>w', '<cmd>w<cr>')
|
||||||
|
-- make missing : less annoying
|
||||||
|
vim.keymap.set('n', ';', ':')
|
||||||
|
-- Ctrl+j and Ctrl+k as Esc
|
||||||
|
vim.keymap.set('n', '<C-j>', '<Esc>')
|
||||||
|
vim.keymap.set('i', '<C-j>', '<Esc>')
|
||||||
|
vim.keymap.set('v', '<C-j>', '<Esc>')
|
||||||
|
vim.keymap.set('s', '<C-j>', '<Esc>')
|
||||||
|
vim.keymap.set('x', '<C-j>', '<Esc>')
|
||||||
|
vim.keymap.set('c', '<C-j>', '<Esc>')
|
||||||
|
vim.keymap.set('o', '<C-j>', '<Esc>')
|
||||||
|
vim.keymap.set('l', '<C-j>', '<Esc>')
|
||||||
|
vim.keymap.set('t', '<C-j>', '<Esc>')
|
||||||
|
-- Ctrl-j is a little awkward unfortunately:
|
||||||
|
-- https://github.com/neovim/neovim/issues/5916
|
||||||
|
-- So we also map Ctrl+k
|
||||||
|
vim.keymap.set('n', '<C-k>', '<Esc>')
|
||||||
|
vim.keymap.set('i', '<C-k>', '<Esc>')
|
||||||
|
vim.keymap.set('v', '<C-k>', '<Esc>')
|
||||||
|
vim.keymap.set('s', '<C-k>', '<Esc>')
|
||||||
|
vim.keymap.set('x', '<C-k>', '<Esc>')
|
||||||
|
vim.keymap.set('c', '<C-k>', '<Esc>')
|
||||||
|
vim.keymap.set('o', '<C-k>', '<Esc>')
|
||||||
|
vim.keymap.set('l', '<C-k>', '<Esc>')
|
||||||
|
vim.keymap.set('t', '<C-k>', '<Esc>')
|
||||||
|
-- Ctrl+h to stop searching
|
||||||
|
vim.keymap.set('v', '<C-h>', '<cmd>nohlsearch<cr>')
|
||||||
|
vim.keymap.set('n', '<C-h>', '<cmd>nohlsearch<cr>')
|
||||||
|
-- Jump to start and end of line using the home row keys
|
||||||
|
vim.keymap.set('', 'H', '^')
|
||||||
|
vim.keymap.set('', 'L', '$')
|
||||||
|
-- Neat X clipboard integration
|
||||||
|
-- <leader>p will paste clipboard into buffer
|
||||||
|
-- <leader>c will copy entire buffer into clipboard
|
||||||
|
vim.keymap.set('n', '<leader>p', '<cmd>read !wl-paste<cr>')
|
||||||
|
-- <leader><leader> toggles between buffers
|
||||||
|
vim.keymap.set('n', '<leader><leader>', '<c-^>')
|
||||||
|
-- <leader>, shows/hides hidden characters
|
||||||
|
vim.keymap.set('n', '<leader>,', ':set invlist<cr>')
|
||||||
|
-- always center search results
|
||||||
|
vim.keymap.set('n', 'n', 'nzz', { silent = true })
|
||||||
|
vim.keymap.set('n', 'N', 'Nzz', { silent = true })
|
||||||
|
vim.keymap.set('n', '*', '*zz', { silent = true })
|
||||||
|
vim.keymap.set('n', '#', '#zz', { silent = true })
|
||||||
|
vim.keymap.set('n', 'g*', 'g*zz', { silent = true })
|
||||||
|
-- "very magic" (less escaping needed) regexes by default
|
||||||
|
vim.keymap.set('n', '?', '?\\v')
|
||||||
|
vim.keymap.set('n', '/', '/\\v')
|
||||||
|
vim.keymap.set('c', '%s/', '%sm/')
|
||||||
|
-- open new file adjacent to current file
|
||||||
|
vim.keymap.set('n', '<leader>o', ':e <C-R>=expand("%:p:h") . "/" <cr>')
|
||||||
|
-- no arrow keys --- force yourself to use the home row
|
||||||
|
vim.keymap.set('n', '<up>', '<nop>')
|
||||||
|
vim.keymap.set('n', '<down>', '<nop>')
|
||||||
|
vim.keymap.set('i', '<up>', '<nop>')
|
||||||
|
vim.keymap.set('i', '<down>', '<nop>')
|
||||||
|
vim.keymap.set('i', '<left>', '<nop>')
|
||||||
|
vim.keymap.set('i', '<right>', '<nop>')
|
||||||
|
-- let the left and right arrows be useful: they can switch buffers
|
||||||
|
vim.keymap.set('n', '<left>', ':bp<cr>')
|
||||||
|
vim.keymap.set('n', '<right>', ':bn<cr>')
|
||||||
|
-- make j and k move by visual line, not actual line, when text is soft-wrapped
|
||||||
|
vim.keymap.set('n', 'j', 'gj')
|
||||||
|
vim.keymap.set('n', 'k', 'gk')
|
||||||
|
-- handy keymap for replacing up to next _ (like in variable names)
|
||||||
|
vim.keymap.set('n', '<leader>m', 'ct_')
|
||||||
|
-- F1 is pretty close to Esc, so you probably meant Esc
|
||||||
|
vim.keymap.set('', '<F1>', '<Esc>')
|
||||||
|
vim.keymap.set('i', '<F1>', '<Esc>')
|
||||||
|
|
||||||
|
-- Use f2 to rename symbol (arc) - 2024-10-02
|
||||||
|
vim.keymap.set('n', '<F2>', function () vim.lsp.buf.rename() end)
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
--
|
||||||
|
-- autocommands
|
||||||
|
--
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
-- highlight yanked text
|
||||||
|
vim.api.nvim_create_autocmd(
|
||||||
|
'TextYankPost',
|
||||||
|
{
|
||||||
|
pattern = '*',
|
||||||
|
command = 'silent! lua vim.highlight.on_yank({ timeout = 500 })'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
-- jump to last edit position on opening file
|
||||||
|
vim.api.nvim_create_autocmd(
|
||||||
|
'BufReadPost',
|
||||||
|
{
|
||||||
|
pattern = '*',
|
||||||
|
callback = function(ev)
|
||||||
|
if vim.fn.line("'\"") > 1 and vim.fn.line("'\"") <= vim.fn.line("$") then
|
||||||
|
-- except for in git commit messages
|
||||||
|
-- https://stackoverflow.com/questions/31449496/vim-ignore-specifc-file-in-autocommand
|
||||||
|
if not vim.fn.expand('%:p'):find('.git', 1, true) then
|
||||||
|
vim.cmd('exe "normal! g\'\\""')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
)
|
||||||
|
-- prevent accidental writes to buffers that shouldn't be edited
|
||||||
|
vim.api.nvim_create_autocmd('BufRead', { pattern = '*.orig', command = 'set readonly' })
|
||||||
|
vim.api.nvim_create_autocmd('BufRead', { pattern = '*.pacnew', command = 'set readonly' })
|
||||||
|
-- leave paste mode when leaving insert mode (if it was on)
|
||||||
|
vim.api.nvim_create_autocmd('InsertLeave', { pattern = '*', command = 'set nopaste' })
|
||||||
|
-- help filetype detection (add as needed)
|
||||||
|
--vim.api.nvim_create_autocmd('BufRead', { pattern = '*.ext', command = 'set filetype=someft' })
|
||||||
|
-- correctly classify mutt buffers
|
||||||
|
local email = vim.api.nvim_create_augroup('email', { clear = true })
|
||||||
|
vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead' }, {
|
||||||
|
pattern = '/tmp/mutt*',
|
||||||
|
group = email,
|
||||||
|
command = 'setfiletype mail',
|
||||||
|
})
|
||||||
|
-- also, produce "flowed text" wrapping
|
||||||
|
-- https://brianbuccola.com/line-breaks-in-mutt-and-vim/
|
||||||
|
vim.api.nvim_create_autocmd('Filetype', {
|
||||||
|
pattern = 'mail',
|
||||||
|
group = email,
|
||||||
|
command = 'setlocal formatoptions+=w',
|
||||||
|
})
|
||||||
|
-- shorter columns in text because it reads better that way
|
||||||
|
local text = vim.api.nvim_create_augroup('text', { clear = true })
|
||||||
|
for _, pat in ipairs({'text', 'markdown', 'mail', 'gitcommit'}) do
|
||||||
|
vim.api.nvim_create_autocmd('Filetype', {
|
||||||
|
pattern = pat,
|
||||||
|
group = text,
|
||||||
|
command = 'setlocal spell tw=72 colorcolumn=73',
|
||||||
|
})
|
||||||
|
end
|
||||||
|
--- tex has so much syntax that a little wider is ok
|
||||||
|
vim.api.nvim_create_autocmd('Filetype', {
|
||||||
|
pattern = 'tex',
|
||||||
|
group = text,
|
||||||
|
command = 'setlocal spell tw=80 colorcolumn=81',
|
||||||
|
})
|
||||||
|
-- TODO: no autocomplete in text
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
--
|
||||||
|
-- plugin configuration
|
||||||
|
--
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
-- first, grab the manager
|
||||||
|
-- https://github.com/folke/lazy.nvim
|
||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
|
vim.fn.system({
|
||||||
|
"git",
|
||||||
|
"clone",
|
||||||
|
"--filter=blob:none",
|
||||||
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
|
"--branch=stable", -- latest stable release
|
||||||
|
lazypath,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
-- then, setup!
|
||||||
|
require("lazy").setup({
|
||||||
|
-- main color scheme
|
||||||
|
-- Switched to https://github.com/projekt0n/github-nvim-theme
|
||||||
|
--
|
||||||
|
-- {
|
||||||
|
-- "projekt0n/github-nvim-theme",
|
||||||
|
-- lazy = false, -- load at start
|
||||||
|
-- priority = 1000, -- load first
|
||||||
|
-- config = function()
|
||||||
|
-- vim.cmd([[colorscheme github_dark]])
|
||||||
|
-- vim.o.background = 'dark'
|
||||||
|
-- -- XXX: hi Normal ctermbg=NONE
|
||||||
|
-- -- Make comments more prominent -- they are important.
|
||||||
|
-- local bools = vim.api.nvim_get_hl(0, { name = 'Boolean' })
|
||||||
|
-- vim.api.nvim_set_hl(0, 'Comment', bools)
|
||||||
|
-- -- Make it clearly visible which argument we're at.
|
||||||
|
-- local marked = vim.api.nvim_get_hl(0, { name = 'PMenu' })
|
||||||
|
-- vim.api.nvim_set_hl(0, 'LspSignatureActiveParameter', { fg = marked.fg, bg = marked.bg, ctermfg = marked.ctermfg, ctermbg = marked.ctermbg, bold = true })
|
||||||
|
-- -- XXX
|
||||||
|
-- -- Would be nice to customize the highlighting of warnings and the like to make
|
||||||
|
-- -- them less glaring. But alas
|
||||||
|
-- -- https://github.com/nvim-lua/lsp_extensions.nvim/issues/21
|
||||||
|
-- -- call Base16hi("CocHintSign", g:base16_gui03, "", g:base16_cterm03, "", "", "")
|
||||||
|
-- end
|
||||||
|
-- },
|
||||||
|
-- nice bar at the bottom
|
||||||
|
{
|
||||||
|
"wincent/base16-nvim",
|
||||||
|
lazy = false, -- load at start
|
||||||
|
priority = 1000, -- load first
|
||||||
|
config = function()
|
||||||
|
vim.cmd([[colorscheme gruvbox-dark-hard]])
|
||||||
|
vim.o.background = 'dark'
|
||||||
|
-- XXX: hi Normal ctermbg=NONE
|
||||||
|
-- Make comments more prominent -- they are important.
|
||||||
|
local bools = vim.api.nvim_get_hl(0, { name = 'Boolean' })
|
||||||
|
vim.api.nvim_set_hl(0, 'Comment', bools)
|
||||||
|
-- Make it clearly visible which argument we're at.
|
||||||
|
local marked = vim.api.nvim_get_hl(0, { name = 'PMenu' })
|
||||||
|
vim.api.nvim_set_hl(0, 'LspSignatureActiveParameter', { fg = marked.fg, bg = marked.bg, ctermfg = marked.ctermfg, ctermbg = marked.ctermbg, bold = true })
|
||||||
|
-- XXX
|
||||||
|
-- Would be nice to customize the highlighting of warnings and the like to make
|
||||||
|
-- them less glaring. But alas
|
||||||
|
-- https://github.com/nvim-lua/lsp_extensions.nvim/issues/21
|
||||||
|
-- call Base16hi("CocHintSign", g:base16_gui03, "", g:base16_cterm03, "", "", "")
|
||||||
|
end
|
||||||
|
},
|
||||||
|
-- nice bar at the bottom
|
||||||
|
{
|
||||||
|
'itchyny/lightline.vim',
|
||||||
|
lazy = false, -- also load at start since it's UI
|
||||||
|
config = function()
|
||||||
|
-- no need to also show mode in cmd line when we have bar
|
||||||
|
vim.o.showmode = false
|
||||||
|
vim.g.lightline = {
|
||||||
|
active = {
|
||||||
|
left = {
|
||||||
|
{ 'mode', 'paste' },
|
||||||
|
{ 'readonly', 'filename', 'modified' }
|
||||||
|
},
|
||||||
|
right = {
|
||||||
|
{ 'lineinfo' },
|
||||||
|
{ 'percent' },
|
||||||
|
{ 'fileencoding', 'filetype' }
|
||||||
|
},
|
||||||
|
},
|
||||||
|
component_function = {
|
||||||
|
filename = 'LightlineFilename'
|
||||||
|
},
|
||||||
|
}
|
||||||
|
function LightlineFilenameInLua(opts)
|
||||||
|
if vim.fn.expand('%:t') == '' then
|
||||||
|
return '[No Name]'
|
||||||
|
else
|
||||||
|
return vim.fn.getreg('%')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- https://github.com/itchyny/lightline.vim/issues/657
|
||||||
|
vim.api.nvim_exec(
|
||||||
|
[[
|
||||||
|
function! g:LightlineFilename()
|
||||||
|
return v:lua.LightlineFilenameInLua()
|
||||||
|
endfunction
|
||||||
|
]],
|
||||||
|
true
|
||||||
|
)
|
||||||
|
end
|
||||||
|
},
|
||||||
|
-- quick navigation
|
||||||
|
{
|
||||||
|
'ggandor/leap.nvim',
|
||||||
|
config = function()
|
||||||
|
require('leap').create_default_mappings()
|
||||||
|
end
|
||||||
|
},
|
||||||
|
-- better %
|
||||||
|
{
|
||||||
|
'andymass/vim-matchup',
|
||||||
|
config = function()
|
||||||
|
vim.g.matchup_matchparen_offscreen = { method = "popup" }
|
||||||
|
end
|
||||||
|
},
|
||||||
|
-- auto-cd to root of git project
|
||||||
|
-- 'airblade/vim-rooter'
|
||||||
|
-- Commented out because I don't like it (arc) - 2024-10-03
|
||||||
|
-- {
|
||||||
|
-- 'notjedi/nvim-rooter.lua',
|
||||||
|
-- config = function()
|
||||||
|
-- require('nvim-rooter').setup()
|
||||||
|
-- end
|
||||||
|
-- },
|
||||||
|
-- hopefully fix random crashes?
|
||||||
|
{
|
||||||
|
'hrsh7th/vim-vsnip'
|
||||||
|
},
|
||||||
|
-- fzf support for ^p
|
||||||
|
{
|
||||||
|
'junegunn/fzf.vim',
|
||||||
|
-- dependencies = {
|
||||||
|
-- { 'junegunn/fzf', dir = '~/.fzf', build = './install --all' },
|
||||||
|
-- },
|
||||||
|
config = function()
|
||||||
|
-- stop putting a giant window over my editor
|
||||||
|
vim.g.fzf_layout = { down = '~20%' }
|
||||||
|
-- when using :Files, pass the file list through
|
||||||
|
--
|
||||||
|
-- https://github.com/jonhoo/proximity-sort
|
||||||
|
--
|
||||||
|
-- to prefer files closer to the current file.
|
||||||
|
function list_cmd()
|
||||||
|
local base = vim.fn.fnamemodify(vim.fn.expand('%'), ':h:.:S')
|
||||||
|
if base == '.' then
|
||||||
|
-- if there is no current file,
|
||||||
|
-- proximity-sort can't do its thing
|
||||||
|
return 'fd --type file --follow'
|
||||||
|
else
|
||||||
|
return vim.fn.printf('fd --type file --follow | proximity-sort %s', vim.fn.shellescape(vim.fn.expand('%')))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
vim.api.nvim_create_user_command('Files', function(arg)
|
||||||
|
vim.fn['fzf#vim#files'](arg.qargs, { source = list_cmd(), options = '--tiebreak=index' }, arg.bang)
|
||||||
|
end, { bang = true, nargs = '?', complete = "dir" })
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'junegunn/fzf'
|
||||||
|
},
|
||||||
|
-- LSP
|
||||||
|
{
|
||||||
|
'neovim/nvim-lspconfig',
|
||||||
|
config = function()
|
||||||
|
-- Setup language servers.
|
||||||
|
local lspconfig = require('lspconfig')
|
||||||
|
|
||||||
|
-- Server-specific settings. See `:help lspconfig-setup`
|
||||||
|
settings = {
|
||||||
|
["rust-analyzer"] = {
|
||||||
|
cargo = {
|
||||||
|
features = "all"
|
||||||
|
},
|
||||||
|
checkOnSave = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
check = {
|
||||||
|
command = "clippy"
|
||||||
|
},
|
||||||
|
imports = {
|
||||||
|
group = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
completion = {
|
||||||
|
postfix = {
|
||||||
|
-- Commened out to see if I like it more (arc) - 2024-10-03
|
||||||
|
-- enable = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- Rust
|
||||||
|
vim.lsp.enable('rust_analyzer')
|
||||||
|
|
||||||
|
-- C/C++
|
||||||
|
if vim.fn.executable('clangd') == 1 then
|
||||||
|
vim.lsp.enable('clangd')
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Javascript
|
||||||
|
if vim.fn.executable('biome') == 1 then
|
||||||
|
vim.lsp.enable('biome')
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Global mappings.
|
||||||
|
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
||||||
|
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
|
||||||
|
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
|
||||||
|
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
|
||||||
|
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)
|
||||||
|
|
||||||
|
-- Use LspAttach autocommand to only map the following keys
|
||||||
|
-- after the language server attaches to the current buffer
|
||||||
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
|
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
|
||||||
|
callback = function(ev)
|
||||||
|
-- Enable completion triggered by <c-x><c-o>
|
||||||
|
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
|
||||||
|
|
||||||
|
-- Buffer local mappings.
|
||||||
|
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||||
|
local opts = { buffer = ev.buf }
|
||||||
|
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
|
||||||
|
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
|
||||||
|
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
|
||||||
|
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
|
||||||
|
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
|
||||||
|
vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, opts)
|
||||||
|
vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
||||||
|
vim.keymap.set('n', '<leader>wl', function()
|
||||||
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
|
end, opts)
|
||||||
|
--vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
|
||||||
|
vim.keymap.set('n', '<leader>r', vim.lsp.buf.rename, opts)
|
||||||
|
vim.keymap.set({ 'n', 'v' }, '<leader>a', vim.lsp.buf.code_action, opts)
|
||||||
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
|
||||||
|
vim.keymap.set('n', '<leader>f', function()
|
||||||
|
vim.lsp.buf.format { async = true }
|
||||||
|
end, opts)
|
||||||
|
|
||||||
|
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
||||||
|
|
||||||
|
-- When https://neovim.io/doc/user/lsp.html#lsp-inlay_hint stabilizes
|
||||||
|
-- *and* there's some way to make it only apply to the current line.
|
||||||
|
-- if client.server_capabilities.inlayHintProvider then
|
||||||
|
-- vim.lsp.inlay_hint(ev.buf, true)
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- None of this semantics tokens business.
|
||||||
|
-- https://www.reddit.com/r/neovim/comments/143efmd/is_it_possible_to_disable_treesitter_completely/
|
||||||
|
client.server_capabilities.semanticTokensProvider = nil
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
},
|
||||||
|
-- LSP-based code-completion
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
-- load cmp on InsertEnter
|
||||||
|
event = "InsertEnter",
|
||||||
|
-- these dependencies will only be loaded when cmp loads
|
||||||
|
-- dependencies are always lazy-loaded unless specified otherwise
|
||||||
|
dependencies = {
|
||||||
|
'neovim/nvim-lspconfig',
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
"hrsh7th/cmp-path",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local cmp = require'cmp'
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
-- REQUIRED by nvim-cmp. get rid of it once we can
|
||||||
|
expand = function(args)
|
||||||
|
vim.fn["vsnip#anonymous"](args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||||
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||||
|
['<C-Space>'] = cmp.mapping.complete(),
|
||||||
|
['<C-e>'] = cmp.mapping.abort(),
|
||||||
|
-- Accept currently selected item.
|
||||||
|
-- Set `select` to `false` to only confirm explicitly selected items.
|
||||||
|
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||||
|
}),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'nvim_lsp' },
|
||||||
|
}, {
|
||||||
|
{ name = 'path' },
|
||||||
|
}),
|
||||||
|
experimental = {
|
||||||
|
ghost_text = true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Enable completing paths in :
|
||||||
|
cmp.setup.cmdline(':', {
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'path' }
|
||||||
|
})
|
||||||
|
})
|
||||||
|
end
|
||||||
|
},
|
||||||
|
-- inline function signatures
|
||||||
|
{
|
||||||
|
"ray-x/lsp_signature.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {},
|
||||||
|
config = function(_, opts)
|
||||||
|
-- Get signatures (and _only_ signatures) when in argument lists.
|
||||||
|
require "lsp_signature".setup({
|
||||||
|
doc_lines = 0,
|
||||||
|
handler_opts = {
|
||||||
|
border = "none"
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
},
|
||||||
|
-- language support
|
||||||
|
-- terraform
|
||||||
|
{
|
||||||
|
'hashivim/vim-terraform',
|
||||||
|
ft = { "hcl" },
|
||||||
|
},
|
||||||
|
-- svelte
|
||||||
|
{
|
||||||
|
'evanleck/vim-svelte',
|
||||||
|
ft = { "svelte" },
|
||||||
|
},
|
||||||
|
-- toml
|
||||||
|
'cespare/vim-toml',
|
||||||
|
-- yaml
|
||||||
|
{
|
||||||
|
"cuducos/yaml.nvim",
|
||||||
|
ft = { "yaml" },
|
||||||
|
dependencies = {
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- rust
|
||||||
|
{
|
||||||
|
'rust-lang/rust.vim',
|
||||||
|
ft = { "rust" },
|
||||||
|
config = function()
|
||||||
|
vim.g.rustfmt_autosave = 1
|
||||||
|
vim.g.rustfmt_emit_files = 1
|
||||||
|
vim.g.rustfmt_fail_silently = 0
|
||||||
|
vim.g.rust_clip_command = 'wl-copy'
|
||||||
|
end
|
||||||
|
},
|
||||||
|
-- fish
|
||||||
|
'khaveesh/vim-fish-syntax',
|
||||||
|
-- markdown
|
||||||
|
{
|
||||||
|
'plasticboy/vim-markdown',
|
||||||
|
ft = { "markdown" },
|
||||||
|
dependencies = {
|
||||||
|
'godlygeek/tabular',
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
-- never ever fold!
|
||||||
|
vim.g.vim_markdown_folding_disabled = 1
|
||||||
|
-- support front-matter in .md files
|
||||||
|
vim.g.vim_markdown_frontmatter = 1
|
||||||
|
-- 'o' on a list item should insert at same level
|
||||||
|
vim.g.vim_markdown_new_list_item_indent = 0
|
||||||
|
-- don't add bullets when wrapping:
|
||||||
|
-- https://github.com/preservim/vim-markdown/issues/232
|
||||||
|
vim.g.vim_markdown_auto_insert_bullets = 0
|
||||||
|
end
|
||||||
|
},
|
||||||
|
-- Typescript
|
||||||
|
{
|
||||||
|
'tree-sitter/tree-sitter-typescript',
|
||||||
|
ft = { "typescript", "javascript" },
|
||||||
|
dependencies = {
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
--[[
|
||||||
|
|
||||||
|
leftover things from init.vim that i may still end up wanting
|
||||||
|
|
||||||
|
" Completion
|
||||||
|
" Better completion
|
||||||
|
" menuone: popup even when there's only one match
|
||||||
|
" noinsert: Do not insert text until a selection is made
|
||||||
|
" noselect: Do not select, force user to select one from the menu
|
||||||
|
set completeopt=menuone,noinsert,noselect
|
||||||
|
|
||||||
|
" Settings needed for .lvimrc
|
||||||
|
set exrc
|
||||||
|
set secure
|
||||||
|
|
||||||
|
" Wrapping options
|
||||||
|
set formatoptions=tc " wrap text and comments using textwidth
|
||||||
|
set formatoptions+=r " continue comments when pressing ENTER in I mode
|
||||||
|
set formatoptions+=q " enable formatting of comments with gq
|
||||||
|
set formatoptions+=n " detect lists for formatting
|
||||||
|
set formatoptions+=b " auto-wrap in insert mode, and do not wrap old long lines
|
||||||
|
|
||||||
|
" <leader>s for Rg search
|
||||||
|
noremap <leader>s :Rg
|
||||||
|
let g:fzf_layout = { 'down': '~20%' }
|
||||||
|
command! -bang -nargs=* Rg
|
||||||
|
\ call fzf#vim#grep(
|
||||||
|
\ 'rg --column --line-number --no-heading --color=always '.shellescape(<q-args>), 1,
|
||||||
|
\ <bang>0 ? fzf#vim#with_preview('up:60%')
|
||||||
|
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
|
||||||
|
\ <bang>0)
|
||||||
|
|
||||||
|
" <leader>q shows stats
|
||||||
|
nnoremap <leader>q g<c-g>
|
||||||
|
|
||||||
|
--]]
|
26
neovim/nvim/lazy-lock.json
Normal file
26
neovim/nvim/lazy-lock.json
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"base16-nvim": { "branch": "main", "commit": "e86be83754d6c64f9678f072b382354d0f829ede" },
|
||||||
|
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
|
||||||
|
"cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
|
||||||
|
"fzf": { "branch": "master", "commit": "0c00b203e61bffbadbc499cbf68af6f89a5a3e29" },
|
||||||
|
"fzf.vim": { "branch": "master", "commit": "98dcd77a189a8a87052c20d1be8082aea60101b7" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||||
|
"leap.nvim": { "branch": "main", "commit": "10c14af4ddfb34dbd7721f0bfb2b4d91f0558907" },
|
||||||
|
"lightline.vim": { "branch": "master", "commit": "e358557e1a9f9fc860416c8eb2e34c0404078155" },
|
||||||
|
"lsp_signature.nvim": { "branch": "master", "commit": "15bb33cdb47e85278e168cad11acb1b6fa9c6488" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "9276b82935bf6b951d08c864eb5ac3f85d6b743b" },
|
||||||
|
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||||
|
"rust.vim": { "branch": "master", "commit": "889b9a7515db477f4cb6808bef1769e53493c578" },
|
||||||
|
"tabular": { "branch": "master", "commit": "12437cd1b53488e24936ec4b091c9324cafee311" },
|
||||||
|
"tree-sitter-typescript": { "branch": "master", "commit": "75b3874edb2dc714fb1fd77a32013d0f8699989f" },
|
||||||
|
"vim-fish-syntax": { "branch": "master", "commit": "e229becbf4bbee21cc78cd2cf24f57112e33c02a" },
|
||||||
|
"vim-markdown": { "branch": "master", "commit": "8f6cb3a6ca4e3b6bcda0730145a0b700f3481b51" },
|
||||||
|
"vim-matchup": { "branch": "master", "commit": "c478d4a72bbf397eff42743198f1939f6a264736" },
|
||||||
|
"vim-svelte": { "branch": "main", "commit": "f6df955ad86583e9751487eb7550fae9e53d2d6b" },
|
||||||
|
"vim-terraform": { "branch": "master", "commit": "520498fab16a3a11f2ae1b8cb65e0a1684bc317a" },
|
||||||
|
"vim-toml": { "branch": "main", "commit": "1b63257680eeb65677eb1ca5077809a982756d58" },
|
||||||
|
"vim-vsnip": { "branch": "master", "commit": "0a4b8419e44f47c57eec4c90df17567ad4b1b36e" },
|
||||||
|
"yaml.nvim": { "branch": "main", "commit": "09bbf7d936606d97f2c1d2e51171a602bc76b65e" }
|
||||||
|
}
|
2
zed/.gitignore
vendored
Normal file
2
zed/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
zed/.tmp*
|
||||||
|
zed/embeddings
|
BIN
zed/zed/embeddings/semantic-index-db.0.mdb/lock.mdb
Normal file
BIN
zed/zed/embeddings/semantic-index-db.0.mdb/lock.mdb
Normal file
Binary file not shown.
BIN
zed/zed/prompts/prompts-library-db.0.mdb/data.mdb
Normal file
BIN
zed/zed/prompts/prompts-library-db.0.mdb/data.mdb
Normal file
Binary file not shown.
BIN
zed/zed/prompts/prompts-library-db.0.mdb/lock.mdb
Normal file
BIN
zed/zed/prompts/prompts-library-db.0.mdb/lock.mdb
Normal file
Binary file not shown.
13
zed/zed/settings.json
Normal file
13
zed/zed/settings.json
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// Zed settings
|
||||||
|
//
|
||||||
|
// For information on how to configure Zed, see the Zed
|
||||||
|
// documentation: https://zed.dev/docs/configuring-zed
|
||||||
|
//
|
||||||
|
// To see all of Zed's default settings without changing your
|
||||||
|
// custom settings, run the `open default settings` command
|
||||||
|
// from the command palette or from `Zed` application menu.
|
||||||
|
{
|
||||||
|
"vim_mode": true,
|
||||||
|
"ui_font_size": 16,
|
||||||
|
"buffer_font_size": 16
|
||||||
|
}
|
Reference in New Issue
Block a user