Skip to content

Instantly share code, notes, and snippets.

@kristoferjoseph
Created June 23, 2016 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kristoferjoseph/4334022ba5a6ed9c7fe705709eaa47ea to your computer and use it in GitHub Desktop.
Save kristoferjoseph/4334022ba5a6ed9c7fe705709eaa47ea to your computer and use it in GitHub Desktop.
" keyboard shortcuts
inoremap jj <ESC>
nnoremap ; :
"NAVIGATION
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
nnoremap j gj
nnoremap k gk
"EXPLORE
let g:netrw_liststyle=3
let g:netrw_banner=0
"Ignore things
set wildignore+=*.swp,*.bak,*.pyc,*.class,*/dist
" No pooping backup files
set nobackup
set noswapfile
" highlight search
set hlsearch
nmap <leader>w :nohlsearch<CR>
nmap <leader>hl :let @/ = ""<CR>
"Tell vim to use javascript syntax for JSON files
autocmd BufNewFile,BufRead *.json set ft=javascript
" Copy paste
set pastetoggle=<F2>
nnoremap <leader>y :YRShow<CR>
"Expansion to active file directory
cnoremap <expr> %% getcmdtype() == ':' ? expand('%:h').'/' : '%%'
noremap <tab> %
"Save on focus out of file
au FocusLost * :wa
" Theme
colors pencil
" Airline
let g:airline_powerline_fonts = 1
let g:airline_theme='light'
let g:Powerline_symbols = 'fancy'
" indent line
let g:indentLine_enabled = 1
let g:indentLine_char = '│'
let g:indentLine_color_term = 239
let g:indentLine_color_gui = '#9474b2'
let g:indentLine_color_tty_light = 2 " (default: 4)
let g:indentLine_color_dark = 1 " (default: 2)
" vim-javascript for jsx
let g:javascript_enable_domhtmlcss = 1
" lint
" let g:syntastic_javascript_checkers = ['jsxhint']
let g:syntastic_javascript_checkers = ['eslint']
" Disambiguate ,a & ,t from the Align plugin, making them fast again.
"
" This section is here to prevent AlignMaps from adding a bunch of mappings
" that interfere with the very-common ,a and ,t mappings. This will get run
" at every startup to remove the AlignMaps for the *next* vim startup.
"
" If you do want the AlignMaps mappings, remove this section, remove
" ~/.vim/bundle/Align, and re-run rake in maximum-awesome.
function! s:RemoveConflictingAlignMaps()
if exists("g:loaded_AlignMapsPlugin")
AlignMapsClean
endif
endfunction
command! -nargs=0 RemoveConflictingAlignMaps call s:RemoveConflictingAlignMaps()
silent! autocmd VimEnter * RemoveConflictingAlignMaps
map <c-f> :call JsBeautify()<cr>
" or
autocmd FileType javascript noremap <buffer> <c-f> :call JsBeautify()<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>
" tern
nnoremap <Leader>tD :TernDoc<CR>
let g:tern_map_keys=1
let g:tern_show_argument_hints='on_hold'
:set cursorline
hi CursorLine term=bold cterm=bold guibg=Grey40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment