diff options
-rw-r--r-- | vim.nix | 16 | ||||
-rw-r--r-- | vimrc | 35 |
2 files changed, 50 insertions, 1 deletions
@@ -0,0 +1,16 @@ +{ ... }: + +{ + programs.vim = { + enable = true; + plugins = [ + "ctrlp" + "fugitive" + "editorconfig-vim" + "surround" + "vim-colorschemes" + "vim-ripgrep" + ]; + extraConfig = builtins.readFile ../vimrc; + }; +} @@ -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 |