Skip to content

Instantly share code, notes, and snippets.

@Azhng
Last active September 9, 2018 00:00
Show Gist options
  • Save Azhng/e26a66b66b2e4c447ef309fccaee5bbc to your computer and use it in GitHub Desktop.
Save Azhng/e26a66b66b2e4c447ef309fccaee5bbc to your computer and use it in GitHub Desktop.
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'tmhedberg/SimpylFold'
Plugin 'vim-scripts/indentpython.vim'
Plugin 'scrooloose/syntastic'
Plugin 'nvie/vim-flake8'
Plugin 'jnurmine/Zenburn'
Plugin 'altercation/vim-colors-solarized'
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'kien/ctrlp.vim'
Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
Bundle 'Valloric/YouCompleteMe'
call vundle#end()
filetype plugin indent on
let g:SimpylFold_docstring_preview=1
set nu
set splitbelow
set splitright
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>
nmap <silent> <C-N> :NERDTreeToggle<CR>
set foldmethod=indent
set foldlevel=99
nnoremap <space> za
inoremap { {}<Left>
inoremap {<CR> {<CR>}<Esc>O
inoremap {{ {
inoremap {} {}
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
set encoding=utf-8
let g:ycm_autoclose_preview_window_after_completion=1
let g:ycm_global_ycm_extra_conf = '/users/z577zhan/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
let python_highlight_all=1
syntax on
if has('gui_running')
set background=dark
colorscheme solarized
else
colorscheme zenburn
endif
call togglebg#map("<F5>")
let NERDTreeIgnore=['\.pyc$', '\~$']
set clipboard=unnamed
set list
set listchars=eol:$,tab:>-,trail:~,space:~,extends:>,precedes:<
set tabstop=2 shiftwidth=2 expandtab
au VimEnter * NERDTree
@Azhng
Copy link
Author

Azhng commented Dec 1, 2017

To set up for the first time after copy this to ~/.vimrc, enter vim, type :PluginInstall and wait for all the plugins to finish installing.
Then make sure you compile your ycm server using following command

cd ~/.vim/bundle/YouCompleteMe
./install.sh --clang-completer 

Then everything should be good to go.

@Azhng
Copy link
Author

Azhng commented Dec 2, 2017

Install Vundle first. It's easy just google it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment