Created
November 5, 2019 21:58
-
-
Save jorgeas80/b8d6f909a4603db213375a8824040876 to your computer and use it in GitHub Desktop.
My ~/.vimrc config file
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
set nocompatible | |
filetype off | |
filetype indent plugin on | |
" Buffers | |
nnoremap gp :bp<CR> | |
nnoremap gn :bn<CR> | |
nnoremap gl :ls<CR> | |
nnoremap gb :ls<CR>:b | |
" Splits | |
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> | |
imap <C-H> <Esc><C-W>h | |
imap <C-J> <Esc><C-W>j | |
imap <C-K> <Esc><C-W>k | |
imap <C-L> <Esc><C-W>l | |
set splitbelow | |
set splitright | |
" Folding | |
set foldmethod=indent | |
set foldlevel=99 | |
nnoremap <space> za | |
" General | |
syntax on | |
set autoindent | |
set autoread | |
set backspace=indent,eol,start | |
set expandtab | |
set linebreak | |
set number | |
set shiftwidth=4 | |
set softtabstop=4 | |
set tabstop=4 | |
" Internal | |
set nobackup | |
set noswapfile | |
set nowritebackup | |
" Shortcuts | |
autocmd BufWritePre * %s/\s\+$//e | |
nmap <CR> o<Esc> | |
nmap <F5> :%!python -m json.tool<CR> | |
nmap <S-Enter> O<Esc> | |
nnoremap <C-F> :FZF<CR> | |
set pastetoggle=<F3> | |
" Spell-check | |
" nmap <F11> :setlocal spell spelllang=en_us<CR> --- Not working properly | |
" Errors. | |
command! W w | |
command! Wq wq | |
command! WQ wq | |
command! Q q | |
" Plug | |
call plug#begin('~/.vim/plugged') | |
" Plug 'SirVer/ultisnips' --- Not interested just yet | |
" Plug 'davidhalter/jedi-vim' --- Not working properly with virtualenv | |
" Plug 'honza/vim-snippets' -- Not interested just yet | |
" Plug 'ludovicchabant/vim-gutentags' --- Not sure what this plugin does | |
" Plug 'python-rope/ropevim' --- Needs further investigation on how it works. | |
" Plug 'rhysd/vim-grammarous' --- Not happy with this plugin | |
" Plug 'sheerun/vim-polyglot' --- Needs further investigation. | |
" Plug 'yuttie/comfortable-motion.vim' --- Not happy with this plugin | |
Plug 'airblade/vim-gitgutter' | |
Plug 'chrisbra/csv.vim' | |
Plug 'flazz/vim-colorschemes' | |
Plug 'jmcantrell/vim-virtualenv' | |
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | |
Plug 'junegunn/fzf.vim' | |
Plug 'junegunn/goyo.vim' | |
Plug 'junegunn/limelight.vim' | |
Plug 'luochen1990/rainbow' | |
Plug 'majutsushi/tagbar' | |
Plug 'mhinz/vim-startify' | |
Plug 'python-mode/python-mode', { 'for': 'python', 'branch': 'develop' } | |
Plug 'scrooloose/nerdtree' | |
Plug 'tmhedberg/SimpylFold' | |
Plug 'tpope/vim-commentary' | |
Plug 'tpope/vim-fugitive' | |
Plug 'vim-airline/vim-airline' | |
Plug 'vim-airline/vim-airline-themes' | |
Plug 'w0rp/ale' | |
Plug 'python-rope/ropevim' | |
Plug 'davidhalter/jedi-vim' | |
Plug 'SirVer/ultisnips' | |
Plug 'honza/vim-snippets' | |
Plug 'tpope/vim-fugitive' | |
Plug 'sheerun/vim-polyglot' | |
Plug 'ludovicchabant/vim-gutentags' | |
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | |
Plug 'scrooloose/nerdtree' | |
Plug 'flazz/vim-colorschemes' | |
Plug 'majutsushi/tagbar' | |
call plug#end() | |
" vim-gitgutter | |
set updatetime=100 | |
" csv.vim | |
" ------ No configuration needed. | |
" vim-colorschemes | |
colo dracula | |
" vim-virtualenv | |
let g:virtualenv_directory = '/Users/jorgearevalo/.venv' | |
let g:virtualenv_auto_activate = 1 | |
" fzf | |
" ------ No configuration needed. | |
" goyo.vim | |
nmap <F9> :Goyo<CR> | |
" limelight.vim | |
autocmd! User GoyoEnter Limelight | |
autocmd! User GoyoLeave Limelight! | |
let g:limelight_conceal_ctermfg = 'gray' | |
" rainbow | |
let g:rainbow_active = 1 | |
let g:rainbow_conf = { | |
\ 'ctermfgs': ['darkblue', 'yellow', 'green', 'darkmagenta'], | |
\ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/{/ end=/}/ fold', 'start=/{%/ end=/%}/ fold'], | |
\} | |
" tagbar | |
" ------ Exuberant CTAGS have to be installed | |
nmap <F12> :TagbarToggle<CR> | |
" vim-startify | |
" ------ No configuration needed. | |
" python-mode | |
let g:pymode = 1 | |
let g:pymode_trim_whitespaces = 1 | |
let g:pymode_indent = 1 | |
let g:pymode_doc = 1 | |
" let g:pymode_doc_bind = '<C-K>' | |
let g:pymode_virtualenv = 1 | |
let g:pymode_lint = 1 | |
let g:pymode_lint_on_write = 1 | |
let g:pymode_rope_goto_definition_bind = '<C-K>' | |
let g:pymode_rope_goto_definition_cmd = 'new' | |
let g:virtualenv_directory = "~/.venv/" | |
" vim-grammarous | |
" nmap <F10> :GrammarousCheck<CR> | |
" nerdtree | |
map <F2> :NERDTreeToggle<CR> | |
let NERDTreeIgnore=['__pycache__$[[dir]]', '\~$'] | |
let g:NERDTreeNodeDelimiter = "\u00a0" | |
" SimpylFold | |
let g:SimpylFold_docstring_preview=1 | |
" vim-commentary | |
" ------ No configuration needed. | |
" vim-fugitive | |
" ------ No configuration needed. | |
" vim-airline | |
let g:airline#extensions#tabline#enabled = 1 | |
let g:airline#extensions#ale#enabled = 1 | |
" vim-airline-themes | |
let g:airline_theme='dracula' | |
" ale | |
" for python - python -m pip install flake8 | |
let g:ale_set_highlights = 0 | |
" comfortable-motion.vim | |
" let g:comfortable_motion_scroll_down_key = "j" | |
" let g:comfortable_motion_scroll_up_key = "k" | |
" Backspace over anything in insert mode | |
set backspace=indent,eol,start | |
" Press F4 to toggle highlighting on/off, and show current value. | |
:noremap <F4> :set hlsearch! hlsearch?<CR> | |
" Airline configuration | |
let g:airline#extensions#tabline#enabled = 1 | |
let g:airline#extensions#tabline#formatter = 'default' | |
" Nerdtree configuration | |
map <C-n> :NERDTreeToggle<CR> | |
let NERDTreeIgnore=['\.pyc$', '\~$'] | |
autocmd VimEnter * NERDTree | |
autocmd VimEnter * wincmd p | |
let g:NERDTreeDirArrowExpandable = '▸' | |
let g:NERDTreeDirArrowCollapsible = '▾' | |
" Switching between buffers | |
" Set commands to switching between buffers | |
:nnoremap <Tab> :bnext!<CR> | |
:nnoremap <S-Tab> :bprevious!<CR> | |
:nnoremap <C-X> :bp<bar>sp<bar>bn<bar>bd<CR> | |
" File searchs | |
map <C-p> :Files<CR> | |
" Ale Configuration | |
"""" Better formatting fo worp/ale | |
let g:ale_echo_msg_error_str = 'E' | |
let g:ale_echo_msg_warning_str = 'W' | |
let g:ale_echo_msg_format = '[%linter%] %s [%severity%] [%...code...%]' | |
"""" Enable completion where available. | |
let g:ale_completion_enabled = 1 | |
""" Customize linters that are turned on | |
let g:ale_linters = { | |
\ 'python': ['flake8'], | |
\} | |
let g:ale_set_highlights = 0 | |
" Fix keys | |
set backspace=2 | |
let g:UltiSnipsExpandTrigger='<tab>' | |
let g:UltiSnipsListSnippets='<c-tab>' | |
let g:UltiSnipsJumpForwardTrigger='<c-j>' | |
let g:UltiSnipsJumpBackwardTrigger='<c-k>' | |
nmap <F8> :TagbarToggle<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment