diff options
Diffstat (limited to 'files/vim')
| -rw-r--r-- | files/vim/autoload/Juliana.vim | 2 | ||||
| -rw-r--r-- | files/vim/colors/lil_pablo.vim | 14 | ||||
| -rw-r--r-- | files/vim/vimrc | 52 |
3 files changed, 36 insertions, 32 deletions
diff --git a/files/vim/autoload/Juliana.vim b/files/vim/autoload/Juliana.vim index 492f3d5..660aa17 100644 --- a/files/vim/autoload/Juliana.vim +++ b/files/vim/autoload/Juliana.vim @@ -15,7 +15,6 @@ function! Juliana#CompleteTab(type) let g:Juliana#stop = 0 return "" endif - if !g:Juliana#stop " Vanilla <Tab> if we are at the front of a line. if a:type == "TAB" && col(".") >= col("$") && !pumvisible() @@ -33,7 +32,6 @@ function! Juliana#CompleteTab(type) return "\<C-n>" endif endif - return "" endfunction diff --git a/files/vim/colors/lil_pablo.vim b/files/vim/colors/lil_pablo.vim index 555ac4c..4bc3f61 100644 --- a/files/vim/colors/lil_pablo.vim +++ b/files/vim/colors/lil_pablo.vim @@ -10,11 +10,12 @@ set background=dark hi clear let g:colors_name = 'lil_pablo' +" @TODO: 'fg' is not valid for ctermfg/bg, it's 7. " :%s/gui\(bg\|fg\)=\(#[0-9a-f]*\|NONE\) //g " :%s/cterm\(bg\|fg\)=\([0-9]*\|NONE\|fg\)\ /cterm\1=\2\ gui\1=##\2##\ /g " :%s/##NONE##/NONE/g -hi Normal ctermfg=15 guifg=#ffffff ctermbg=0 guibg=#000000 cterm=NONE +hi Normal ctermfg=7 guifg=#eeeeee ctermbg=0 guibg=#000000 cterm=NONE hi Comment ctermfg=8 guifg=#808080 ctermbg=NONE guibg=NONE cterm=NONE hi Constant ctermfg=9 guifg=#d78700 ctermbg=NONE guibg=NONE cterm=NONE hi Identifier ctermfg=6 guifg=#ffaf00 ctermbg=NONE guibg=NONE cterm=NONE @@ -29,12 +30,13 @@ hi Todo ctermfg=0 guifg=#000000 ctermbg=3 guibg=#ffd75f cterm=NONE hi Conceal ctermfg=8 guifg=#808080 ctermbg=NONE guibg=NONE cterm=NONE hi Cursor ctermfg=0 guifg=#000000 ctermbg=15 guibg=#ffffff cterm=NONE hi lCursor ctermfg=0 guifg=#000000 ctermbg=15 guibg=#ffffff cterm=NONE -hi CursorIM ctermfg=NONE guifg=NONE ctermbg=fg guibg=#eeeeee cterm=NONE +hi CursorIM ctermfg=NONE guifg=NONE ctermbg=7 guibg=#eeeeee cterm=NONE hi Title ctermfg=13 guifg=#ff8787 ctermbg=NONE guibg=NONE cterm=bold hi Directory ctermfg=2 guifg=#af5f00 ctermbg=NONE guibg=NONE cterm=NONE hi Search ctermfg=0 guifg=#000000 ctermbg=3 guibg=#ffd75f cterm=NONE hi IncSearch ctermfg=15 guifg=#ffffff ctermbg=NONE guibg=NONE cterm=reverse -hi NonText ctermfg=12 guifg=#00875f ctermbg=NONE guibg=NONE cterm=bold +hi NonText cterm=NONE ctermfg=NONE +"hi NonText ctermfg=12 guifg=#00875f ctermbg=NONE guibg=NONE cterm=bold hi EndOfBuffer ctermfg=12 guifg=#00875f ctermbg=NONE guibg=NONE cterm=bold hi ErrorMsg ctermfg=15 guifg=#ffffff ctermbg=1 guibg=#d75f00 cterm=NONE hi WarningMsg ctermfg=9 guifg=#d78700 ctermbg=NONE guibg=NONE cterm=NONE @@ -50,7 +52,7 @@ hi VisualNOS ctermfg=NONE guifg=NONE ctermbg=0 guibg=#000000 cterm=underline hi LineNr ctermfg=8 guifg=#808080 ctermbg=NONE guibg=NONE cterm=NONE hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr -hi MatchParen ctermfg=NONE guifg=NONE ctermbg=6 guibg=#ffaf00 cterm=NONE +hi MatchParen ctermfg=15 guifg=#ffffff ctermbg=NONE guibg=NONE cterm=NONE hi ModeMsg ctermfg=NONE guifg=NONE ctermbg=NONE guibg=NONE cterm=bold hi MoreMsg ctermfg=12 guifg=#00875f ctermbg=NONE guibg=NONE cterm=bold hi Question ctermfg=10 guifg=#af8700 ctermbg=NONE guibg=NONE cterm=bold @@ -69,9 +71,9 @@ hi TabLineFill ctermfg=NONE guifg=NONE ctermbg=0 guibg=#000000 cterm=reverse hi TabLineSel ctermfg=15 guifg=#ffffff ctermbg=0 guibg=#000000 cterm=bold hi ToolbarLine ctermfg=NONE guifg=NONE ctermbg=0 guibg=#000000 cterm=NONE hi ToolbarButton ctermfg=0 guifg=#000000 ctermbg=7 guibg=#eeeeee cterm=bold -hi PmenuMatch ctermfg=fg guifg=#eeeeee ctermbg=8 guibg=#808080 cterm=bold +hi PmenuMatch ctermfg=7 guifg=#eeeeee ctermbg=8 guibg=#808080 cterm=bold hi PmenuMatchSel ctermfg=0 guifg=#000000 ctermbg=7 guibg=#eeeeee cterm=bold -hi Pmenu ctermfg=fg guifg=#eeeeee ctermbg=8 guibg=#808080 cterm=NONE +hi Pmenu ctermfg=7 guifg=#eeeeee ctermbg=8 guibg=#808080 cterm=NONE hi PmenuSbar ctermfg=NONE guifg=NONE ctermbg=NONE guibg=NONE cterm=NONE hi PmenuSel ctermfg=0 guifg=#000000 ctermbg=7 guibg=#eeeeee cterm=NONE hi PmenuThumb ctermfg=NONE guifg=NONE ctermbg=15 guibg=#ffffff cterm=NONE diff --git a/files/vim/vimrc b/files/vim/vimrc index 93d1215..dcf832b 100644 --- a/files/vim/vimrc +++ b/files/vim/vimrc @@ -1,3 +1,5 @@ +" @TODO: CullSubprojects from sessions command. + " Basic settings. set nocompatible set number @@ -19,6 +21,7 @@ set splitright set splitbelow " Stop buffers from jumping when opening buffer selection. set splitkeep=screen +"set guicursor=n-v-c:block-Cursor,o:hor50,i-ci:hor15,r-cr:hor30,sm:block-Cursor set termguicolors colo lil_pablo @@ -65,7 +68,6 @@ set title au BufEnter * let &titlestring=expand("%:t") " https://github.com/csdvrx/CuteVim/blob/main/.vimrc - " Allow distinguishing <C-i> from <Tab> in bindings. " If using vim rather than neovim, this will disable the ability " to map <C-h/j/k/l>. Apparently due to vim's lack of "CSI u" @@ -116,7 +118,7 @@ if isdirectory(expand("~/c")) endif " Staggered backups. - let backup_dir = "/mnt/store/backup/vim" + let backup_dir = "/mnt/store/backup/vim//" if !isdirectory(backup_dir) let backup_dir = expand("~/c/sessions/backup//") if !isdirectory(backup_dir) @@ -139,13 +141,13 @@ packadd vim-gitbranch packadd vim-asciidoc-folding packadd Colorizer "if !empty($NIX_SHELL) -"packadd lsp -"call LspAddServer([#{ -"\ name: 'clangd', -"\ filetype: ['c', 'cpp'], -"\ path: 'clangd', -"\ args: ['--background-index'] -"\}]) +" packadd lsp +" call LspAddServer([#{ +" \ name: 'clangd', +" \ filetype: ['c', 'cpp'], +" \ path: 'clangd', +" \ args: ['--background-index'] +" \}]) "endif " Custom statusline. @@ -210,7 +212,7 @@ nmap <silent> \ :call QNameInit(1)<CR>:~ nmap <silent> Y :vertical G<CR> " Relative :e, :vs, and :s. -fun OpenBasedOnRelativeArgument(A, CMD) +function OpenBasedOnRelativeArgument(A, CMD) " https://stackoverflow.com/a/14348204 let arg = a:A if arg != "" @@ -220,13 +222,13 @@ fun OpenBasedOnRelativeArgument(A, CMD) exe "edit" arg elseif a:CMD == "VERTICAL_SPLIT" exe "vsplit" arg - elseif a:CMD == "SPLIT" + elseif a:CMD == "HORIZONTAL_SPLIT" exe "split" arg endif -endfun +endfunction command -nargs=* -complete=customlist,RelativeFileComplete E :call OpenBasedOnRelativeArgument("<args>", "EDIT") command -nargs=* -complete=customlist,RelativeFileComplete VS :call OpenBasedOnRelativeArgument("<args>", "VERTICAL_SPLIT") -command -nargs=* -complete=customlist,RelativeFileComplete S :call OpenBasedOnRelativeArgument("<args>", "SPLIT") +command -nargs=* -complete=customlist,RelativeFileComplete HS :call OpenBasedOnRelativeArgument("<args>", "HORIZONTAL_SPLIT") fun RelativeFileComplete(A,L,P) let argpath = fnamemodify(a:A, ":h") if argpath[0] == "~" || argpath[0] == "/" @@ -244,13 +246,14 @@ fun RelativeFileComplete(A,L,P) let files[i] = substitute(files[i], curpath, "", "") let files[i] = substitute(files[i], "^./", "", "") endif + let files[i] = fnameescape(files[i]) endfor return files -endfun +endfunction " https://stackoverflow.com/a/20564623 cnoreabbrev <expr> e getcmdtype() == ":" && getcmdline() == "e" ? "E" : "e" cnoreabbrev <expr> vs getcmdtype() == ":" && getcmdline() == "vs" ? "VS" : "vs" -cnoreabbrev <expr> s getcmdtype() == ":" && getcmdline() == "s" ? "S" : "s" +cnoreabbrev <expr> hs getcmdtype() == ":" && getcmdline() == "hs" ? "HS" : "hs" " :no -> :nohlsearch instead of :noremap. cnoreabbrev <expr> no getcmdtype() == ":" && getcmdline() == "no" ? "nohlsearch" : "no" @@ -271,25 +274,26 @@ command Hex :%!xxd command Unhex :%!xxd -r " https://stackoverflow.com/a/27721306 -"command -nargs=+ Ggr execute 'Ggrep! -q' <q-args> -command -nargs=+ Ggr execute "silent Ggrep!" <q-args> | botright cwindow | redraw! +command -nargs=+ Ggr exe "silent Ggrep!" <q-args> | botright cwindow | redraw! " I had this mapped to <C-i> for the longest time. Sadly with OG vim " (not neovim) the fix for mapping <Tab> and <C-i> seperately doesn't work. " Changing this bind as the only concession to be compatible with vim " seems well worth it. nnoremap <C-o> :Ggr -"" https://stackoverflow.com/a/37040415 -function! SyntaxGroup() - let l:s = synID(line("."), col("."), 1) - echo synIDattr(l:s, "name") . " -> " . synIDattr(synIDtrans(l:s), "name") -endfun -command Syn :call SyntaxGroup() +command GrepWhitespace :Ggr '[[:blank:]]$' " https://vi.stackexchange.com/a/456 function! TrimWhitespace() let l:save = winsaveview() keeppatterns %s/\s\+$//e call winrestview(l:save) -endfun +endfunction command Trim :call TrimWhitespace() + +"" https://stackoverflow.com/a/37040415 +function! SyntaxGroup() + let l:s = synID(line("."), col("."), 1) + echo synIDattr(l:s, "name") . " -> " . synIDattr(synIDtrans(l:s), "name") +endfunction +command Syn :call SyntaxGroup() |