if empty($DOTWRYN) 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 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 " ------------------------------------------------------------------- " --- generic bindings (easy reference) ----------------------------- " ------------------------------------------------------------------- " to execute macro on q nnoremap @q " \q for `q:` nnoremap q q: " \s previous selection command nnoremap s :'<,'> " Q to replace current line(s) with shell execution vnoremap Q !$SHELL nnoremap Q !!$SHELL " \j like J, but append current line to the line below nnoremap j ddpkJ " move the current line down/up one nnoremap - :move +1 nnoremap _ :move -2 " \d insert formatted date below nnoremap d :let @d = system("date '+%A, %B %-d, %Y'")od " \m to set buffer to modifiable nnoremap m :set modifiable " (c)opy / (p)aste from the system clipboard " wayland (local or through waypipe) uses wl-clipboard; otherwise falls back to xclip let g:clipboard_copy = empty($WAYLAND_DISPLAY) ? 'xclip -selection clipboard' : 'wl-copy' let g:clipboard_paste = empty($WAYLAND_DISPLAY) ? 'xclip -selection clipboard -o' : 'wl-paste -n' execute 'vnoremap c :w !' . g:clipboard_copy . '' execute 'nnoremap v o!!' . g:clipboard_paste . '' execute "nnoremap sc :'<,'>w !" . g:clipboard_copy . '' " enable/disable true color nnoremap :set invtermguicolors " ------------------------------------------------------------------- " --- available / rarely used bindings (personal reference) --------- " ------------------------------------------------------------------- " nnoremap " nnoremap " nnoremap " nnoremap z " nnoremap ^