Skip to content

Instantly share code, notes, and snippets.

@ryangmolina
Last active March 20, 2019 14:23
Show Gist options
  • Save ryangmolina/196d0bb753415c4b2e95c256aae559a8 to your computer and use it in GitHub Desktop.
Save ryangmolina/196d0bb753415c4b2e95c256aae559a8 to your computer and use it in GitHub Desktop.
# Enable syntax highlighting in vim + tmux
export TERM="xterm-256color"
# set -g default-terminal "screen-256color"
set-window-option -g visual-bell on
set-window-option -g bell-action other
set -g terminal-overrides ',xterm-256color:Tc'
set -g default-terminal "tmux-256color"
set -as terminal-overrides ',xterm*:sitm=\E[3m'
set -sg escape-time 0
source-file "${HOME}/.tmux-themepack/basic.tmuxtheme"
let $vundle="~/.config/nvim/bundle/Vundle.vim"
" Be iMproved
set nocompatible
set paste
"=====================================================
"" 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 'kien/ctrlp.vim' " Fast transitions on project files
"-------------------=== Other ===-------------------------------
Plugin 'Valloric/MatchTagAlways'
Plugin 'rosenfeld/conque-term' " Consoles as buffers
Plugin 'ddrscott/vim-side-search'
Plugin 'majutsushi/tagbar'
Plugin 'Yggdroot/indentLine'
Plugin 'Shougo/deoplete.nvim'
Plugin 'wokalski/autocomplete-flow'
Plugin 'Shougo/neosnippet'
Plugin 'Shougo/neosnippet-snippets'
Plugin 'Shougo/neco-syntax'
Plugin 'deoplete-plugins/deoplete-jedi'
Plugin 'jjohnson338/deoplete-mssql'
"-------------------=== Languages support ===-------------------
Plugin 'mitsuhiko/vim-sparkup' " Sparkup(XML/jinja/htlm-django/etc.) support
Plugin 'vim-syntastic/syntastic' " Syntax checking plugin for Vim
Plugin 'posva/vim-vue'
Plugin 'othree/yajs.vim'
Plugin 'othree/html5.vim'
Plugin 'pangloss/vim-javascript'
Plugin 'mxw/vim-jsx'
"-------------------=== Colorscheme ===-------------------
Plugin 'rafi/awesome-vim-colorschemes'
Plugin 'yous/vim-open-color'
Plugin 'altercation/vim-colors-solarized'
Plugin 'chriskempson/base16-vim'
Plugin 'NLKNguyen/papercolor-theme'
Plugin 'mhartington/oceanic-next'
call vundle#end() " required
filetype on
filetype plugin on
filetype plugin indent on
"=====================================================
"" General settings
"=====================================================
syntax enable " syntax highlight
set t_Co=256 " set 256 colors
set termguicolors " set true colors inside tmux
colorscheme OceanicNext
"colorscheme open-color
set background=dark
"colorscheme solarized
"colorscheme gruvbox
"colorscheme base16-default-light
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...
" Additional mappings for Esc (useful for MacBook with touch bar)
inoremap jj <Esc>
inoremap jk <Esc>
"=====================================================
"" Search settings
"=====================================================
set incsearch " incremental search
set hlsearch " highlight search results
"=====================================================
"" NERDTree settings
"=====================================================
let NERDTreeIgnore=['\.pyc$', '\.pyo$', '__pycache__$', 'venv', 'node_modules'] " 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>
" python executables for different plugins
let g:syntastic_python_python_exec='python'
" highlight 'long' lines (>= 80 symbols) in python files
augroup vimrc_autocmds
autocmd!
"autocmd FileType python,rst,c,cpp highlight Excess ctermbg=DarkGrey guibg=Orange
"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
autocmd FileType js,javascript set tabstop=2
augroup END
" syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
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=['python', 'pylint']
let g:syntastic_python_pylint_args = "--load-plugins pylint_django"
let g:syntastic_python_pylint_args = '-E'
let g:syntastic_javascript_checkers = ['eslint']
let g:ctrlp_custom_ignore = 'venv'
let g:indentLine_char_list = ['|', '¦', '┆', '┊']
" Better split editor navigation
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
set splitbelow
set splitright
set clipboard+=unnamedplus " use the clipboards of vim and win
set paste " Paste from a windows or from vim
set go+=a " Visual selection automatically copied to the clipboard
hi ExtraWhitespace ctermbg=DarkGrey guibg=DarkGrey
match ExtraWhitespace /\s\+$/
let g:ctrp_custom_ignore = '\v[\/](**node_modules|**target|**dist|**webpack|**assets|**static|**asset)|(\.(swp|ico|git|svn))$'
au BufNewFile,BufRead *.vue setf vue
autocmd Filetype css setlocal tabstop=2
autocmd Filetype js setlocal tabstop=2
autocmd Filetype javascript setlocal tabstop=2
autocmd Filetype vue setlocal tabstop=2
autocmd Filetype vuejs setlocal tabstop=2
autocmd Filetype html setlocal tabstop=2
autocmd Filetype htmldjango setlocal ts=2 sts=2 sw=2 expandtab
au FileType vue setl sw=2 sts=2 et
au FileType css setl sw=2 sts=2 et
au FileType js setl sw=2 sts=2 et
au FileType javascript setl sw=2 sts=2 et
au FileType html setl sw=2 sts=2 et
let g:vue_disable_pre_processors = 1
autocmd FileType vue syntax sync fromstart
nnoremap <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar><CR>
set ttimeoutlen=50
" Javascript
let g:javascript_plugin_jsdoc = 1
" How should we execute the search?
" --heading and --stats are required!
let g:side_search_prg = 'ag --word-regexp'
\. " --ignore='*.js.map'"
\. " --heading --stats -B 1 -A 4"
" Can use `vnew` or `new`
let g:side_search_splitter = 'vnew'
let g:side_search_split_pct = 0.25
" SideSearch current word and return to original window
nnoremap <Leader>ss :SideSearch <C-r><C-w><CR> | wincmd p
" Create an shorter `SS` command
command! -complete=file -nargs=+ SS execute 'SideSearch <args>'
" or command abbreviation
cabbrev SS SideSearch
nmap <esc><esc> :noh<return>
let g:deoplete#enable_at_startup = 1
let g:neosnippet#enable_completed_snippet = 1
let g:autocomplete_flow#insert_paren_after_function = 0
let g:mta_filetypes = {
\ 'html' : 1,
\ 'xhtml' : 1,
\ 'xml' : 1,
\ 'jinja' : 1,
\ 'vue': 1,
\}
nmap <F8> :TagbarToggle<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment