Skip to content

Instantly share code, notes, and snippets.

@ronbeltran
Created August 5, 2020 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ronbeltran/7102e13aa2791a1d889975a99b2f60c6 to your computer and use it in GitHub Desktop.
Save ronbeltran/7102e13aa2791a1d889975a99b2f60c6 to your computer and use it in GitHub Desktop.
set nocompatible " 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 'Vundle/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 'Valloric/YouCompleteMe'
" Plugin 'vim-scripts/indentpython.vim'
Plugin 'nvie/vim-flake8'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'jnurmine/Zenburn'
Plugin 'altercation/vim-colors-solarized'
" Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
" Plugin 'SirVer/ultisnips'
" Plugin 'honza/vim-snippets'
" Plugin 'fatih/vim-go'
" Plugin 'rust-lang/rust.vim'
" add all your plugins here (note older versions of Vundle
" used Bundle instead of Plugin)
" ...
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" 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 |
" Flag unwanted whitespace
" Highlight Bad White Space
highlight BadWhitespace ctermbg=red guibg=red
au BufRead,BufNewFile *.py match BadWhitespace /\s\+$/
au BufRead,BufNewFile *.py match BadWhitespace /^\t\+/
" Ignore files in NERDTree
let NERDTreeIgnore = ['\.py[cod]$[[file]]', '\~$[[file]]', 'bower_components$[[dir]]', '_webassets$[[dir]]', '__pycache__$[[dir]]', 'node_modules$[[dir]]', 'venv$[[dir]]']
" Ignore files and dirs i ctrlp
set wildignore+=*.pyc,*.pyo,*.pyd " Python
" Fullstack indention
au BufNewFile,BufRead *.js, *.html, *.css
\ set tabstop=2
\ set softtabstop=2
\ set shiftwidth=2
" Flag unwanted whitespace
highlight BadWhitespace ctermbg=red guibg=red
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
" UTF-8
set encoding=utf-8
" 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>
" YouCompleteMe settings
let g:ycm_autoclose_preview_window_after_completion=1
let g:ycm_register_as_syntastic_checker=0
let g:ycm_show_diagnostics_ui=0
let g:ycm_autoclose_preview_window_after_completion=1
let g:ycm_python_binary_path='python3'
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
" Fix colorscheme background inside TMUX
set t_ut=
" Press <F3> to paste
set pastetoggle=<F3>
" Python with virtualenv support
" py << EOF
" import os
" import sys
" if 'VIRTUAL_ENV' in os.environ:
" project_base_dir = os.environ['VIRTUAL_ENV']
" activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
" execfile(activate_this, dict(__file__=activate_this))
" EOF
let python_highlight_all=1
syntax on
set nu
set nowrap
set nobackup
set nowritebackup
set noswapfile
set hlsearch
" set cursorline
" Toggle GUI and terminal vim
if has('gui_running')
set background=dark
colorscheme solarized
else
colorscheme zenburn
endif
" Toggle vim theme
call togglebg#map("<F5>")
" NerdTree
" let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
nnoremap <silent> <C-n> :NERDTreeToggle<CR>
" Clipboard
set clipboard=unnamed
" Enable folding
set foldmethod=indent
set foldlevel=99
" Enable folding with the spacebar
nnoremap <space> za
" 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_c_checkers= ['gcc']
let g:syntastic_javascript_checkers= ['eslint']
" Highlight Cursor Line
highligh CursorLine cterm=NONE ctermbg=white ctermfg=None guibg=darkred guifg=white
" Ultisnips
" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
" let g:UltiSnipsExpandTrigger="<tab>"
" let g:UltiSnipsJumpForwardTrigger="<c-b>"
" let g:UltiSnipsJumpBackwardTrigger="<c-z>"
" Rust
" let g:rustfmt_autosave = 1
" Vim Airline
" let g:airline#extensions#tabline#enabled = 1
" let g:airline#extensions#tabline#formatter = 'default'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment