Skip to content

Commit

Permalink
Remapped Cmd-S to <Esc>:wa
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Rady committed May 28, 2010
1 parent 789f302 commit edecb1f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ noremap <silent> ,k :wincmd k<cr>
noremap <silent> ,l :wincmd l<cr>
" Replace all instances of the word under the cursor
:nnoremap <Leader>s :%s/\<<C-r><C-w>\>/
nnoremap <Leader>s :%s/\<<C-r><C-w>\>/
" Replace the selected text
vnoremap <C-r> "hy:%s/<C-r>h//gc<left><left><left>
" Close the window in the proper direction
noremap <silent> ,cj :wincmd j<cr>:close<cr>
Expand Down Expand Up @@ -71,6 +74,7 @@ set nohlsearch
set paste
" word wrapping
set wrap
set lbr
" no beeps
set vb

Expand All @@ -85,6 +89,10 @@ set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
" Browser for viewing documentation (in haskell)
:let g:haddock_browser="/usr/bin/open"

" Disable F1 help
:nmap <F1> :echo<CR>
:imap <F1> <C-o>:echo<CR>
" Better buffer management, horrible setting name
" set hidden
set history=10000
Expand Down Expand Up @@ -124,3 +132,7 @@ function! CheatSheet(name)
let cheat = system("cheat", a:name)
:tabe
endfunction

" Remap Cmd-S to: Save All; Return to normal mode
inoremenu File.Save <Esc>:wa<CR>

2 changes: 2 additions & 0 deletions doc/cheetSheet.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Leader Ref:
]p Just like p, but it automatically adjusts the indent level of the pasted code to match that of the code you paste into.
:%s/\<word1\>/word2/gc Confirm and replace all instance of word1 with word2 in the current file
di) Delete the contents Inside the paren block we're currently in.
g; Jump to the last updated line
ca{ Use a (around) instead of i to include the parens themselves
yib Yank the contents Inside of the current Block (, {, [, etc...
:%s/\n/\r/g Replace newline with newline (notice difference between search and replace)
Expand All @@ -21,3 +22,4 @@ CTRL-U half screen Up
CTRL-D hald screen Down
CTRL-R Redo
* Search for current word
:set spell Turn on spellchecking (z= to correct, zg to iGnore)

0 comments on commit edecb1f

Please sign in to comment.