# HG changeset patch # User Meredith Howard # Date 1514685410 18000 # Node ID 807f6539d9cc8a3d879c8f9a4c7135a9c9a8dc49 # Parent 66ba2d6498598363185f2531d53d51740b99c08c housekeeping diff --git a/.vimrc b/.vimrc --- a/.vimrc +++ b/.vimrc @@ -1,7 +1,6 @@ " vim: et sts=2 sw=2 " vim: fdm=marker -set nocompatible set encoding=utf-8 scriptencoding utf-8 @@ -64,65 +63,65 @@ let s:filename = expand('') " }}} " Key maps {{{ -nmap :Unite buffer -nmap :VimFilerExplorer -map :noh -nmap :GundoToggle -nmap :TagbarToggle +nnoremap :Unite buffer +nnoremap :VimFilerExplorer +noremap :noh +nnoremap :GundoToggle +nnoremap :TagbarToggle -nmap uw :Unite -quick-match -short-source-names window tab:no-current -nmap us :Unite -quick-match session -nmap uf :Unite -start-insert file_rec/async:! +nnoremap uw :Unite -quick-match -short-source-names window tab:no-current +nnoremap us :Unite -quick-match session +nnoremap uf :Unite -start-insert file_rec/async:! " stop opening help by mistake -imap +inoremap " let F4, :noh work as-is in insert mode imap " chdir to the directory of the open buffer -map cd :cd %:p:h:pwd +noremap cd :cd %:p:h:pwd -map pp :setlocal paste! +noremap pp :setlocal paste! " faster window nav -nmap h -nmap j -nmap k -nmap l -nmap p +nnoremap h +nnoremap j +nnoremap k +nnoremap l +nnoremap p " navigate by on-screen lines nnoremap j v:count ? 'j' : 'gj' nnoremap k v:count ? 'k' : 'gk' " alt buffer -nmap gb -nmap gB :ls:b +nnoremap gb +nnoremap gB :ls:b " Select last paste, in the same mode it was pasted in -nmap gV '`[' . strpart(getregtype(), 0, 1) . '`]' +nnoremap gV '`[' . strpart(getregtype(), 0, 1) . '`]' " Use ltag over tselect -nmap g :call vimrc#Ltag(expand('')) +nnoremap g :call vimrc#Ltag(expand('')) " clear all interestingwords with \\k since \K is ri.vim -nmap k :call UncolorAllWords() +nnoremap k :call UncolorAllWords() " use Ag for a recursive * -nmap g* :call ag#Ag('grep', '--literal ' . shellescape(expand(""))) +nnoremap g* :call ag#Ag('grep', '--literal ' . shellescape(expand(""))) " K: doc, gK: Doc w/o using syntax hints, gKK: doc current filename -nmap K :call ViewDoc('doc', expand('')) -nmap gKK :call ViewDoc('doc', expand('%')) +nnoremap K :call ViewDoc('doc', expand('')) +nnoremap gKK :call ViewDoc('doc', expand('%')) " Tabular shortcuts -map ta :Tabularize first_arrow -map te :Tabularize first_eq -map tc :Tabularize first_colon -map tm :Tabularize methods +noremap ta :Tabularize first_arrow +noremap te :Tabularize first_eq +noremap tc :Tabularize first_colon +noremap tm :Tabularize methods -map a :call vimrc#AutoFmtToggle() +noremap a :call vimrc#AutoFmtToggle() if exists("g:loaded_mucomplete") inoremap mucomplete#popup_exit("\") @@ -264,6 +263,9 @@ augroup vimrc " complement to autowriteall autocmd FocusLost * silent! wa + " Make paths when writing, as necessary + autocmd BufWritePre * :call vimrc#MkNonExDir(expand(''), +expand('')) + " Jump to last known pos autocmd BufReadPost * \ if &filetype !~# 'mail\|^git\|^hg' && line("'\"") >= 1 && line("'\"") <= line("$") | @@ -287,12 +289,6 @@ augroup vimrc autocmd BufNewFile,BufRead neomutt-*-\w\+ setf mail augroup END -" Make paths when writing, as necessary -augroup AutoMkdir - autocmd! - autocmd BufWritePre * :call vimrc#MkNonExDir(expand(''), +expand('')) -augroup END - " https://mjj.io/2015/01/27/encrypting-files-with-gpg-and-vim/ " hacked to work with vimwiki augroup encrypted