Skip to content

Instantly share code, notes, and snippets.

@rhaamo
Created May 18, 2015 11:45
Show Gist options
  • Save rhaamo/f869bb69c6b54b28c25e to your computer and use it in GitHub Desktop.
Save rhaamo/f869bb69c6b54b28c25e to your computer and use it in GitHub Desktop.
" Dashie
" Sources
" - http://unlogic.co.uk/2013/02/08/vim-as-a-python-ide/
"NeoBundle Scripts-----------------------------
if has('vim_starting')
set nocompatible " Be iMproved
" Required:
set runtimepath+=/Users/dashie/.vim/bundle/neobundle.vim/
endif
" Required:
call neobundle#begin(expand('/Users/dashie/.vim/bundle'))
" Let NeoBundle manage NeoBundle
" Required:
NeoBundleFetch 'Shougo/neobundle.vim'
" Add or remove your Bundles here:
NeoBundle 'Shougo/neosnippet.vim'
NeoBundle 'Shougo/neosnippet-snippets'
NeoBundle 'tpope/vim-fugitive'
NeoBundle 'kien/ctrlp.vim'
NeoBundle 'flazz/vim-colorschemes'
NeoBundle 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
NeoBundle 'scrooloose/nerdcommenter'
NeoBundle 'scrooloose/nerdtree'
NeoBundle 'nvie/vim-rst-tables'
NeoBundle 'klen/python-mode'
NeoBundle 'davidhalter/jedi-vim'
NeoBundle 'edthedev/pelican.vim'
NeoBundle 'ervandew/supertab'
NeoBundle 'DoxygenToolkit.vim'
NeoBundle 'majutsushi/tagbar'
NeoBundle 'Glench/Vim-Jinja2-Syntax'
let g:SuperTabDefaultCompletionType='<c-x><c-u><c-p>'
NeoBundle 'echofunc.vim'
" echofunc
let g:EchoFuncShowOnStatus = 1
let g:EchoFuncAutoStartBalloonDeclaration = 1
let g:EchoFuncMaxBalloonDeclarations = 1
" You can specify revision/branch/tag.
NeoBundle 'Shougo/vimshell', { 'rev' : '3787e5' }
set wildmenu
set wildmode=list:longest,full
NeoBundle 'justmao945/vim-clang'
NeoBundle 'scrooloose/syntastic'
let g:syntastic_error_symbol = '>'
let g:syntastic_warning_symbol = '>'
let g:syntastic_enable_balloons = 1
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_jump = 0
let g:syntastic_enable_signs = 1
let g:syntastic_c_config_file = '.clang'
" Asesome 80-character limiter
execute "set colorcolumn=" . join(range(81,335), ',')
hi ColorColumn guibg=#333333 ctermbg=235
" Required:
call neobundle#end()
" Required:
filetype plugin indent on
" If there are uninstalled bundles found on startup,
" this will conveniently prompt you to install them.
NeoBundleCheck
"End NeoBundle Scripts-------------------------
" The rest of your config follows here
" Hilight more than 120 chars/cols
augroup vimrc_autocmds
autocmd!
" highlight characters past column 120
autocmd FileType python highlight Excess ctermbg=DarkGrey guibg=Black
autocmd FileType python match Excess /\%120v.*/
autocmd FileType python set nowrap
augroup END
" Powerline setup
set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 9
set laststatus=2
" F2 pop NerdTree
map <F2> :NERDTreeToggle<CR>
" Trolling
map <F1> :set paste<CR>
" Python-mode
" Activate rope
" Keys:
" K Show python docs
" <Ctrl-Space> Rope autocomplete
" <Ctrl-c>g Rope goto definition
" <Ctrl-c>d Rope show documentation
" <Ctrl-c>f Rope find occurrences
" <Leader>b Set, unset breakpoint (g:pymode_breakpoint enabled)
" [[ Jump on previous class or function (normal, visual, operator modes)
" ]] Jump on next class or function (normal, visual, operator modes)
" [M Jump on previous class or method (normal, visual, operator modes)
" ]M Jump on next class or method (normal, visual, operator modes)
let g:pymode_rope = 1
" Documentation
let g:pymode_doc = 1
let g:pymode_doc_key = 'K'
"Linting
let g:pymode_lint = 1
let g:pymode_lint_checker = "pyflakes,pep8"
" Auto check on save
let g:pymode_lint_write = 1
" Support virtualenv
let g:pymode_virtualenv = 1
" Enable breakpoints plugin
let g:pymode_breakpoint = 1
let g:pymode_breakpoint_key = '<leader>b'
" syntax highlighting
let g:pymode_syntax = 1
let g:pymode_syntax_all = 1
let g:pymode_syntax_indent_errors = g:pymode_syntax_all
let g:pymode_syntax_space_errors = g:pymode_syntax_all
" Don't autofold code
let g:pymode_folding = 0
" Use <leader>l to toggle display of whitespace
nmap <leader>l :set list!<CR>
" automatically change window's cwd to file's dir
set autochdir
" I'm prefer spaces to tabs
set tabstop=4
set shiftwidth=4
set expandtab
" more subtle popup colors
if has ('gui_running')
highlight Pmenu guibg=#cccccc gui=bold
endif
" Always line numbering
:set number
" Mouse support
:set mouse=a
" Syntax
syntax enable
" Well, remember position plz
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" Gui Font : PowerLine
let g:Powerline_symbols = 'fancy'
set guifont=Meslo\ LG\ S\ DZ\ For\ Powerline
" Make in curent folder or parent
":set makeprg=[[\ -f\ Makefile\ ]]\ &&\ make\ \\\|\\\|\ make\ -C\ ..
fun! SetMkfile()
let filemk = "Makefile"
let pathmk = "./"
let depth = 1
while depth < 4
if filereadable(pathmk . filemk)
return pathmk
endif
let depth += 1
let pathmk = "../" . pathmk
endwhile
return "."
endf
command! -nargs=* Make tabnew | let $mkpath = SetMkfile() | make <args> -C $mkpath | cwindow 10
" Command Make will call make and then cwindow which
" opens a 3 line error window if any errors are found.
" If no errors, it closes any open cwindow.
":command -nargs=* Make make <args> | cwindow 3
" Automatically open, but do not go to (if there are errors) the quickfix /
" location list window, or close it when is has become empty.
"
" Note: Must allow nesting of autocmds to enable any customizations for quickfix
" buffers.
" Note: Normally, :cwindow jumps to the quickfix window if the command opens it
" (but not if it's already open). However, as part of the autocmd, this doesn't
" seem to happen.
autocmd QuickFixCmdPost [^l]* nested cwindow
autocmd QuickFixCmdPost l* nested lwindow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment