aboutsummaryrefslogtreecommitdiff
path: root/vimrc.dot.link
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-12-27 15:32:50 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-12-27 15:32:50 -0200
commit5032aca04f4d0bce092ade66fe914c34af357a5e (patch)
tree3ba885989ff09b1ab3eb0a16ac865e797c8ca0e7 /vimrc.dot.link
downloadvim-5032aca04f4d0bce092ade66fe914c34af357a5e.tar.gz
vim-5032aca04f4d0bce092ade66fe914c34af357a5e.tar.bz2
Initial import
Diffstat (limited to 'vimrc.dot.link')
-rw-r--r--vimrc.dot.link92
1 files changed, 92 insertions, 0 deletions
diff --git a/vimrc.dot.link b/vimrc.dot.link
new file mode 100644
index 0000000..20f4aaa
--- /dev/null
+++ b/vimrc.dot.link
@@ -0,0 +1,92 @@
+syn on
+set nonu
+
+set background=dark
+set nobackup
+set nowritebackup
+
+set noautoindent
+"set smartindent
+set tabstop=2
+set shiftwidth=2
+set expandtab
+set mouse-=a
+set autoread
+set nocompatible
+
+set title
+set titleold="terminal"
+set titlestring=vim:\ %F
+
+" Thanks to http://stackoverflow.com/questions/1673649/vimrc-action-onclose
+function! ResetTitle(title)
+ " disable vim's ability to set the title
+ exec "set title t_ts='' t_fs=''"
+
+ " and restore it
+ "exec ":!echo -e '\033kbash\033\\'\<CR>"
+ exec ":!xtitle " a:title
+endfunction
+
+au VimLeave *mutt/* silent call ResetTitle("mutt")
+au VimLeave *remind/* silent call ResetTitle("wyrd")
+
+" Folding
+set foldmethod=syntax
+let php_folding = 1
+let g:sh_fold_enabled = 1
+
+" PHP
+let php_sql_query = 1
+
+au BufNewFile,BufRead *.thtml set ft=php
+au BufNewFile,BufRead *.mdwn set ft=ikiwiki
+au BufNewFile,BufRead *.md set ft=ikiwiki
+au BufNewFile,BufRead *.rem set ft=remind
+
+augroup mkd
+ autocmd BufRead *.mkd set ai formatoptions=tcroqn2 comments=n:>
+augroup END
+
+if has("autocmd")
+ " Drupal *.module and *.install files.
+ augroup module
+ autocmd BufRead,BufNewFile *.profile set filetype=php
+ autocmd BufRead,BufNewFile *.module set filetype=php
+ autocmd BufRead,BufNewFile *.install set filetype=php
+ autocmd BufRead,BufNewFile *.test set filetype=php
+ augroup END
+endif
+
+" Pathogen - https://github.com/tpope/vim-pathogen
+call pathogen#infect()
+
+" No modelines
+set nomodeline
+
+" Syntax check
+let g:syntastic_mode_map = { 'mode': 'passive',
+ \ 'active_filetypes': [],
+ \ 'passive_filetypes': [] }
+
+" Shortcut to open a new tab
+nmap <ESC>n :tabnew<CR>
+
+" NERDTree section
+" Thanks to http://stackoverflow.com/questions/1447334/how-do-you-add-nerdtree-to-your-vimrc
+
+"autocmd VimEnter * NERDTree
+"autocmd VimEnter * wincmd p
+
+function OpenNERDTree()
+ execute ":NERDTree"
+ endfunction
+ command -nargs=0 OpenNERDTree :call OpenNERDTree()
+
+ nmap <ESC>t :OpenNERDTree<CR>
+
+" See http://superuser.com/questions/10588/how-to-make-cut-copy-paste-in-gvim-on-ubuntu-work-with-ctrlx-ctrlc-ctrlv
+vmap <C-c> "+yi
+vmap <C-x> "+c
+vmap <C-v> c<ESC>"+p
+imap <C-v> <C-r><C-o>+