Advertisement
sinisterstuf

vimrc

Oct 5th, 2011
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 3.72 KB | None | 0 0
  1. " turn off vi compatibility
  2. set nocompatible
  3.  
  4. " Setup Pathogen to load all bundles and their helptags
  5. call pathogen#infect()
  6. call pathogen#helptags()
  7. call pathogen#runtime_append_all_bundles()
  8.  
  9. " change the mapleader from \ to ,
  10. let mapleader=","
  11.  
  12. " Quickly edit/reload the vimrc file
  13. nmap <silent> <leader>ev :e $MYVIMRC<CR>
  14. nmap <silent> <leader>sv :so $MYVIMRC<CR>
  15.  
  16. " Hide buffers on :e instead of closing them
  17. set hidden
  18.  
  19. syntax enable on
  20. filetype plugin indent on
  21.  
  22. if has('autocmd')
  23.     " Use spaces for tabs in python
  24.     autocmd filetype python set expandtab
  25.     " Not sure what this does
  26.     autocmd filetype html,xml set listchars-=tab:>.
  27.     " Don't remember what this does, it might be what starts where you were
  28.     " last editing
  29.     autocmd BufReadPost *
  30.         \ if line("'\"") > 1 && line("'\"") <= line("$") |
  31.         \   exe "normal! g`\"" |
  32.         \ endif
  33. endif "autocmd
  34.  
  35. set nowrap        " don't wrap lines
  36. set tabstop=4     " a tab is four spaces
  37. set backspace=indent,eol,start
  38.                   " allow backspacing over everything in insert mode
  39. set autoindent    " always set autoindenting on
  40. set copyindent    " copy the previous indentation on autoindenting
  41. set number        " always show line numbers
  42. set shiftwidth=4  " number of spaces to use for autoindenting
  43. set shiftround    " use multiple of shiftwidth when indenting with '<' and '>'
  44. set showmatch     " set show matching parenthesis
  45. set ignorecase    " ignore case when searching
  46. set smartcase     " ignore case if search pattern is all lowercase,
  47.                   "    case-sensitive otherwise
  48. set smarttab      " insert tabs on the start of a line according to
  49.                   "    shiftwidth, not tabstop
  50. set hlsearch      " highlight search terms
  51. set incsearch     " show search matches as you type
  52. set history=1000         " remember more commands and search history
  53. set undolevels=1000      " use many muchos levels of undo
  54. set wildignore=*.swp,*.bak,*.pyc,*.class,*.pdf,*.aux,*.out,*.o,*.lol,*.lot,*.log
  55. set ruler           " Not sure what it does
  56. set cursorline
  57.  
  58. set title                " change the terminal's title
  59. set visualbell           " don't beep
  60. set noerrorbells         " don't beep
  61.  
  62. " Show whitespace
  63. set list
  64. set listchars=tab:>.,trail:.,extends:#,nbsp:.
  65. "set modeline list listchars=tab:»·,trail:·,precedes:<,extends:>
  66.  
  67. " Toggle disable of auto-indent for pasting large code using F2
  68. set pastetoggle=<F2>
  69.  
  70. " Enable mouse
  71. if has('mouse')
  72.     set mouse=a
  73. endif
  74.  
  75. " Use ; instead of : for commands
  76. nnoremap ; :
  77.  
  78. " Use Q for formatting the current paragraph (or selection)
  79. vmap Q gq
  80. nmap Q gqap
  81.  
  82. " Easier window navigation
  83. map <C-h> <C-w>h
  84. map <C-j> <C-w>j
  85. map <C-k> <C-w>k
  86. map <C-l> <C-w>l
  87.  
  88. " Turn spelling and off with ,se and ,sn
  89. map <Leader>se :setlocal spell spelllang=en_gb<CR>
  90. map <Leader>sh :setlocal spell spelllang=hu_hu<CR>
  91. map <Leader>sd :setlocal spell spelllang=de_de<CR>
  92. map <Leader>sn :setlocal nospell<CR>
  93.  
  94. " Clear search highlighting with ,/
  95. nmap <silent> ,/ :nohlsearch<CR>
  96.  
  97. " Convenient command to see the changes you've made (compares
  98. " buffer to original file)
  99. if !exists(":DiffOrig")
  100.   command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
  101.           \ | wincmd p | diffthis
  102. endif
  103.  
  104. " Get sudo (only useful on Linux)
  105. "cmap w!! w !sudo tee % >/dev/null
  106.  
  107. "Options for LaTeX Suite
  108. set shellslash
  109. set grepprg=grep\ -nH\ $*
  110. let g:tex_flavor='latex'
  111.  
  112. " GUI only options
  113. if has('gui_running')
  114.     colorscheme solarized
  115.     set background=light
  116.     :set guioptions-=T  "remove toolbar
  117.     " use powerline statusline and set patched Consolas font
  118.     set encoding=utf-8
  119.     set guifont=Consolas\ for\ Powerline\ FixedD:h11
  120.     let g:Powerline_symbols="fancy"
  121.     set laststatus=2
  122. else
  123.     colorscheme ron
  124.     set background=dark
  125. endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement