diff options
author | Ben Sima <bsima@groq.com> | 2019-06-11 13:40:01 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2019-07-09 15:49:50 -0700 |
commit | f2bce08b9412b0b50d3d7af8dff7903b40f13bff (patch) | |
tree | 39a89bcfd1767db030dea40d56e89ccf9ced411c /vimrc | |
parent | 0176935d1d53b71555b4809d08b1195fe80c4b2e (diff) |
migrate vim to use home-manager settings
Diffstat (limited to 'vimrc')
-rw-r--r-- | vimrc | 35 |
1 files changed, 34 insertions, 1 deletions
@@ -30,11 +30,34 @@ if has('syntax') && !exists('g:syntax_on') syntax enable endif -""" Mappings +""" Simple Mappings +let maplocalleader = "," + +" easy escape imap fd <Esc> + " send to ix.io noremap <silent> <leader>i :w !ix<CR> +" edit files and buffers, relative to local +nmap ,e :edit +nmap ;e :edit <C-R>=expand("%:h") . "/" <CR> +nmap ,o :buffer +nmap ;o :buffer <C-R>=expand("%:h") . "/" <CR> + +" list buffers +nmap ,l :ls<cr> + +" delete buffer +nmap ,u :bdelete<cr> + +" ,d insert current date +nmap <silent> ,d :r !date +\%Y.\%m.\%d<cr> +nmap <silent> ,D :r !date +\%Y.\%m.\%d..\%H.\%M.\%S<cr> + +" grep (ripgrep) +nmap ,g :Rg + " Use <C-L> to clear the highlighting of :set hlsearch. if maparg('<C-L>', 'n') ==# '' nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L> @@ -59,3 +82,13 @@ map <A-]> :vsp <CR>:exec("tag ".expand("<cword>"))<CR> set termguicolors let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum" let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum" + +""" Plugins with vim-plug +" 2019.06.11: disabling b/c I'd rather just use nix/home-manager for vim +" plugins, but this is nice code to have for reference too +"if empty(glob('~/.vim/autoload/plug.vim')) +" silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs +" \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim +" autocmd VimEnter * PlugInstall --sync | source $MYVIMRC +"endif +"so ~/.vim/plugins.vim |