66 lines
2.1 KiB
VimL
66 lines
2.1 KiB
VimL
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) -----------------------------
|
|
" -------------------------------------------------------------------
|
|
|
|
" <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
|
|
vnoremap Q !$SHELL<CR>
|
|
nnoremap Q !!$SHELL<CR>
|
|
|
|
" \j like J, but append current line to the line below
|
|
nnoremap <Leader>j ddpkJ
|
|
|
|
" move the current line down/up one
|
|
nnoremap - :move +1 <CR>
|
|
nnoremap _ :move -2 <CR>
|
|
|
|
" \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>
|
|
|
|
" (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 <Leader>c :w !' . g:clipboard_copy . '<CR><CR>'
|
|
execute 'nnoremap <Leader>v o<esc>!!' . g:clipboard_paste . '<CR>'
|
|
execute "nnoremap <Leader>sc :'<,'>w !" . g:clipboard_copy . '<CR><CR>'
|
|
|
|
" enable/disable true color
|
|
nnoremap <f12> :set invtermguicolors<CR>
|
|
|
|
" -------------------------------------------------------------------
|
|
" --- available / rarely used bindings (personal reference) ---------
|
|
" -------------------------------------------------------------------
|
|
|
|
" nnoremap <BS>
|
|
" nnoremap <C-t>
|
|
" nnoremap <C-b>
|
|
" nnoremap z
|
|
" nnoremap ^
|