dotwryn/vim/rc.vim

85 lines
2.5 KiB
VimL
Raw Normal View History

2022-02-06 07:15:14 +00:00
source $HOME/.config/wryn/env.vim
2019-06-07 22:13:06 +00:00
2020-09-10 19:38:42 +00:00
if isdirectory(expand("$HOME/.vim/bundle/Vundle.vim"))
2021-02-25 00:38:02 +00:00
source $WRYNVIMPATH/vundle.vim
2020-09-10 19:38:42 +00:00
endif
2021-02-25 00:38:02 +00:00
source $WRYNVIMPATH/options.vim
source $WRYNVIMPATH/execute.vim
2021-02-25 00:38:02 +00:00
source $WRYNVIMPATH/formatting.vim
source $WRYNVIMPATH/navigation.vim
source $WRYNVIMPATH/color.vim
source $WRYNVIMPATH/utility.vim
2021-02-25 00:38:02 +00:00
2022-08-09 23:56:06 +00:00
" ---------------------------------------------------------------------
" {{{
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 :'<,'>
2022-08-09 23:56:06 +00:00
" (e)dit / (s)ource vimrc
nnoremap <Leader>ev :tabedit $WRYNVIMRC<CR>
nnoremap <Leader>sv :source $MYVIMRC<CR>
2021-02-25 00:38:02 +00:00
2022-08-09 23:56:06 +00:00
" Q to replace current line/selection with bash execution
vnoremap Q !$SHELL<CR>
nnoremap Q !!$SHELL<CR>
2021-02-25 00:38:02 +00:00
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
" \j like J, but append current line to the line below
nnoremap <Leader>j ddpkJ
" \d insert formatted date below
nnoremap <Leader>d :let @d = system("date '+%A, %B %-d, %Y'")<CR>o<C-r>d<BS> <esc>
" \g git fugitive shortcuts
nnoremap <Leader>gb :Git blame<CR>
2021-02-25 00:38:02 +00:00
2022-08-09 23:56:06 +00:00
" \r = open last REPL (p)ython (n)odejs (c)lisp
nnoremap <Leader>r q:?^echom 'quickrepl'<CR><CR>
nnoremap <Leader>rp q:oechom 'quickrepl' \| call ExecuteCommand('bpython', 'split-pane-vertical')<CR>
nnoremap <Leader>rn q:oechom 'quickrepl' \| call ExecuteCommand('node', 'split-pane-vertical')<CR>
nnoremap <Leader>rc q:oechom 'quickrepl' \| call ExecuteCommand('clisp', 'split-pane-horizontal')<CR>
nnoremap <Leader>rs q:oechom 'quickrepl' \| call ExecuteCommand('zsh -l', 'split-pane-vertical')<CR>
2021-02-25 00:38:02 +00:00
2022-08-09 23:56:06 +00:00
" \t = run last quicktest
" t)ype new quicktest
" e)dit last quicktest
2022-08-23 19:57:14 +00:00
nnoremap <Leader>t q:?^echom 'quicktest'<CR><CR><CR>
nnoremap <Leader>tt q:oechom 'quicktest' \| call ExecuteCommand('')<ESC>F'i
2022-08-09 23:56:06 +00:00
nnoremap <Leader>te q:?^echom 'quicktest'<CR>
2021-02-25 00:38:02 +00:00
2022-08-09 23:56:06 +00:00
" ./utility.vim
nnoremap <Leader><Leader>w :call Sudowrite()<CR>
nnoremap <Leader><Leader>x :call MakeFileExecutable(0)<CR>
nnoremap <Leader><Leader>xx :call MakeFileExecutable(1)<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>
2022-08-09 23:56:06 +00:00
" --- 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 ^
2020-09-22 04:54:55 +00:00
" }}}
2022-08-09 23:56:06 +00:00
" ---------------------------------------------------------------------