Skip to content

Instantly share code, notes, and snippets.

@grvgl
Last active December 30, 2017 10:51
Show Gist options
  • Save grvgl/727bd32a075ebe14ea12 to your computer and use it in GitHub Desktop.
Save grvgl/727bd32a075ebe14ea12 to your computer and use it in GitHub Desktop.
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
"grvgl starts"
" Vim-Plug Plugins
call plug#begin('~/.vim/plugged')
Plug 'junegunn/fzf' "A command-line fuzzy finder
Plug 'junegunn/fzf.vim' "Things you can do with fzf and Vim
Plug 'scrooloose/nerdtree'
Plug 'scrooloose/syntastic'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'godlygeek/tabular'
Plug 'plasticboy/vim-markdown'
Plug 'pangloss/vim-javascript'
Plug 'othree/html5.vim' "HTML5 omnicomplete and syntax
Plug 'severin-lemaignan/vim-minimap'
Plug 'vim-airline/vim-airline' "lean & mean status/tabline for vim that's light as air
Plug 'vim-airline/vim-airline-themes' "A collection of themes for vim-airline
Plug 'ggreer/the_silver_searcher' "A code-searching tool similar to ack, but faster.
Plug 'tomtom/tcomment_vim' "An extensible & universal comment vim-plugin that also handles embedded filetypes
Plug 'ap/vim-buftabline' "Forget Vim tabs � now you can have buffer tabs
Plug 'mkitt/tabline.vim' "Configure tabs within Terminal Vim
Plug 'maksimr/vim-jsbeautify' "vim plugin which formated javascript files by js-beautify
call plug#end()
colorscheme zellner
au GUIEnter * simalt ~x
set guioptions-=l
set guioptions-=L
set guioptions-=r
set guioptions-=R
set guioptions-=T
"========== Set Font starts =========
if has("gui_running")
if has("gui_gtk2")
set guifont=Inconsolata\ 12
elseif has("gui_macvim")
set guifont=Menlo\ Regular:h14
elseif has("gui_win32")
set guifont=Consolas:h11:cANSI
endif
endif
"========== Set Font ends =========
" Easily switch to directory of current file
map <Leader>cd :cd %:p:h<CR>
"========== Enable emenu starts ==========
source $VIMRUNTIME/menu.vim
set wildmenu
set cpo-=<
set wcm=<C-Z>
" Map opening of emenu to <F4>
map <F4> :emenu <C-Z>
"========== Enable emenu ends ==========
"==========Vim Spellchecker starts==========
" My own color scheme, the default is really bad
highlight clear SpellBad
highlight SpellBad term=standout term=underline cterm=italic ctermfg=Red
highlight clear SpellCap
highlight SpellCap term=standout term=underline cterm=italic ctermfg=Blue
highlight clear SpellLocal
highlight SpellLocal term=standout term=underline cterm=italic ctermfg=Blue
highlight clear SpellRare
highlight SpellRare term=standout term=underline cterm=italic ctermfg=Blue
" Disable spellcheck in latex comments
let g:tex_comment_nospell= 1
" use mouse for popups
set mousemodel=popup_setpos
"==========Vim Spellchecker ends==========
"folding settings
set foldmethod=indent "fold based on indent. ident | syntax
set foldnestmax=10 "deepest fold is 10 levels
set nofoldenable "dont fold by default
set foldlevel=1 "this is just what i use2
set guioptions-=m "add/remove menu bar
set guioptions-=T "add/remove toolbar
set guioptions+=r "add/remove right-hand scroll bar
set guioptions+=L "add/remove left-hand scroll bar
set number "Alwasy show line number
"==========Syntastic settings start=========
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_check_on_open = 1
let g:syntastic_check_on_wq = 0
"==========Syntastic settings end==========
"============mkitt/tabline.vim settings start==========
set showtabline=1
" }}}
" MyTabLine {{{
" This is an attempt to emulate the default Vim-7 tabs as closely as possible but with numbered tabs.
if exists("+showtabline")
function! MyTabLine()
let s = ''
for i in range(tabpagenr('$'))
" set up some oft-used variables
let tab = i + 1 " range() starts at 0
let winnr = tabpagewinnr(tab) " gets current window of current tab
let buflist = tabpagebuflist(tab) " list of buffers associated with the windows in the current tab
let bufnr = buflist[winnr - 1] " current buffer number
let bufname = bufname(bufnr) " gets the name of the current buffer in the current window of the current tab
let s .= '%' . tab . 'T' " start a tab
let s .= (tab == tabpagenr() ? '%#TabLineSel#' : '%#TabLine#') " if this tab is the current tab...set the right highlighting
let s .= ' ' . tab " current tab number
let n = tabpagewinnr(tab,'$') " get the number of windows in the current tab
if n > 1
let s .= ':' . n " if there's more than one, add a colon and display the count
endif
let bufmodified = getbufvar(bufnr, "&mod")
if bufmodified
let s .= ' +'
endif
if bufname != ''
let s .= ' ' . pathshorten(bufname) . ' ' " outputs the one-letter-path shorthand & filename
else
let s .= ' [No Name] '
endif
endfor
let s .= '%#TabLineFill#' " blank highlighting between the tabs and the righthand close 'X'
let s .= '%T' " resets tab page number?
let s .= '%=' " seperate left-aligned from right-aligned
let s .= '%#TabLine#' " set highlight for the 'X' below
let s .= '%999XX' " places an 'X' at the far-right
return s
endfunction
set tabline=%!MyTabLine()
endif
"==========mkitt/tabline.vim settings end==========
"==========NERDTree settings start==========
"autocmd vimenter * NERDTree "open a NERDTree automatically when vim starts up
"Map F3 to open/close NERDTree
map <silent> <F3> :NERDTreeToggle <cr>
"==========NERDTree settings end==========
"==========maksimr/vim-jsbeautify settings start==========
map <c-f> :call JsBeautify()<cr>
" or
autocmd FileType javascript noremap <buffer> <c-f> :call JsBeautify()<cr>
" for json
autocmd FileType json noremap <buffer> <c-f> :call JsonBeautify()<cr>
" for jsx
autocmd FileType jsx noremap <buffer> <c-f> :call JsxBeautify()<cr>
" for html
autocmd FileType html noremap <buffer> <c-f> :call HtmlBeautify()<cr>
" for css or scss
autocmd FileType css noremap <buffer> <c-f> :call CSSBeautify()<cr>
"To beautify only selected lines use functions RangeJsBeautify, RangeJsonBeautify, RangeJsxBeautify, RangeHtmlBeautify, or RangeCSSBeautify.
autocmd FileType javascript vnoremap <buffer> <c-f> :call RangeJsBeautify()<cr>
autocmd FileType json vnoremap <buffer> <c-f> :call RangeJsonBeautify()<cr>
autocmd FileType jsx vnoremap <buffer> <c-f> :call RangeJsxBeautify()<cr>
autocmd FileType html vnoremap <buffer> <c-f> :call RangeHtmlBeautify()<cr>
autocmd FileType css vnoremap <buffer> <c-f> :call RangeCSSBeautify()<cr>
"==========maksimr/vim-jsbeautify settings end==========
let g:python_host_prog = '../programs/python27'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment