Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2013
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 4.23 KB | None | 0 0
  1. " vimrc shortcut
  2. map vrc :e ~/.vimrc
  3.  
  4. " core
  5. let mapleader=","
  6. set t_Co=256 " use 256 colors in terminator
  7.  
  8. " pathogen
  9. silent! call pathogen#runtime_append_all_bundles()
  10. syntax on
  11. filetype plugin indent on     " required!
  12.  
  13. " color scheme
  14. colorscheme molokai
  15. let g:molokai_original = 1
  16. let g:rehash256 = 1
  17.  
  18. " config
  19. set history=1000 " Increase history from 20 default to 1000
  20. set hidden " When a buffer is brought to foreground, remember undo history and marks.
  21. set nonu " Disable line numbers.
  22. set noerrorbells " Disable error bells.
  23. set foldmethod=syntax " Markers are used to specify folds.
  24. set foldenable
  25. set foldlevel=2
  26. set esckeys " Allow cursor keys in insert mode.
  27. set nohlsearch " Enable search result highlighting.
  28. set incsearch " Highlight dynamically as pattern is typed.
  29. set noinsertmode " Don't start vim in insert mode.
  30. set magic " Enable extended regexes.
  31. set report=0 " Show all changes.
  32. set ruler " Show the cursor position.
  33. set shortmess=I " Don't show the intro message when starting vim.
  34. set showmode " Show the current mode.
  35. set nostartofline " Don't jump to the start of the line when moving around.
  36. set title " Show the filename in the window titlebar.
  37. set wildchar=<TAB> " Character for CLI expansion (TAB-completion).
  38. set wildmenu " Hitting TAB in command mode will show possible completions above command line.
  39. set wildmode=list:longest " Complete only until point of ambiguity.
  40. set expandtab " Expand tabs to spaces.
  41. set tabstop=2 " Hitting the tab key results in 4 spaces.
  42. set shiftwidth=2 " The # of spaces for indenting.
  43. set smarttab " At start of line, <Tab> inserts shiftwidth spaces, <Bs> deletes shiftwidth spaces.
  44. set backspace=start,indent,eol
  45. set ignorecase " In searches, ignore case of lower case letters.
  46. set smartcase " Override ignorecase if search contains upper case letters.
  47. set scrolloff=3 " Start scrolling three lines before horizontal border of window.
  48. set shortmess=atI " Shorten command line text and other info tokens.
  49. set splitbelow splitright
  50. set cul
  51. set ls=2
  52. set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
  53. set autowrite
  54. set grepprg=ag
  55. set diffopt=filler,vertical
  56. set paste
  57. set noswapfile
  58. set clipboard+=unnamedplus
  59. set mouse +=a
  60. set diffopt=filler " Add vertical spaces to keep right and left aligned
  61. set diffopt+=iwhite " Ignore whitespace changes (focus on code changes)
  62. set noshowmode " Don't show the current mode (airline.vim takes care of us)
  63. set cindent
  64. set smartindent
  65. set autoindent " Copy indent from last line when starting new line.
  66.  
  67. " sudo write
  68. noremap <leader>2 :w !sudo tee %<CR>
  69.  
  70. " copypasta
  71. vmap <C-c> "+yi
  72. vmap <C-x> "+c
  73. vmap <C-v> c<ESC>"+p
  74. imap <C-v> <ESC>"+pa
  75. imap <C-v> <Esc><C-v>a
  76.  
  77. " because im shitfy
  78. command WQ wq
  79. command Wq wq
  80. command W w
  81. command Q q
  82.  
  83. " using buffers instead of tabs
  84. nnoremap <Leader>p :buffers<CR>:buffer<Space>
  85. nnoremap <Leader>n :bn<CR>
  86. nnoremap <Leader>b :bp<CR>
  87.  
  88. " vim.notes
  89. let g:notes_directories = ['/home/dmix/notes']
  90. let g:notes_suffix = '.txt'
  91.  
  92. " ctrlp
  93. let g:ctrlp_map = '<C-p>'
  94. let g:ctrlp_cmd = 'CtrlPMixed'          " search anything (in files, buffers and MRU files at the same time.)
  95. let g:ctrlp_working_path_mode = 'ra'    " search for nearest ancestor like .git, .hg, and the directory of the current file
  96. let g:ctrlp_match_window_bottom = 0     " show the match window at the top of the screen
  97. let g:ctrlp_max_height = 10             " maxiumum height of match window
  98. let g:ctrlp_switch_buffer = 'et'        " jump to a file if it's open already
  99. "let g:ctrlp_use_caching = 1                " enable caching
  100. let g:ctrlp_clear_cache_on_exit=0       " speed up by not removing clearing cache evertime
  101. let g:ctrlp_show_hidden = 1             " show me dotfiles
  102.  
  103. " silver search > grep/ack
  104. let g:ackprg = 'ag --nogroup --nocolor --column' " use silver_searcher instead of ack
  105.  
  106. " neocomplete
  107. let g:neocomplcache_enable_at_startup = 1
  108.  
  109. " remove trailing whitespace
  110. fun! <SID>StripTrailingWhitespaces()
  111.     let l = line(".")
  112.     let c = col(".")
  113.     %s/\s\+$//e
  114.     call cursor(l, c)
  115. endfun
  116.  
  117. autocmd FileType c,cpp,java,php,ruby,python autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces()
  118.  
  119.  
  120. " DISABLED FOR NOW
  121.  
  122. " Automatically cd into the directory that the file is in
  123. "autocmd BufEnter * execute "chdir ".escape(expand("%:p:h"), ' ')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement