2024-05-07 16:38:40 -06:00
|
|
|
if empty($DOTWRYN)
|
2024-08-16 09:41:26 -06:00
|
|
|
if !empty(glob(expand("$HOME/.wryn")))
|
|
|
|
let $DOTWRYN=expand("$HOME/.wryn")
|
|
|
|
elseif !empty(glob(expand("$XDG_DATA_HOME/wryn")))
|
|
|
|
let $DOTWRYN=expand("$XDG_DATA_HOME/wryn")
|
|
|
|
else
|
|
|
|
let $DOTWRYN=expand("$HOME/.local/share/wryn")
|
|
|
|
endif
|
2020-09-10 19:38:42 +00:00
|
|
|
endif
|
2019-08-06 14:41:27 -06:00
|
|
|
|
2024-05-07 16:38:40 -06:00
|
|
|
let $VIMRC=expand("$DOTWRYN/vim/rc.vim")
|
|
|
|
for vimrcfile in split(trim(system("find " . expand("$DOTWRYN/vim/rc.d") . " -type f | sort -u")), '\n')
|
|
|
|
execute 'source ' . vimrcfile
|
|
|
|
endfor
|
2023-11-13 16:35:35 -07:00
|
|
|
|
2024-05-07 16:38:40 -06:00
|
|
|
" -------------------------------------------------------------------
|
|
|
|
" --- generic bindings (easy reference) -----------------------------
|
|
|
|
" -------------------------------------------------------------------
|
2021-02-24 17:38:02 -07:00
|
|
|
|
|
|
|
" <SPACE> to execute macro on q
|
|
|
|
nnoremap <Space> @q
|
|
|
|
|
|
|
|
" \q for `q:`
|
|
|
|
nnoremap <Leader>q q:
|
|
|
|
|
|
|
|
" \s previous selection command
|
|
|
|
nnoremap <Leader>s :'<,'>
|
|
|
|
|
2024-05-07 16:38:40 -06:00
|
|
|
" Q to replace current line(s) with shell execution
|
2022-08-09 17:56:06 -06:00
|
|
|
vnoremap Q !$SHELL<CR>
|
|
|
|
nnoremap Q !!$SHELL<CR>
|
2021-02-24 17:38:02 -07:00
|
|
|
|
2024-05-07 16:38:40 -06:00
|
|
|
" \j like J, but append current line to the line below
|
|
|
|
nnoremap <Leader>j ddpkJ
|
|
|
|
|
2022-08-09 17:56:06 -06:00
|
|
|
" move the current line down/up one
|
2021-04-09 15:13:58 -06:00
|
|
|
nnoremap - :move +1 <CR>
|
|
|
|
nnoremap _ :move -2 <CR>
|
2021-02-24 17:38:02 -07:00
|
|
|
|
2022-08-09 17:56:06 -06:00
|
|
|
" \d insert formatted date below
|
|
|
|
nnoremap <Leader>d :let @d = system("date '+%A, %B %-d, %Y'")<CR>o<C-r>d<BS> <esc>
|
|
|
|
|
2024-05-07 16:38:40 -06:00
|
|
|
" \m to set buffer to modifiable
|
|
|
|
nnoremap <Leader>m :set modifiable<CR>
|
2021-02-24 17:38:02 -07:00
|
|
|
|
2022-08-09 17:56:06 -06:00
|
|
|
" (c)opy / (p)aste from xclip
|
|
|
|
" TODO: learn how to compile vim with x11 compatibility and delete
|
2021-02-24 17:38:02 -07:00
|
|
|
vnoremap <Leader>c :w !xclip<CR><CR>
|
|
|
|
nnoremap <Leader>v o<esc>!!xclip -o<CR>
|
|
|
|
nnoremap <Leader>sc :'<,'>w !xclip<CR><CR>
|
|
|
|
|
2022-08-17 12:17:00 -06:00
|
|
|
" enable/disable true color
|
|
|
|
nnoremap <f12> :set invtermguicolors<CR>
|
|
|
|
|
2024-05-07 16:38:40 -06:00
|
|
|
" -------------------------------------------------------------------
|
|
|
|
" --- available / rarely used bindings (personal reference) ---------
|
|
|
|
" -------------------------------------------------------------------
|
2021-02-24 17:38:02 -07:00
|
|
|
|
|
|
|
" nnoremap <BS>
|
|
|
|
" nnoremap <C-t>
|
|
|
|
" nnoremap <C-b>
|
|
|
|
" nnoremap z
|
|
|
|
" nnoremap ^
|