From 30a10fd2db947d7ec276b588bfefa34bb0552294 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Tue, 2 Jun 2020 11:17:46 +0100 Subject: [PATCH] vim: remap escape on macos; add vim-test --- vimrc | 68 ++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 22 deletions(-) diff --git a/vimrc b/vimrc index ae97431..657efa9 100644 --- a/vimrc +++ b/vimrc @@ -6,6 +6,18 @@ if empty(glob('~/.vim/autoload/plug.vim')) autocmd VimEnter * PlugInstall --sync | source $MYVIMRC endif +"if has("unix") || has("gui_macvim") +" let s:uname = system("uname -s") +" if s:uname == "Darwin" || has("gui_macvim") +" echom "Remapping Escape" +" "make jj do esc" +" inoremap ยง + +" "make esc do nothing" +" inoremap +" endif +"endif + call plug#begin('~/.vim/plugged') Plug 'junegunn/vim-easy-align/' @@ -15,6 +27,8 @@ call plug#begin('~/.vim/plugged') Plug 'junegunn/gv.vim' Plug 'jreybert/vimagit' + Plug 'janko/vim-test' + Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' Plug 'dracula/vim', { 'as': 'dracula' } @@ -73,22 +87,6 @@ nnoremap viwu nmap cw y/ nmap wp 0v$gq -augroup filetype_elixir - autocmd! - autocmd BufRead * imap ii IO.inspect( - " autocmd BufRead * imap ip IO.puts( -augroup END - -augroup filetype_vue - autocmd! - autocmd BufRead * imap cll console.log()==f(a -augroup END - -augroup filetype_javascript - autocmd! - autocmd BufRead,BufNewFile * imap cll console.log()==f(a -augroup END - set ignorecase smartcase set incsearch @@ -156,11 +154,11 @@ augroup filetype augroup END augroup cppprog - au! - au BufRead,BufNewFile *.h set cindent - au BufRead,BufNewFile *.cc set cindent - au BufRead,BufNewFile *.cpp set cindent - call TabSize(4) + au! + au BufRead,BufNewFile *.h set cindent + au BufRead,BufNewFile *.cc set cindent + au BufRead,BufNewFile *.cpp set cindent + call TabSize(4) augroup END augroup cprog @@ -170,7 +168,24 @@ augroup cprog augroup END " Apply the muttrc colouring to mutt setup files: -au BufNewFile,BufRead .mutt.* set ft=muttrc +au BufNewFile,BufRead .mutt.* set ft=muttrc + +augroup filetype_elixir + autocmd! + autocmd BufRead * imap ii IO.inspect( + " autocmd BufRead * imap ip IO.puts( +augroup END + +augroup filetype_vue + autocmd! + autocmd BufRead * imap cll console.log()==f(a +augroup END + +augroup filetype_javascript + autocmd! + autocmd BufRead,BufNewFile * imap cll console.log()==f(a + call TabSize(2) +augroup END " Automatic typo fixing iab compomemt component @@ -186,6 +201,7 @@ map :buffers " paragraph by typing that string! nmap wp 0v$gq +" Copy word. nmap cw y/ " Save @@ -560,3 +576,11 @@ endif nmap :> vmap :> +nnoremap f :Ag =expand("") + +" these "Ctrl mappings" work well when Caps Lock is mapped to Ctrl +nmap tN :TestNearest +nmap tF :TestFile +nmap tS :TestSuite +nmap tL :TestLast +nmap tG :TestVisitd