Advertisement
Guest User

vimrc

a guest
Mar 25th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 2.34 KB | None | 0 0
  1. " VIM Configuration File
  2.  " Author: Daniel <Daphron> Kaczmarek
  3.  
  4.  " set UTF-8 encoding
  5.  set enc=utf-8
  6.  set fenc=utf-8
  7.  set termencoding=utf-8
  8.  " disable vi compatibility (emulation of old bugs)
  9.  set nocompatible
  10.  " use indentation of previous line
  11.  set autoindent
  12.  " configure tabwidth and insert spaces instead of tabs
  13.  set tabstop=8        " tab width is 4 spaces
  14.  set shiftwidth=4     " indent also with 4 spaces
  15.  set expandtab        " expand tabs to spaces
  16.  set softtabstop=4
  17.  " wrap lines at 120 chars. 80 is somewaht antiquated with nowadays displays.
  18.  set textwidth=0
  19.  set wrapmargin=0
  20.  set wrap
  21.  " turn syntax highlighting on
  22.  set t_Co=256
  23.  syntax on
  24.  " turn line numbers on
  25.  set number
  26.  " highlight matching braces
  27.  set showmatch
  28.  " intelligent comments
  29.  set comments=sl:/*,mb:\ *,elx:\ */
  30.  " remap ii to exit to command mode
  31.  inoremap jj <ESC>
  32.  
  33.  
  34. " Code folding
  35. set foldmethod=indent
  36. set foldlevel=99
  37.  
  38. "set foldnestmax=2
  39.  
  40. nnoremap <space> za
  41. vnoremap <space> zf
  42.  
  43.  
  44. "Set a smaller timeout
  45. set ttimeoutlen=100
  46.  
  47. " C + dir instead of C+ w then dir
  48. map <c-j> <c-w>j
  49. map <c-k> <c-w>k
  50. map <c-l> <c-w>l
  51. map <c-h> <c-w>h
  52.  
  53. "Try to detect filetypes
  54. filetype on
  55.  
  56. colorscheme molokai
  57.  
  58. filetype plugin indent on
  59.  
  60.  
  61. map <F4> :NERDTreeToggle<CR>    " map f4 to open NerdTree
  62. map <buffer> <F7> :w<CR>:!/usr/bin/env python2 % <CR>
  63. map <buffer> <F8> :w<CR>:!/usr/bin/env python % <CR>
  64. "Execute file being edited with <Shift> + e:
  65. map <buffer> <S-e> :w<CR>:!/usr/bin/env python2 % <CR>
  66.  
  67. "Pydiction tab completion
  68. let g:pydiction_location = '/home/xeno/repos/config-files/.vim/pydiction/complete-dict'
  69.  
  70. "Only do this if compiled with support for autocommands.
  71. if has("autocmd")
  72.     autocmd FileType python set complete+=k~/.vim/syntax/python.vim isk+=.,(
  73.     autocmd Filetype java setlocal omnifunc=javacomplete#Complete
  74.     autocmd FileType python set omnifunc=pythoncomplete#Complete
  75.     let g:SuperTabDefaultCompletionType = "context"
  76. endif
  77.  
  78. "Enable dictionary (Ctrl-x Ctrl-k)
  79. set dictionary+=/usr/share/dict/cracklib-small
  80. "Filename is Ctrl-x Ctrl-f
  81. "Line is Ctrl-x Ctrl-l
  82. "Word/Pattern Ctrl-x Ctrl-n
  83. "
  84. nmap <leader>a <Esc>:Ack!
  85.  
  86. "Useful vim commands for me to memorize
  87. ":w !sude tee %         This will allow you to save the file you are editing if you need root.
  88.  
  89. "Use relative line numbering
  90. set relativenumber
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement