Skip to content

Instantly share code, notes, and snippets.

@kapilgarg1996
Created August 19, 2020 08:19
Show Gist options
  • Save kapilgarg1996/73ea03c7f6e52b78f4893cb8b1d6f88e to your computer and use it in GitHub Desktop.
Save kapilgarg1996/73ea03c7f6e52b78f4893cb8b1d6f88e to your computer and use it in GitHub Desktop.
vimrc for python javascript with ctrlp and youcompleteme
function! BuildYCM(info)
" info is a dictionary with 3 fields
" - name: name of the plugin
" - status: 'installed', 'updated', or 'unchanged'
" - force: set on PlugInstall! or PlugUpdate!
if a:info.status == 'installed' || a:info.force
! ./install.py --all
endif
endfunction
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-surround'
Plug 'jeetsukumaran/vim-pythonsense'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-commentary'
Plug 'wikitopian/hardmode'
Plug 'jiangmiao/auto-pairs'
Plug 'preservim/nerdtree'
Plug 'Valloric/YouCompleteMe', { 'do': function('BuildYCM') }
Plug 'leshill/vim-json'
Plug 'editorconfig/editorconfig-vim'
Plug 'tmhedberg/SimpylFold'
Plug 'jelera/vim-javascript-syntax', { 'for': 'javascript' }
call plug#end()
set runtimepath^=~/.vim/bundle/ctrlp.vim
colorscheme badwolf
syntax on
let g:javascript_plugin_flow = 0
set tabstop=4
set softtabstop=4
set expandtab
set textwidth=0
set wrap
set shiftwidth=4
set autoindent
set smartindent
set cindent
set number
set showcmd
set cursorline
filetype indent on
set wildmenu
set lazyredraw
set showmatch
set incsearch
set hlsearch
nnoremap <space><space> :nohlsearch<CR>
nnoremap , za
set foldmethod=indent
set foldlevel=99
set backup
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set backupskip=/tmp/*,/private/tmp/*
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set writebackup
let g:javascript_plugin_flow = 1
let g:jsx_ext_required = 0
nnoremap <S-l> :tabnext<CR>
nnoremap <S-h> :tabprev<CR>
nnoremap tn :tabnew<CR>
let g:ctrlp_by_filename = 0
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git'
let g:NERDTreeNodeDelimiter = "\t"
map <C-n> :NERDTreeToggle<CR>
map <C-m> :NERDTreeFind<CR>
filetype on
let g:ctrlp_prompt_mappings = { 'AcceptSelection("v")': ['<c-v>' ], 'AcceptSelection("e")': ['<CR>']}
map <C-t><up> :tabr<cr>
map <C-t><down> :tabl<cr>
map <C-t><left> :tabp<cr>
map <C-t><right> :tabn<cr>
set relativenumber
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>
nnoremap gF gF<C-w><S-l>
let g:ycm_autoclose_preview_window_after_completion=1
let mapleader=" "
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
map <leader>u :YcmCompleter GoToReferences<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment