Skip to content

Instantly share code, notes, and snippets.

Created March 12, 2017 12:05
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ngurajeka/09c8fb1e0945fc531534fd37a42eb0f0 to your computer and use it in GitHub Desktop.
" Automatic reloading of .vimrc
autocmd! bufwritepost ~/.vimrc source %
" Show whitespace
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
au InsertLeave * match ExtraWhitespace /\s\+$/
filetype off
filetype plugin indent on
syntax on
" Show cursor line
set cursorline
set background=light
" set t_Co=256
" let g:molokai_original = 1
" let g:rehash256 = 1
if !has('gui_running')
" color luna-term
color gruvbox
set term=xterm-256color
let g:gruvbox_termcolors=16
if has('gui_running')
" color luna
" color spring-night
colorscheme gruvbox
if has("termguicolors")
set termguicolors
" Indentation
set cindent
set tabstop=4
set shiftwidth=4
" set softtabstop=4
set shiftround
set noexpandtab
" Smart search
set hlsearch
set incsearch
set ignorecase
set smartcase
if has('gui_running')
" set guifont=Ubuntu\ Mono\ derivative\ Powerline:h14
" set guifont=Source\ Code\ Pro\ for\ Powerline:h15
set guifont=Fantasque\ Sans\ Mono\ Regular:h14
" set guifont=Droid\ Sans\ Mono\ for\ Powerline:h14
" set guifont=Droid\ Sans\ Mono\ for\ Powerline:h14
set number
set showcmd
set nowrap
" Disable annoying backup files
set nobackup
set nowritebackup
set noswapfile
" Disable arrow keys
noremap <Up> :!say Tai Ngongo<CR><CR>
noremap <Down> :!say Tai Ngongo<CR><CR>
noremap <Right> :!say Tai Ngongo<CR><CR>
noremap <Left> :!say Tai Ngongo<CR><CR>
imap <up> <nop>
imap <down> <nop>
imap <right> <nop>
imap <left> <nop>
" Reindent everything
map <F7> mzgg=G`w
" Easy navigating
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
map <C-n> :rightbelow vnew<CR>
map gn $
map gb ^
map ge :rightbelow vnew ~/.vimrc<CR>
nmap wrap :set wrap<CR>
nmap nowrap :set nowrap<CR>
nmap <D-e> :Explore<CR>
" disable mouse
set mouse-=a
if has("gui_macvim")
set guioptions-=m
set guioptions-=T
set guioptions-=l
set guioptions-=L
set guioptions-=r
set guioptions-=R
nmap <D-]> >>
nmap <D-[> <<
vmap <D-[> <gv
vmap <D-]> >gv
" Hide annoying files
let g:netrw_list_hide='.*\.swp$,.*\.pyc,.*\.idea,.*\.git,.*\.phalcon,.*\.phpintel'
" enable pathogen
call pathogen#infect()
execute pathogen#infect()
" vim-go config
let g:go_fmt_autosave = 1
let g:go_fmt_command = "goimports"
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_fields = 1
let g:go_highlight_types = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
"command! Debug :GoBuild
function! Godebug()
command! Debug :call Godebug()
command! Imports :GoImports
command! Format :GoFmt
command! Fmt :GoFmt
command! Right :rightbelow vnew
command! E :Explore
command! ST :SyntasticToggleMode
command! SC :SyntasticCheck
command! Dark :set background=dark
command! Light :set background=light
" vim-jsx config
let g:jsx_ext_required = 0
au FileType javascript setl sw=2 ts=2 noexpandtab
" html & css indentation
au FileType html setl sw=2 sts=2 noexpandtab
au FileType css setl sw=2 sts=2 noexpandtab
au FileType json setl sw=2 sts=2 noexpandtab
" airline theme
set laststatus=2
let g:airline_powerline_fonts=1
" let g:airline_theme='luna'
" let g:airline_theme='spring_night'
let g:airline_theme='gruvbox'
" vim startify
let g:startify_list_order = ["dir", "bookmarks", "commands"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment