summaryrefslogtreecommitdiffstats
path: root/.vimrc
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2010-12-04 23:01:02 +0100
committerFlorian Pritz <bluewind@xssn.at>2010-12-04 23:01:02 +0100
commit70f0ef31d89e361cb7c37de9b1b73a829c41c9a4 (patch)
treece5b4a5c9c20732e28676c913bca97ef26669360 /.vimrc
parentaaeadcdc572d127939e239a93bec09fa1a7475a3 (diff)
downloaddotfiles-70f0ef31d89e361cb7c37de9b1b73a829c41c9a4.tar.gz
dotfiles-70f0ef31d89e361cb7c37de9b1b73a829c41c9a4.tar.xz
vim: add new plugins; add movement keymappings
Signed-off-by: Florian Pritz <bluewind@xssn.at>
Diffstat (limited to '.vimrc')
-rw-r--r--.vimrc39
1 files changed, 13 insertions, 26 deletions
diff --git a/.vimrc b/.vimrc
index 8f243ac..f6374d7 100644
--- a/.vimrc
+++ b/.vimrc
@@ -32,6 +32,9 @@ set list
set listchars=tab:▸\ ,eol:$
set hidden
set display+=lastline
+set undofile
+
+let mapleader = ","
"aliases
ca w!! w !sudo tee "%" > /dev/null
@@ -55,32 +58,6 @@ if !exists(":DiffOrig")
\ | wincmd p | diffthis
endif
-" Comment out a visual block
-function CommentLines()
- execute ":s@^@".g:StartComment." @g"
- "execute ":s@^\\(\\s*\\)@\\1".g:StartComment." @g"
-
- execute ":s@$@ ".g:EndComment."@g"
-endfunction
-
-" Uncomment a visual block
-function UncommentLines()
- execute ":s@^".g:StartComment." @\@g"
- "execute ":s@^\\(\\s*\\)".g:StartComment." @\\1@g"
-
- execute ":s@ ".g:EndComment."$@@g"
-endfunction
-
-" Set comment characters for common languages
-autocmd FileType python,sh,bash,zsh,ruby,perl let StartComment="#" | let EndComment=""
-autocmd FileType html let StartComment="<!--" | let EndComment="-->"
-autocmd FileType php,c,javascript let StartComment="//" | let EndComment=""
-autocmd FileType cpp let StartComment="/*" | let EndComment="*/"
-autocmd FileType vim let StartComment="\"" | let EndComment=""
-
-vmap <C-c> :call CommentLines()<cr>
-vmap <C-u> :call UncommentLines()<cr>
-
set runtimepath+=/usr/share/vim
"inoremap <tab> <c-n>
@@ -93,6 +70,16 @@ nnoremap <C-s> :w<cr>
inoremap <C-c> <esc>:q<cr>
nnoremap <C-c> :q<cr>
+" movement mappings
+nnoremap <C-Right> <C-w>l
+nnoremap <C-Left> <C-w>h
+nnoremap <C-Down> <C-w>j
+nnoremap <C-Up> <C-w>k
+nnoremap <Up> gk
+nnoremap <Down> gj
+nnoremap j gj
+nnoremap k gk
+
"au VimEnter * :NERDTreeToggle
noremap <F2> :NERDTreeToggle<CR>
inoremap <F2> <ESC>:NERDTreeToggle<CR>