summaryrefslogtreecommitdiff
path: root/vimrc
diff options
context:
space:
mode:
authorBen Sima <bsima@groq.com>2019-06-11 13:40:01 -0700
committerBen Sima <ben@bsima.me>2019-07-09 15:49:50 -0700
commitf2bce08b9412b0b50d3d7af8dff7903b40f13bff (patch)
tree39a89bcfd1767db030dea40d56e89ccf9ced411c /vimrc
parent0176935d1d53b71555b4809d08b1195fe80c4b2e (diff)
migrate vim to use home-manager settings
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc35
1 files changed, 34 insertions, 1 deletions
diff --git a/vimrc b/vimrc
index 4c51ef1..5da401c 100644
--- a/vimrc
+++ b/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