dotwryn/vim/rc.vim

64 lines
1.8 KiB
VimL
Raw Normal View History

if empty($DOTWRYN)
2024-08-16 15:41:26 +00: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
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 23:35:35 +00:00
" -------------------------------------------------------------------
" --- generic bindings (easy reference) -----------------------------
" -------------------------------------------------------------------
2021-02-25 00:38:02 +00:00
" <SPACE> to execute macro on q
nnoremap <Space> @q
" \q for `q:`
nnoremap <Leader>q q:
" \s previous selection command
nnoremap <Leader>s :'<,'>
" Q to replace current line(s) with shell execution
2022-08-09 23:56:06 +00:00
vnoremap Q !$SHELL<CR>
nnoremap Q !!$SHELL<CR>
2021-02-25 00:38:02 +00:00
" \j like J, but append current line to the line below
nnoremap <Leader>j ddpkJ
2022-08-09 23:56:06 +00:00
" move the current line down/up one
nnoremap - :move +1 <CR>
nnoremap _ :move -2 <CR>
2021-02-25 00:38:02 +00:00
2022-08-09 23:56:06 +00:00
" \d insert formatted date below
nnoremap <Leader>d :let @d = system("date '+%A, %B %-d, %Y'")<CR>o<C-r>d<BS> <esc>
" \m to set buffer to modifiable
nnoremap <Leader>m :set modifiable<CR>
2021-02-25 00:38:02 +00:00
2022-08-09 23:56:06 +00:00
" (c)opy / (p)aste from xclip
" TODO: learn how to compile vim with x11 compatibility and delete
2021-02-25 00:38:02 +00:00
vnoremap <Leader>c :w !xclip<CR><CR>
nnoremap <Leader>v o<esc>!!xclip -o<CR>
nnoremap <Leader>sc :'<,'>w !xclip<CR><CR>
" enable/disable true color
nnoremap <f12> :set invtermguicolors<CR>
" -------------------------------------------------------------------
" --- available / rarely used bindings (personal reference) ---------
" -------------------------------------------------------------------
2021-02-25 00:38:02 +00:00
" nnoremap <BS>
" nnoremap <C-t>
" nnoremap <C-b>
" nnoremap z
" nnoremap ^