Created
February 27, 2016 10:07
-
-
Save JFriel/d3117d06443db4266749 to your computer and use it in GitHub Desktop.
This file contains 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
execute pathogen#infect() | |
"syntastic config | |
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 | |
"remap ESC | |
inoremap jk <ESC> | |
let mapleader = "\<Space>" | |
"map the windowing to easier commands | |
noremap <silent> ss <C-W>s | |
noremap <silent> vv <C-W>v | |
noremap <silent> qq <C-W>q | |
"map the move between windows to be a bit nicer in insert mode | |
map <silent><down><down> <C-W>j | |
map <silent><up><up> <C-W>k | |
map <silent><right><right> <C-W>l | |
map <silent><left><left> <C-W>h | |
"keep indent and syntax on | |
filetype plugin indent on | |
syntax on | |
"searching | |
set showmatch | |
set ignorecase | |
set smartcase | |
set hlsearch | |
"no EOF 'ding' and make it all look nice | |
set noerrorbells | |
set ruler | |
set autoread | |
set encoding=utf-8 | |
set background=dark | |
colorscheme gruvbox | |
set history=100 | |
"tabbing | |
set expandtab | |
set smarttab | |
set shiftwidth=4 | |
set tabstop=4 | |
"indent | |
set ai "auto indent | |
set si "smart indent | |
"remove meanu buttons | |
set guioptions-=m | |
set guioptions-=T | |
"CTRL-P | |
set runtimepath^=~/.vim/bundle/ctrlp.vim | |
"NERD_tree | |
autocmd StdinReadPre * let s:std_in=1 | |
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif | |
map <C-n> :NERDTreeToggle<CR> | |
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif | |
let g:NERDTreeDirArrowExpandable = '▸' | |
let g:NERDTreeDirArrowCollapsible = '▾' | |
" NERDTress File highlighting | |
function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg) | |
exec 'autocmd filetype nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg | |
exec 'autocmd filetype nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#' | |
endfunction | |
call NERDTreeHighlightFile('py','Red', 'none', 'red', '#151515') | |
call NERDTreeHighlightFile('jade', 'green', 'none', 'green', '#151515') | |
call NERDTreeHighlightFile('ini', 'yellow', 'none', 'yellow', '#151515') | |
call NERDTreeHighlightFile('md', 'blue', 'none', '#3366FF', '#151515') | |
call NERDTreeHighlightFile('yml', 'yellow', 'none', 'yellow', '#151515') | |
call NERDTreeHighlightFile('config', 'yellow', 'none', 'yellow', '#151515') | |
call NERDTreeHighlightFile('conf', 'yellow', 'none', 'yellow', '#151515') | |
call NERDTreeHighlightFile('json', 'yellow', 'none', 'yellow', '#151515') | |
call NERDTreeHighlightFile('html', 'yellow', 'none', 'yellow', '#151515') | |
call NERDTreeHighlightFile('styl', 'cyan', 'none', 'cyan', '#151515') | |
call NERDTreeHighlightFile('css', 'cyan', 'none', 'cyan', '#151515') | |
call NERDTreeHighlightFile('coffee', 'Red', 'none', 'red', '#151515') | |
call NERDTreeHighlightFile('js', 'Red', 'none', '#ffa500', '#151515') | |
call NERDTreeHighlightFile('php', 'Magenta', 'none', '#ff00ff', '#151515') | |
" Delete trailing white space on save, useful for Python and CoffeeScript ;) | |
func! DeleteTrailingWS() | |
exe "normal mz" | |
%s/\s\+$//ge | |
exe "normal `z" | |
endfunc | |
autocmd BufWrite *.py :call DeleteTrailingWS() | |
autocmd BufWrite *.coffee :call DeleteTrailingWS() | |
"copy and paste to the syste of Codility is to assess thism register | |
nmap s <Nop> | |
vmap s <Nop> | |
nmap sy "+y | |
nmap sp "+p | |
nmap sY "+Y | |
nmap sP "+P | |
set clipboard=unnamedplus | |
nmap ; : | |
nmap <C-i> ggVG=<C-o><C-o> | |
nmap // :nohlsearch<CR> | |
"in normal mode map ; to the command console | |
nmap ; : | |
"Disable replace mode so it doesn't destroy undo history | |
nmap R <Nop> | |
nmap r <Nop> | |
nmap tab ggVG=<C-o><C-o> | |
" Map Ctrl-Backspace to delete the previous word in insert mode. | |
:imap <C-BS> <C-W> | |
set nowrap | |
set number | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment