public
Created

.vimrc

  • Download Gist
.vimrc
VimL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
set nocompatible " be iMproved
filetype on "Avoid errors on close
filetype off " required!
 
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
 
" Bundles {{{-
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'tpope/vim-rails.git'
Bundle 'L9'
Bundle 'FuzzyFinder'
" non github repos
Bundle 'git://git.wincent.com/command-t.git'
" Python and PHP Debugger
" Bundle 'fisadev/vim-debug.vim'
" Better file browser
Bundle 'scrooloose/nerdtree'
" Code commenter
Bundle 'scrooloose/nerdcommenter'
" Syntax checking
Bundle 'scrooloose/syntastic'
" Class/module browser
Bundle 'majutsushi/tagbar'
" Code and files fuzzy finder
Bundle 'kien/ctrlp.vim'
" Powerline
Bundle 'Lokaltog/vim-powerline'
" Surround
Bundle 'tpope/vim-surround'
" Autoclose
Bundle 'Townk/vim-autoclose'
" Indent text object
Bundle 'michaeljsmith/vim-indent-object'
" Python mode (indentation, doc, refactor, lints, code checking, motion and
" operators, highlighting, run and ipdb breakpoints)
Bundle 'klen/python-mode'
" Snippets manager (SnipMate), dependencies, and snippets repo
Bundle 'MarcWeber/vim-addon-mw-utils'
Bundle 'tomtom/tlib_vim'
Bundle 'honza/vim-snippets'
Bundle 'garbas/vim-snipmate'
Bundle 'scrooloose/snipmate-snippets'
Bundle 'plasticboy/vim-markdown'
Bundle 'croaker/mustang-vim'
Bundle 'vim-scripts/vim-python-virtualenv'
" Autocompletion
Bundle 'AutoComplPop'
" Python code checker
Bundle 'pyflakes.vim'
" Search results counter
Bundle 'IndexedSearch'
" XML/HTML tags navigation
Bundle 'matchit.zip'
" Gvim colorscheme
"Bundle 'Wombat'
" Yank history navigation
Bundle 'YankRing.vim'
Bundle 'mhinz/vim-signify'
Bundle 'vim-ruby/vim-ruby'
Bundle 'davidhalter/jedi-vim'
Bundle 'ervandew/supertab'
Bundle 'vim-scripts/autoproto.vim'
Bundle 'keyworks/vim-lodgeit'
Bundle 'tsaleh/vim-matchit'
" Bundle 'fholgado/minibufexpl.vim'
Bundle 'vim-scripts/pep8'
 
" vim org-mode
Bundle 'jceb/vim-orgmode'
 
" webapi-vim
Bundle 'mattn/webapi-vim'
" vim-gist
Bundle 'mattn/gist-vim'
 
 
 
 
 
" Settings {{{-
filetype plugin indent on " required!
" tabs and spaces handling
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
" tablength exceptions
autocmd FileType html setlocal shiftwidth=2 tabstop=2
autocmd FileType htmldjango setlocal shiftwidth=2 tabstop=2
autocmd FileType javascript setlocal shiftwidth=2 tabstop=2
" always show status bar
set ls=2
" incremental search
set incsearch
" highlighted search results
set hlsearch
map <F2> :nohl<CR>
" line numbers
set nu
" toggle Tagbar display
map <silent> <F4> :TagbarToggle<CR>
" autofocus on Tagbar open
let g:tagbar_autofocus = 1
 
" NERDTree (better file browser) toggle
map <F3> :NERDTreeToggle<CR>
 
" tab navigation
map tn :tabn<CR>
map tp :tabp<CR>
map tm :tabm
map tt :tabnew
map ts :tab split<CR>
map <C-S-Right> :tabn<CR>
imap <C-S-Right> <ESC>:tabn<CR>
map <C-S-Left> :tabp<CR>
imap <C-S-Left> <ESC>:tabp<CR>
 
" navigate windows with meta+arrows
"map <M-Right> <c-w>l
"map <M-Left> <c-w>h
"map <M-Up> <c-w>k
"map <M-Down> <c-w>j
"imap <M-Right> <ESC><c-w>l
"imap <M-Left> <ESC><c-w>h
"imap <M-Up> <ESC><c-w>k
"imap <M-Down> <ESC><c-w>j
 
" automatically close autocompletion window
autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
autocmd InsertLeave * if pumvisible() == 0|pclose|endif
 
" old autocomplete keyboard shortcut
imap <C-J> <C-X><C-O>
 
 
 
" save as sudo
ca w!! w !sudo tee "%"
 
" colors and settings of autocompletion
highlight Pmenu ctermbg=4 guibg=LightGray
" highlight PmenuSel ctermbg=8 guibg=DarkBlue guifg=Red
" highlight PmenuSbar ctermbg=7 guibg=DarkGray
" highlight PmenuThumb guibg=Black
 
" debugger keyboard shortcuts
map <F5> :Dbg over<CR>
map <F6> :Dbg into<CR>
map <F7> :Dbg out<CR>
map <F8> :Dbg here<CR>
map <F9> :Dbg break<CR>
map <F10> :Dbg watch<CR>
map <F11> :Dbg down<CR>
map <F12> :Dbg up<CR>
 
" CtrlP (new fuzzy finder)
let g:ctrlp_map = ',e'
nmap ,g :CtrlPBufTag<CR>
nmap ,G :CtrlPBufTagAll<CR>
nmap ,f :CtrlPLine<CR>
nmap ,m :CtrlPMRUFiles<CR>
" to be able to call CtrlP with default search text
function! CtrlPWithSearchText(search_text, ctrlp_command_end)
execute ':CtrlP' . a:ctrlp_command_end
call feedkeys(a:search_text)
endfunction
" CtrlP with default text
nmap ,wg :call CtrlPWithSearchText(expand('<cword>'), 'BufTag')<CR>
nmap ,wG :call CtrlPWithSearchText(expand('<cword>'), 'BufTagAll')<CR>
nmap ,wf :call CtrlPWithSearchText(expand('<cword>'), 'Line')<CR>
nmap ,we :call CtrlPWithSearchText(expand('<cword>'), '')<CR>
nmap ,pe :call CtrlPWithSearchText(expand('<cfile>'), '')<CR>
nmap ,wm :call CtrlPWithSearchText(expand('<cword>'), 'MRUFiles')<CR>
" Don't change working directory
let g:ctrlp_working_path_mode = 0
" Ignore files on fuzzy finder
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/](\.git|\.hg|\.svn)$',
\ 'file': '\.pyc$\|\.pyo$',
\ }
 
" Ignore files on NERDTree
let NERDTreeIgnore = ['\.pyc$', '\.pyo$']
 
" simple recursive grep
command! -nargs=1 RecurGrep lvimgrep /<args>/gj ./**/*.* | lopen | set nowrap
command! -nargs=1 RecurGrepFast silent exec 'lgrep! <q-args> ./**/*.*' | lopen
nmap ,R :RecurGrep
nmap ,r :RecurGrepFast
nmap ,wR :RecurGrep <cword><CR>
nmap ,wr :RecurGrepFast <cword><CR>
 
 
" python-mode settings
" Load the whole plugin
"let g:pymode = 1
" Load run code plugin
let g:pymode_run = 1
" Key for run python code
let g:pymode_run_key = '<leader>r'
" Load pylint code plugin
let g:pymode_lint = 1
let g:pymode_lint_checker = "pyflakes,pep8,mccabe"
 
" Check code every save
let g:pymode_lint_write = 0
 
" Load rope plugin
let g:pymode_rope = 0
" Enable python folding
let g:pymode_folding = 0
" Enable python objects and motion
let g:pymode_motion = 1
" Auto fix vim python paths if virtualenv enabled
let g:pymode_virtualenv = 1
" Set default pymode python options
let g:pymode_options = 1
 
let g:pep8_map='-leader>8'
 
 
" rope (from python-mode) settings
nmap ,d :RopeGotoDefinition<CR>
nmap ,D :tab split<CR>:RopeGotoDefinition<CR>
nmap ,o :RopeFindOccurrences<CR>
 
" don't let pyflakes allways override the quickfix list
let g:pyflakes_use_quickfix = 0
" colors for gvim
"" colorscheme Mustang
colorscheme zenburn
 
" minibufexpl
" let g:miniBufExplMapWindowNavVim = 1
" let g:miniBufExplMapWindowNavArrows = 1
" let g:miniBufExplMapCTabSwitchBufs = 1
" let g:miniBufExplModSelTarget = 1
" :MiniBufExplorer on
 
" when scrolling, keep cursor 3 lines away from screen border
set scrolloff=3
 
" autocompletion of files and commands behaves like shell
" (complete only the common part, list the options that match)
set wildmode=list:longest
 
" Fix to let ESC work as espected with Autoclose plugin
let g:AutoClosePumvisible = {"ENTER": "\<C-Y>", "ESC": "\<ESC>"}
" Disable autocomplete in python mode - conflicts with jedi
let g:acp_enableAtStartup = 1
 
fun! CheckAcpStatus()
if &ft =~ 'python'
:AcpDisable
else
:AcpEnable
endif
endfun
autocmd WinEnter,BufRead,BufNewFile * call CheckAcpStatus()
 
" autocmd WinEnter * if &ft==python | :AcpDisable | else | :AcpEnable | endif
" autocmd WinEnter * if &omnifunc!='' | :AcpDisable | else | :AcpEnable | endif
" autocmd WinEnter,TabEnter * call CheckAcpStatus()
 
" Stop that darned noise
:set visualbell
" Seriously, shut up!
:set noerrorbells
 
" I have enough stuff already, no need for more files
set nobackup
set noswapfile
 
:syntax on
"set guifont=Inconsolata:h13
set guifont=Source\ Code\ Pro:h12
:let mapleader=","
set smartindent
 
nmap <C-D-e> :cnext<CR>
set listchars=tab:▸\ ,eol,trail:-
 
:set guioptions-=m "remove menu bar
:set guioptions-=T "remove toolbar
:set autochdir
nmap <leader>H :%!xxd<CR>

Nice... this may lure my back to vim after the last 20 years or so.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.