dotfiles

<-- duh.
Log | Files | Refs | LICENSE

commit 63f5face2a3ecd7056b636192da185766af24b29
parent d4afc605f6805b9450f22c2f001ba5aad39c4f22
Author: Hayden Hamilton <hayden@haydenvh.com>
Date:   Thu, 12 Mar 2020 22:11:19 +0000

nvimvimvim

Diffstat:
M.config/nvim/init.vim | 3+++
M.config/nvim/modules/message.vim | 75+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------
M.config/nvim/modules/tabs.vim | 2+-
M.config/nvim/syntax/recent.vim | 4++--
4 files changed, 71 insertions(+), 13 deletions(-)

diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim @@ -193,4 +193,7 @@ augroup autocmd "C autocmd FileType C :noremap <buffer> <leader>end $a;<esc> autocmd FileType C :inoremap <buffer> <leader><leader>end <esc>$a;<esc> + + "Numbers + autocmd BufRead,BufNewFile,WinEnter,BufEnter * setlocal number relativenumber augroup END diff --git a/.config/nvim/modules/message.vim b/.config/nvim/modules/message.vim @@ -30,25 +30,29 @@ function! LauncherRecent() let olist=v:oldfiles let i=0 - redir! >/tmp/vim-recent | silent! echo ' Press "q" to open empty buffer, "Q" to quit, or any key below:' | silent! echo '' | silent! echo ' Recent files:' | redir END + redir! >/tmp/vim-recent | silent! echo ' "q"=empty buffer, "Q"=quit, all else below:' | silent! echo '' | silent! echo ' Recent files:' | redir END redir! >/tmp/vim-recent.1 | silent! echo '' | silent! echo '' | silent! echo 'Config files:' | redir END redir! >/tmp/vim-recent.2 | silent! echo '' | silent! echo '' | silent! echo 'Recent files (cwd):' | redir END + redir! >/tmp/vim-recent.3 | silent! echo '' | silent! echo '' | silent! echo 'General:' | redir END redir! >/tmp/vim-recentcmd.vim | silent! echo ':silent! unmap <buffer> q' | silent! echo 'nnoremap <buffer> q :q<CR>:new<CR>:only<CR>' | silent! echo ':silent! unmap <buffer>Q' | silent! echo ':no <buffer> Q :qa!<CR>' | silent! echo ':nnoremap <buffer>: <CR>' | redir END for string in olist + let string=substitute(string, $HOME, "~", "") if i=='10' break + elseif stridx(string, "NetrwTreeListing") == '-1' && stridx(string, "/tmp/vim-recent") == '-1' && stridx(string, expand("~/.config/nvim/startup.greet")) == '-1' + redir >>/tmp/vim-recent | silent! echo ' [' . i . '] ' . string | redir END + redir >>/tmp/vim-recentcmd.vim | silent! echo ':silent! unmap <buffer> ' . i | silent! echo ':nnoremap <buffer> ' . i . ' :q<CR>:edit ' . string '<CR>' | redir END + else + continue endif - redir >>/tmp/vim-recent | silent! echo ' [' . i . '] ' . string | redir END - redir >>/tmp/vim-recentcmd.vim | silent! echo ':silent! unmap <buffer> ' . i | silent! echo ':nnoremap <buffer> ' . i . ' :q<CR>:edit ' . string '<CR>' | redir END let i+=1 endfor - let dir=getcwd() let i=10 for string in olist + let string=substitute(string, $HOME, "~", "") if i=='20' break - endif - if stridx(string, dir) != '-1' + elseif stridx(string, "~") != '-1' && stridx(string, "NetrwTreeListing") == '-1' && stridx(string, "/tmp/vim-recent") == '-1' && stridx(string, expand("~/.config/nvim/startup.greet")) == '-1' redir >>/tmp/vim-recent.2 | silent! echo '[' . i . '] ' . string | redir END redir >>/tmp/vim-recentcmd.vim | silent! echo ':silent! unmap <buffer> ' . i | silent! echo ':nnoremap <buffer> ' . i . ' :q<CR>:edit ' . string '<CR>' | redir END else @@ -57,6 +61,7 @@ function! LauncherRecent() let i+=1 endfor call LauncherConfig() + call LauncherGeneral() call LauncherFileMerge() let null=system("rm $HOME/.local/share/nvim/swap/%tmp%vim-recent.swp") edit! /tmp/vim-recent @@ -73,23 +78,40 @@ endfunction function! LauncherConfig() let configs=[ + \":Explore ~/.config/", \":edit ~/.config/nvim/init.vim", \":Explore ~/.config/nvim/modules" \] - - let i=1 + let g:i=1 for config in configs - let a=Itoa(i) + let a=Itoa(g:i) redir! >/tmp/vim-config-dict | silent! echo config | redir END let string=system("awk '{$1=\"\";print $0}' < /tmp/vim-config-dict | tr -d '\n\r'") redir >>/tmp/vim-recent.1 | silent! echo '[' . a . '] ' . string | redir END redir >>/tmp/vim-recentcmd.vim | silent! echo ':silent! unmap <buffer> ' . a | silent! echo ':nnoremap <buffer> ' . a . ' :q<CR>' . config . '<CR>' | redir END - let i+=1 + let g:i+=1 endfor endfunction +function! LauncherGeneral() + let general=[ + \":chdir ::: Change Directory", + \":set path=::: Set (vim) path", + \] + for gen in general + let a=Itoa(g:i) + redir! >/tmp/vim-config-dict | silent! echo gen | redir END + let string=system("grep -o ':::.*$' < /tmp/vim-config-dict | sed 's/^::://' | tr -d '\n\r'") + let cmd=system("grep -o '^.*:::' < /tmp/vim-config-dict | sed 's/:::$//' | tr -d '\n\r'") + + redir >>/tmp/vim-recent.3 | silent! echo '[' . a . ']' . string | redir END + redir >>/tmp/vim-recentcmd.vim | silent! echo ':silent! unmap <buffer> ' . a | silent! echo ':nnoremap <buffer> ' . a . ' :call LauncherGeneral' . a . '("")<left><left>' | silent! echo 'silent! function! LauncherGeneral' . a . '(arg)' | silent! echo 'execute "' . cmd . '" . a:arg' | silent! echo "call LauncherRecent()" | silent! echo 'endfunction'| redir END + let g:i+=1 + endfor +endfunction + function Itoa(i) let i=a:i let a='' @@ -113,7 +135,40 @@ function Itoa(i) let a='i' elseif i=='10' let a='j' + elseif i=='11' + let a='k' + elseif i=='12' + let a='l' + elseif i=='13' + let a='m' + elseif i=='14' + let a='n' + elseif i=='15' + let a='o' + elseif i=='16' + let a='p' + elseif i=='17' + let a='q' + elseif i=='18' + let a='r' + elseif i=='19' + let a='s' + elseif i=='20' + let a='t' + elseif i=='21' + let a='u' + elseif i=='22' + let a='v' + elseif i=='23' + let a='w' + elseif i=='24' + let a='z' + elseif i=='25' + let a='y' + elseif i=='26' + let a='z' endif + return a endfunction diff --git a/.config/nvim/modules/tabs.vim b/.config/nvim/modules/tabs.vim @@ -1,5 +1,5 @@ hi TabLine cterm=none ctermfg=252 ctermbg=1 -hi TabLineSel cterm=bold ctermfg=252 ctermbg=0 +hi TabLineSel cterm=bold ctermfg=252 ctermbg=3 hi TabLineFill cterm=none ctermfg=none ctermbg=1 nnoremap <leader>te :tabedit diff --git a/.config/nvim/syntax/recent.vim b/.config/nvim/syntax/recent.vim @@ -4,7 +4,7 @@ endif syn match rNum '\[[0-9]*\]' syn match rChar '\[[A-Za-z]*\]' -syn match Head '^\s*[A-Za-z0-9].*' +syn match rHead '^\s*["A-Za-z0-9].*' hi rNum cterm=none ctermfg=30 hi rChar cterm=none ctermfg=28 -hi Head cterm=bold ctermfg=255 +hi rHead cterm=bold ctermfg=255