Skip to content

Instantly share code, notes, and snippets.

@ultimatecoder
Created March 30, 2017 13:36
Show Gist options
  • Save ultimatecoder/01eb86fba9ff1178a815b17c077f1b23 to your computer and use it in GitHub Desktop.
Save ultimatecoder/01eb86fba9ff1178a815b17c077f1b23 to your computer and use it in GitHub Desktop.
This is custom vim configuration file especially for my personal use. The script here is for backup purpose.
"Current
set incsearch
set autoindent
set backup
set ruler
set showcmd
set nu
set hlsearch
set exrc
set relativenumber
colorscheme molokai
set list
set listchars=tab:>-,trail:~,precedes:=
set expandtab
set tabstop=2
set shiftwidth=2
" Leader
let mapleader = ','
" Vundle
filetype off
set rtp+=~/.vim/bundle/Vundle.vim " required
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'klen/python-mode'
Plugin 'scrooloose/nerdtree'
Plugin 'Valloric/YouCompleteMe'
Plugin 'majutsushi/tagbar'
Plugin 'yars'
Plugin 'vim-voom/VOoM'
Plugin 'elzr/vim-json'
Plugin 'Quramy/vison'
Plugin 'ternjs/tern_for_vim'
Plugin 'tpope/vim-surround'
Plugin 'reedes/vim-wordy'
Plugin 'parkr/vim-jekyll'
Plugin 'dpelle/vim-LanguageTool'
Plugin 'shime/vim-livedown'
Plugin 'ludovicchabant/vim-gutentags'
Plugin 'junegunn/goyo.vim'
call vundle#end() " required
filetype plugin indent on " required
" Pymode
let g:pymode = 1
" Pymode-Folding
let g:pymode_folding = 0
" Pymode-Line
let g:pymode_options_colorcolumn = 1
" Pymode-Virtualenv
let g:pymode_virtualenv = 1
" Pymode-Code Checking
let g:pymode_lint = 0
let g:pymode_lint_checkers = ['pyflakes', 'pep8', 'mccabe', 'pep257']
let g:pymode_lint_on_fly = 1
let g:pymode_lint_on_write = 1
" Pymode-Rope
let g:pymode_rope = 0
let g:pymode_rope_lookup_project = 0
let g:pymode_rope_completion = 0
let g:pymode_rope_goto_definition_bind= '<Leader>d'
let g:pymode_rope_rename_bind = '<Leader>r'
" Pymode-Custom-Mapping
nmap <Leader>2 :let g:pymode_python='python'<Cr>
nmap <Leader>3 :let g:pymode_python='python3'<Cr>
" Tagbar
nmap <Leader>t :TagbarOpen fj<Cr>
nmap <Leader>tc :Tagbar <Cr>
autocmd FileType * nested :call tagbar#autoopen(0)
let g:tagbar_left = 1
" NERDTree - Custom-Mapping
nmap <Leader>n :NERDTreeToggle<Cr>
" YouCompleteMe
let g:ycm_server_python_interpreter='/usr/bin/python'
" VOoM - Custom Mapping
nmap <Leader>v :Voom rest<Cr>
autocmd BufRead *.rst :retab! 3
autocmd BufRead *.rst :call voom#Init('rest')
" Custom Mapping
noremap j h
noremap k j
noremap l k
noremap ; l
" Markdown Jekyll
au FileType markdown setlocal textwidth=80
" Jekyll
let g:jekyll_post_extension = '.md'
" Language tool
let g:languagetool_jar='$HOME/Jaysinh/LanguageTool-3.6/languagetool-commandline.jar'
" Goyo
"function! s:goyo_enter()
"set relativenumber
"endfunction
"
"autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd BufRead *.md Goyo
"autocmd BufRead nested call <SID>goyo_enter() *.md Goyo
" Goyo
let g:goyo_linenr = 1
"Old
set nocompatible
set backspace=indent,eol,start
filetype off
filetype plugin on
filetype indent on
syntax on
" Better modes. Remeber where we are
set viminfo=!,'100,\"100,:20,<50,s10,h,n~/.viminfo
set encoding=utf-8
set laststatus=2
set hidden
set number
set mouse=a
set smarttab
" Batter Search
set hlsearch
set incsearch
set ic "case insensitive search
"Show command in bottom right portion of the screen
set showcmd
" Display extra white space
set list listchars=tab:»·,trail:·
" customize the wildmenu
set wildmenu
set wildignore+=*.dll,*.o,*.pyc,*.bak,*.exe,*.jpg,*.jpeg,*.png,*.gif,*$py.class,*.class,*/*.dSYM/*,*.dylib
"use system clipboard to yank
set clipboard=unnamedplus
" sets leader to ',' and localleader to "\"
let mapleader=","
let maplocalleader="\\"
" quicker window switching
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" quicket tab switching
nmap <C->> :tabp<CR>
nmap <C-<> :tabn<CR>
" CtrlP mapping
map <leader>f :CtrlPCurWD<CR>
map <leader>b :CtrlPBuffer<cr>
map <leader>m :CtrlPMRU<cr>
" NERDTree toggle
map <leader>n :NERDTreeToggle<CR>
" Ack on <leader>a
nnoremap <leader>a :Ack
nnoremap <leader>A :AckFromSearch
let g:ackhighlight = 1
let g:ackpreview = 1
" hide matchecks on <leader>space
nnoremap <leader><space> :nohlsearch<cr>
" keep some more lines for scope
set scrolloff=5
" pasettogle use when pasting text that's already indented. vim don't fuck it using your autoindent
:set pastetoggle=<F3>
" Remove trailing whitespace on <leader>S
nnoremap <leader>S :%s/\s\+$//<cr>:let @/=''<CR>
"quick edit .vimrc and reload
nmap <silent> <leader>ev :e ~/.vimrc<CR>
nmap <silent> <leader>sv :so ~/.vimrc<CR>
"Force me to use hjkl ;)
map <up> <nop>
map <down> <nop>
map <left> <nop>
map <right> <nop>
"return to last edit position when opening files (You want this!)
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
"when forgot sudo at opening file
command WRITE w !sudo tee % > /dev/null
command! -range=% Isort :<line1>,<line2>! isort -
let g:solarized_termcolors=256
syntax enable
set background=light
colorscheme lucius
LuciusWhite
let NERDTreeIgnore = ['\.pyc$']
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
"python file smart setting
autocmd FileType python setlocal expandtab shiftwidth=4 tabstop=8
\ formatoptions=croq softtabstop=4 textwidth=74 comments=:#\:,:#
let python_highlight_all=1
let python_highlight_exceptions=0
let python_highlight_builtins=0
let python_slow_sync=1
let g:syntastic_python_checkers=['flake8', 'python']
" Don't warn on
" " E121 continuation line indentation is not a multiple of four
" " E128 continuation line under-indented for visual indent
" " E711 comparison to None should be 'if cond is not None:'
" " E301 expected 1 blank line, found 0
" " E261 at least two spaces before inline comment
" " E241 multiple spaces after ':'
" " E124 closing bracket does not match visual indentation
" " E126 continuation line over-indented for hanging indent
" " E721 do not compare types, use 'isinstance()'
" " E501 line too long (82 characters)
" " E231 missing whitespace after ','
let g:syntastic_python_flake8_args='--ignore=E121,E128,E711,E301,E261,E241,E124,E126,E721,E501,E231
\ --max-line-length=84'
" Javascript
autocmd FileType javascript setlocal expandtab shiftwidth=2 tabstop=2 softtabstop=2
let g:syntastic_javascript_checkers = ['jshint']
" XML, HTML, Jinja
autocmd FileType xml,html,htmljinja,htmldjango setlocal expandtab shiftwidth=2 tabstop=2 softtabstop=2
let g:syntastic_html_checkers = []
" CSS
autocmd FileType css setlocal expandtab shiftwidth=4 tabstop=4 softtabstop=4
autocmd FileType css noremap <buffer> <leader>r :call CSSBeautify()<cr
" Powerline
set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 9
set laststatus=2
let g:Powerline_symbols = 'fancy'
set rtp+=/Users/nate/Library/Python/2.7/lib/python/site-packages/powerline/bindings/vim
" PyMode
let g:pymode_trim_whitespace = 0
let g:pymode_indent = 1
let g:pymode_rope = 0
"bunlde
Bundle 'gmarik/vundle'
Bundle "scrooloose/nerdtree"
Bundle "kien/ctrlp.vim"
Bundle "scrooloose/nerdcommenter"
Bundle 'scrooloose/syntastic'
Bundle "JulesWang/css.vim"
Bundle 'maksimr/vim-jsbeautify'
Bundle 'andviro/flake8-vim'
Bundle 'mileszs/ack.vim'
Bundle 'fisadev/vim-isort'
Bundle 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim'}
Bundle 'tpope/vim-fugitive'
Bundle 'klen/python-mode'
Bundle 'davidhalter/jedi-vim'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment