Last active
August 29, 2015 14:12
-
-
Save spikensbror/1d98326499f3b40879c7 to your computer and use it in GitHub Desktop.
My current vim configuration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"===== Using this configuration. =====" | |
" This configuration expects Vim to be ran through gVim and requires pathogen to | |
" be installed as well. | |
" It also requires the following plugins in order to function as expected: | |
" * ctrlp.vim - https://github.com/kien/ctrlp.vim | |
" * vim-colorschemes - https://github.com/flazz/vim-colorschemes | |
" * vim-bbye - https://github.com/moll/vim-bbye | |
" Finally, the default font for this config is Source Code Pro created by Adobe | |
" which is both free and open-source. | |
" Source Code Pro is located at: https://github.com/adobe-fonts/source-code-pro | |
"===== Startup =====" | |
"Invoke pathogen." | |
call pathogen#infect() | |
"===== Options =====" | |
"Set encoding to 'latin1'." | |
"set encoding=latin1" | |
"Fix backspace." | |
set backspace=2 | |
"Setup local .vimrc inclusion." | |
set exrc | |
set secure | |
"GUI options." | |
winpos 0 0 | |
set number | |
set guifont=Source_Code_Pro:h14:cANSI | |
set guioptions-=m "Hide menu." | |
set guioptions-=T "Hide toolbar." | |
set guioptions-=r "Hide right-hand scrollbar." | |
set guioptions-=L "Hide left-hand scrollbar." | |
"Text options." | |
set expandtab | |
set smartindent | |
set shiftwidth=2 | |
set softtabstop=2 | |
set colorcolumn=80 | |
set nowrap | |
"Syntax-highlighting options and color-scheme." | |
syntax on | |
set bg=dark" | |
"colors bluedrake" | |
"colors monokai" | |
"colors darkrobot" | |
"colors dusk" | |
"colors inkpot" | |
"colors oceandeep" | |
"colors pacific" | |
"colors sexy-railscasts" | |
"colors solarized" | |
"colors seoul256" | |
colors gruvbox | |
"set bg=light" | |
"colors saturn" | |
"colors sf" | |
"colors stackoverflow" | |
"colors github" | |
"Set ctrlp.vim options and shortcuts." | |
let g:ctrlp_map='<c-p>' | |
let g:ctrlp_cmd='CtrlP' | |
let g:ctrlp_working_path_mode=0 | |
"===== Shortcuts =====" | |
"Set custom navigational shortcuts." | |
noremap h <NOP> | |
noremap j <Left> | |
noremap k <Down> | |
noremap l <Up> | |
noremap <Char-0x00F6> <Right> | |
"Set custom window shortcuts." | |
nnoremap <C-w>h <NOP> | |
nnoremap <C-w>j <C-w><C-h> | |
nnoremap <C-w>k <C-w><C-j> | |
nnoremap <C-w>l <C-w><C-k> | |
nnoremap <C-w><Char-0x00F6> <C-w><C-l> | |
nnoremap <C-w>J <C-w>< | |
nnoremap <C-w>K <C-w>- | |
nnoremap <C-w>L <C-w>+ | |
nnoremap <C-w><Char-0x00D6> <C-w>> | |
"Set to-do shortcut." | |
nnoremap <C-a>t :noautocmd vimgrep /\ctodo/j **/*<CR>:cw<CR><C-w>p | |
"Setup git-related shortcuts." | |
nnoremap <C-g>s :GitStatus<CR> | |
nnoremap <C-g>p :GitPush<Space> | |
nnoremap <C-g>P :GitPull<Space> | |
nnoremap <C-g>c :GitCommit<Space> | |
nnoremap <C-g>C :GitCheckout<Space> | |
nnoremap <C-g>m :GitMerge<Space> | |
"===== Commands =====" | |
"Set custom shell commands." | |
command! -nargs=* -range=0 -complete=file Shell call RunAndEcho(<q-args>) | |
command! -nargs=* -range=0 -complete=file Cmd call RunAndEcho(<q-args>) | |
"Create custom command for reloading the vimrc file." | |
command! Reload so $MYVIMRC | |
"Create custom helper commands." | |
command! NT NERDTreeFind | |
command! LS call RunAndEcho("ls -hl") | |
command! ShowMenu set guioptions+=m | |
command! HideMenu set guioptions-=m | |
command! EX call system("explorer .") | |
command! BD Bdelete | |
"Set custom git commands and shortcuts." | |
command! -nargs=* GitStatus call RunAndEcho("git status", <q-args>) | |
command! -nargs=* GitPull call RunAndEcho("git pull", <q-args>) | |
command! -nargs=* GitPush call RunAndEcho("git push", <q-args>) | |
command! -nargs=* GitCommit call RunAndEcho("git commit", <q-args>) | |
command! -nargs=* GitCheckout call RunAndEcho("git checkout", <q-args>) | |
command! -nargs=* GitMerge call RunAndEcho("git merge", <q-args>) | |
"===== Functions =====" | |
"Define the command-shell echo helper." | |
function! RunAndEcho(...) | |
let command = '' | |
for part in a:000 | |
let command .= part . ' ' | |
endfor | |
echo command | |
echo system(command) | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment