Last active
April 20, 2023 08:47
-
-
Save pgrandinetti/500eb27b439ec03f64abf492fbe9f312 to your computer and use it in GitHub Desktop.
Configuration file for VIM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mapleader="," | |
let $vundle="~/.vim/bundle/Vundle.vim" | |
" Be iMproved | |
set nocompatible | |
"===================================================== | |
"" Vundle settings | |
"===================================================== | |
filetype off | |
set rtp+=$vundle | |
call vundle#begin() | |
Plugin 'VundleVim/Vundle.vim' " let Vundle manage Vundle, required | |
"-------------------=== Code/Project navigation ===------------- | |
Plugin 'scrooloose/nerdtree' " Project and file navigation | |
Plugin 'majutsushi/tagbar' " Class/module browser | |
Plugin 'kien/ctrlp.vim' " Fast transitions on project files | |
"-------------------=== Other ===------------------------------- | |
Plugin 'vim-airline/vim-airline' " Lean & mean status/tabline for vim | |
Plugin 'vim-airline/vim-airline-themes' " Themes for airline | |
Plugin 'Lokaltog/powerline' " Powerline fonts plugin | |
Plugin 'fisadev/FixedTaskList.vim' " Pending tasks list | |
Plugin 'rosenfeld/conque-term' " Consoles as buffers | |
Plugin 'tpope/vim-surround' " Parentheses, brackets, quotes, XML tags, and more | |
Plugin 'flazz/vim-colorschemes' " Colorschemes | |
"-------------------=== Languages support ===------------------- | |
Plugin 'tpope/vim-commentary' " Comment stuff out | |
Plugin 'Valloric/YouCompleteMe' " Autocomplete plugin | |
"-------------------=== Python ===----------------------------- | |
Plugin 'klen/python-mode' " Python mode (docs, refactor, lints...) | |
Plugin 'scrooloose/syntastic' " Syntax checking plugin for Vim | |
call vundle#end() " required | |
filetype on | |
filetype plugin on | |
filetype plugin indent on | |
"===================================================== | |
"" General settings | |
"===================================================== | |
"""""""""""" Start Powerline Settings """""""""""""""" | |
set guifont=Inconsolata\ for\ Powerline:h15 | |
let g:Powerline_symbols = 'fancy' | |
set encoding=utf-8 | |
set t_Co=256 | |
set fillchars+=stl:\ ,stlnc:\ | |
set term=xterm-256color | |
set termencoding=utf-8 | |
if has("gui_running") | |
let s:uname = system("uname") | |
if s:uname == "Darwin\n" | |
set guifont=Source\ Code\ Pro\ for\ Powerline:h15 | |
colorscheme PaperColor " set color scheme | |
endif | |
endif | |
""""""""""" END of PowerLine Settings """"""""""""""" | |
syntax enable " syntax highlight | |
set t_Co=256 " set 256 colors | |
"colorscheme PaperColor " set color scheme | |
set number " show line numbers | |
set ruler | |
set ttyfast " terminal acceleration | |
set tabstop=4 " 4 whitespaces for tabs visual presentation | |
set shiftwidth=4 " shift lines by 4 spaces | |
set smarttab " set tabs for a shifttabs logic | |
set expandtab " expand tabs into spaces | |
set autoindent " indent when moving to the next line while writing code | |
set cursorline " shows line under the cursor's line | |
set showmatch " shows matching part of bracket pairs (), [], {} | |
set enc=utf-8 " utf-8 by default | |
set nobackup " no backup files | |
set nowritebackup " only in case you don't want a backup file while editing | |
set noswapfile " no swap files | |
set backspace=indent,eol,start " backspace removes all (indents, EOLs, start) What is start? | |
set scrolloff=10 " let 10 lines before/after cursor during scroll | |
set clipboard=unnamed " use system clipboard | |
set exrc " enable usage of additional .vimrc files from working directory | |
set secure " prohibit .vimrc files to execute shell, create files, etc... | |
"===================================================== | |
"" Tabs / Buffers settings | |
"===================================================== | |
tab sball | |
set switchbuf=useopen | |
set laststatus=2 | |
nmap <F9> :bprev<CR> | |
nmap <F10> :bnext<CR> | |
nmap <silent> <leader>q :SyntasticCheck # <CR> :bp <BAR> bd #<CR> | |
"" Search settings | |
"===================================================== | |
set incsearch " incremental search | |
set hlsearch " highlight search results | |
"===================================================== | |
"" NERDTree settings | |
"===================================================== | |
let NERDTreeIgnore=['\.pyc$', '\.pyo$', '__pycache__$'] " Ignore files in NERDTree | |
let NERDTreeWinSize=40 | |
autocmd VimEnter * if !argc() | NERDTree | endif " Load NERDTree only if vim is run without arguments | |
nmap " :NERDTreeToggle<CR> | |
"===================================================== | |
"" SnipMate settings | |
"===================================================== | |
let g:snippets_dir='~/.vim/vim-snippets/snippets' | |
"===================================================== | |
"" Python settings | |
"===================================================== | |
" omnicomplete | |
set completeopt-=preview " remove omnicompletion dropdown | |
" python executables for different plugins | |
let g:pymode_python='python3' | |
let g:syntastic_python_python_exec='python3' | |
" rope | |
let g:pymode_rope=0 | |
let g:pymode_rope_completion=0 | |
let g:pymode_rope_complete_on_dot=0 | |
let g:pymode_rope_auto_project=0 | |
let g:pymode_rope_enable_autoimport=0 | |
let g:pymode_rope_autoimport_generate=0 | |
let g:pymode_rope_guess_project=0 | |
" documentation | |
let g:pymode_doc=0 | |
let g:pymode_doc_key='K' | |
" lints | |
let g:pymode_lint=0 | |
" virtualenv | |
let g:pymode_virtualenv=1 | |
" breakpoints | |
let g:pymode_breakpoint=1 | |
let g:pymode_breakpoint_key='<leader>b' | |
" syntax highlight | |
let g:pymode_syntax=1 | |
let g:pymode_syntax_slow_sync=1 | |
let g:pymode_syntax_all=1 | |
let g:pymode_syntax_print_as_function=g:pymode_syntax_all | |
let g:pymode_syntax_highlight_async_await=g:pymode_syntax_all | |
let g:pymode_syntax_highlight_equal_operator=g:pymode_syntax_all | |
let g:pymode_syntax_highlight_stars_operator=g:pymode_syntax_all | |
let g:pymode_syntax_highlight_self=g:pymode_syntax_all | |
let g:pymode_syntax_indent_errors=g:pymode_syntax_all | |
let g:pymode_syntax_string_formatting=g:pymode_syntax_all | |
let g:pymode_syntax_space_errors=g:pymode_syntax_all | |
let g:pymode_syntax_string_format=g:pymode_syntax_all | |
let g:pymode_syntax_string_templates=g:pymode_syntax_all | |
let g:pymode_syntax_doctests=g:pymode_syntax_all | |
let g:pymode_syntax_builtin_objs=g:pymode_syntax_all | |
let g:pymode_syntax_builtin_types=g:pymode_syntax_all | |
let g:pymode_syntax_highlight_exceptions=g:pymode_syntax_all | |
let g:pymode_syntax_docstrings=g:pymode_syntax_all | |
" highlight 'long' lines (>= 80 symbols) in python files | |
augroup vimrc_autocmds | |
autocmd! | |
autocmd FileType python,rst,c,cpp highlight Excess ctermbg=DarkGrey guibg=Black | |
autocmd FileType python,rst,c,cpp match Excess /\%81v.*/ | |
autocmd FileType python,rst,c,cpp set nowrap | |
autocmd FileType python,rst,c,cpp set colorcolumn=80 | |
augroup END | |
" code folding | |
let g:pymode_folding=0 | |
" pep8 indents | |
let g:pymode_indent=1 | |
" code running | |
let g:pymode_run=1 | |
let g:pymode_run_bind='<F5>' | |
"===================================================== | |
"" Syntastic settings | |
"===================================================== | |
let g:syntastic_always_populate_loc_list=1 | |
let g:syntastic_auto_loc_list=1 | |
let g:syntastic_enable_signs=1 | |
let g:syntastic_check_on_wq=0 | |
let g:syntastic_aggregate_errors=1 | |
let g:syntastic_loc_list_height=5 | |
let g:syntastic_error_symbol='X' | |
let g:syntastic_style_error_symbol='X' | |
let g:syntastic_warning_symbol='x' | |
let g:syntastic_style_warning_symbol='x' | |
let g:syntastic_python_checkers=['flake8', 'pydocstyle', 'python'] | |
"===================================================== | |
"" YouCompleteMe settings | |
"===================================================== | |
let g:ycm_global_ycm_extra_conf='~/.vim/ycm_extra_conf.py' | |
let g:ycm_confirm_extra_conf=0 | |
nmap <leader>g :YcmCompleter GoTo<CR> | |
nmap <leader>d :YcmCompleter GoToDefinition<CR> | |
"===================================================== | |
"" VimWiki settings | |
"===================================================== | |
let wiki_1 = {} | |
let wiki_1.path = '~/knowledge/' | |
let wiki_1.path_html = '~/wiki_pub/' | |
let wiki_1.ext = '.md' | |
let g:vimwiki_list = [wiki_1] | |
nmap <Leader>vl <Plug>VimwikiVSplitLink | |
nmap <Leader>hl <Plug>VimwikiSplitLink |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment