Skip to content

Instantly share code, notes, and snippets.

@ronbeltran
Created June 1, 2018 11:04
Show Gist options
  • Save ronbeltran/cab18a7907df3bba191384bb1a5e4ba0 to your computer and use it in GitHub Desktop.
Save ronbeltran/cab18a7907df3bba191384bb1a5e4ba0 to your computer and use it in GitHub Desktop.
My Vim Config
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" Keep Plugin commands between vundle#begin/end.
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'tpope/vim-sensible'
Plugin 'scrooloose/nerdtree'
Plugin 'tpope/vim-surround'
Plugin 'hdima/python-syntax'
Plugin 'fholgado/minibufexpl.vim'
Plugin 'vim-syntastic/syntastic'
Plugin 'vim-scripts/indentpython.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'nvie/vim-flake8'
Plugin 'jnurmine/Zenburn'
Plugin 'altercation/vim-colors-solarized'
Plugin 'vim-airline/vim-airline'
" Plugin 'isRuslan/vim-es6'
" Plugin 'prettier/vim-prettier'
Plugin 'Chiel92/vim-autoformat'
Plugin 'tell-k/vim-autopep8'
Plugin 'rust-lang/rust.vim'
Plugin 'fatih/vim-go'
" Plugin 'kballard/vim-swift'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
set encoding=utf-8
set clipboard=unnamed
set noautoindent
set nowrap
set nu
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
syntax enable
set noswapfile
set nobackup
set nowritebackup
set hlsearch
set cursorline
set textwidth=120
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
" Flag unwanted whitespace
" Highlight Bad White Space
highlight BadWhitespace ctermbg=red guibg=red
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h,*.go,*.rs,*.swift match BadWhitespace /\s\+$/
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h,*.go,*.rs,*.swift match BadWhitespace /^\t\+/
let python_highlight_all=1
syntax on
" Ignore files in NERDTree
let NERDTreeIgnore = ['\.py[cod]$[[file]]', '\~$[[file]]', 'bower_components$[[dir]]', '_webassets$[[dir]]', '__pycache__$[[dir]]', 'node_modules$[[dir]]']
" Ignore files and dirs i ctrlp
set wildignore+=*.pyc,*.pyo,*.pyd " Python
" Open NERDTree with Ctrl+n
" autocmd VimEnter * NERDTree
nnoremap <silent> <C-n> :NERDTreeToggle<CR>
" With a map leader it's possible to do extra key combinations
" like <leader>w saves the current file
let mapleader = ","
let g:mapleader = ","
map <leader>ev :e! ~/.vimrc<cr>
autocmd! bufwritepost .vimrc source ~/.vimrc
" Smart way to move btw. windows
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
" Move forward/backward between buffers in order
map <right> :bn<cr>
map <left> :bp<cr>
if has('gui_running')
set background=dark
colorscheme solarized
else
colorscheme zenburn
endif
" Fix colorscheme background inside TMUX
set t_ut=
" Press <F3> to paste
set pastetoggle=<F3>
" autoclose preview window
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_python_binary_path = 'python3'
" " PEP8 indention
" au BufNewFile,BufRead *.py
" \ set tabstop=4 |
" \ set softtabstop=4 |
" \ set shiftwidth=4 |
" \ set textwidth=79 |
" \ set expandtab |
" \ set autoindent |
" \ set fileformat=unix
"
" au BufNewFile,BufRead *.js, *.html, *.css
" \ set tabstop=2 |
" \ set softtabstop=2 |
" \ set shiftwidth=2 |
"
" Syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 0
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_python_checkers = ['flake8']
let g:syntastic_javascript_checkers = ['eslint']
" Autoformat
noremap <F3> :Autoformat<CR>
let g:autoformat_autoindent = 0
let g:autoformat_retab = 0
let g:autoformat_remove_trailing_spaces = 0
" Autopep8
autocmd FileType python noremap <buffer> <F8> :call Autopep8()<CR>
" Rust
let g:rustfmt_autosave = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment