Combine rcfiles + add gvimrc
This commit is contained in:
parent
6f939253e7
commit
16b03e574f
117
gvimrc
Normal file
117
gvimrc
Normal file
|
@ -0,0 +1,117 @@
|
|||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" gvimrc "
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
" Say neigh to UI cruft!
|
||||
set go-=T
|
||||
set go-=l
|
||||
set go-=L
|
||||
set go-=r
|
||||
set go-=R
|
||||
" No GUI tabs!
|
||||
set go-=e
|
||||
" Don't show dialogues, use text prompts
|
||||
set go+=c
|
||||
|
||||
" Sets File>Open to start in current file's path
|
||||
set browsedir=buffer
|
||||
|
||||
" Share a clipboard with OS and vim terminal sessions
|
||||
if has('unnamedplus')
|
||||
set clipboard=unnamedplus
|
||||
else
|
||||
set clipboard=unnamed
|
||||
endif
|
||||
|
||||
" For macvim
|
||||
if has('gui_macvim')
|
||||
|
||||
" j doesn't seem to work from terminal
|
||||
set formatoptions+=j
|
||||
|
||||
" set guifont=Ubuntu\ Mono:h14
|
||||
" set guifont=Monaco:h12
|
||||
set guifont=Inconsolata:h16
|
||||
|
||||
" Replace some CMD shortcuts
|
||||
macmenu &File.Open\.\.\. key=<nop>
|
||||
macmenu &Tools.Make key=<nop>
|
||||
|
||||
" Switching buffers
|
||||
nmap <D-]> ]b
|
||||
nmap <D-[> [b
|
||||
|
||||
" Textmate-like CMD+Enter
|
||||
inoremap <D-CR> <C-O>o
|
||||
inoremap <S-D-CR> <C-O>O
|
||||
|
||||
" Fast scrolling
|
||||
map <D-j> 5j
|
||||
map <D-k> 5k
|
||||
imap <D-j> <C-o>5j
|
||||
imap <D-k> <C-o>5k
|
||||
|
||||
" Commenting using CMD+/"
|
||||
nmap <D-/> gcc
|
||||
vmap <D-/> gc
|
||||
|
||||
" Tab navigation
|
||||
nmap <D-1> 1gt
|
||||
nmap <D-2> 2gt
|
||||
nmap <D-3> 3gt
|
||||
nmap <D-4> 4gt
|
||||
nmap <D-5> 5gt
|
||||
nmap <D-6> 6gt
|
||||
nmap <D-7> 7gt
|
||||
nmap <D-8> 8gt
|
||||
nmap <D-9> 9gt
|
||||
|
||||
map <D-r> <leader>r
|
||||
" Replace :make
|
||||
map <D-b> :Dispatch<CR>
|
||||
|
||||
" Shortcuts to outside apps {{{
|
||||
" Open in finder
|
||||
nnoremap <localleader>f :silent !open "%:p:h"<CR>
|
||||
nnoremap <localleader>F :silent !open .<CR>
|
||||
|
||||
" Open in terminal
|
||||
nnoremap <localleader>t :silent !open -a iTerm "%:p:h"<CR>
|
||||
nnoremap <localleader>T :silent !open -a iTerm .<CR>
|
||||
|
||||
" Send to transmit
|
||||
nnoremap <localleader>u :silent !open -a Transmit "%"<CR>
|
||||
|
||||
" Send to launchbar (project and file, respectively)
|
||||
nnoremap <silent> <localleader>[ :call LaunchBarSelect(expand("%:p:h"))<CR>
|
||||
nnoremap <silent> <localleader>] :call LaunchBarSelect(expand("%:p"))<CR>
|
||||
|
||||
func LaunchBarSelect(arg)
|
||||
silent! let l:arg = substitute(a:arg, '[^A-Za-z0-9_.~-/]','\="%".printf("%02X",char2nr(submatch(0)))','g')
|
||||
if l:arg ==# ""
|
||||
let l:arg = expand("%:p:h")
|
||||
endif
|
||||
exec 'silent !open "x-launchbar:select?file=' . l:arg . '"'
|
||||
endfunc
|
||||
" }}}
|
||||
|
||||
else
|
||||
|
||||
" For unix only
|
||||
inoremap <C-v> <C-r>*
|
||||
cnoremap <C-v> <C-r>*
|
||||
|
||||
set go-=m
|
||||
set novisualbell
|
||||
|
||||
" For gvim
|
||||
set guifont=Monospace\ 10
|
||||
|
||||
" Commenting using Ctrl+/
|
||||
map <C-/> gcc
|
||||
|
||||
" Textmate-like CMD+Enter
|
||||
inoremap <C-CR> <C-O>o
|
||||
inoremap <S-C-CR> <C-O>O
|
||||
|
||||
endif
|
|
@ -1,167 +0,0 @@
|
|||
|
||||
" Shortcut to vimrc and gvimrc
|
||||
nnoremap <localleader>v :CtrlP ~/.vim<CR>
|
||||
|
||||
" Comma get some... sorry.
|
||||
let mapleader = ','
|
||||
let maplocalleader = '\'
|
||||
noremap ; :
|
||||
|
||||
" Trigger to preserve indentation on pastes
|
||||
set pastetoggle=<F12>
|
||||
" Easier than escape. Pinnacle of laziness.
|
||||
imap jk <ESC>
|
||||
" Turn off search highlighting
|
||||
noremap <silent> <leader>? :nohlsearch<CR>
|
||||
|
||||
" Navigation {{{
|
||||
" Normalize all the navigation keys to move by row/col despite any wrapped text
|
||||
noremap j gj
|
||||
noremap k gk
|
||||
" % matchit shortcut, but only in normal mode!
|
||||
nmap <Tab> %
|
||||
" Easier fold toggle
|
||||
nnoremap <Space> 5j
|
||||
vnoremap <Space> 5j
|
||||
nnoremap <Backspace> 5k
|
||||
vnoremap <Backspace> 5k
|
||||
|
||||
" f: Find. Also support repeating with .
|
||||
nnoremap <Plug>OriginalSemicolon ;
|
||||
nnoremap <silent> f :<C-u>call repeat#set("\<lt>Plug>OriginalSemicolon")<CR>f
|
||||
nnoremap <silent> t :<C-u>call repeat#set("\<lt>Plug>OriginalSemicolon")<CR>t
|
||||
nnoremap <silent> F :<C-u>call repeat#set("\<lt>Plug>OriginalSemicolon")<CR>F
|
||||
nnoremap <silent> T :<C-u>call repeat#set("\<lt>Plug>OriginalSemicolon")<CR>T
|
||||
" }}}
|
||||
|
||||
" Editing {{{
|
||||
nnoremap <C-b> <C-^>
|
||||
" Insert-mode navigation
|
||||
" Go to end of line
|
||||
inoremap <C-e> <Esc>A
|
||||
" Go to start of line
|
||||
inoremap <C-a> <Esc>I
|
||||
|
||||
" Make Y act consistant with C and D
|
||||
nnoremap Y y$
|
||||
|
||||
" Don't leave visual mode after indenting
|
||||
vnoremap < <gv
|
||||
vnoremap > >gv
|
||||
|
||||
" Textmate-like CMD+Enter (O in insert mode)
|
||||
inoremap <S-CR> <C-O>o
|
||||
inoremap <C-S-CR> <C-O>O
|
||||
|
||||
" Enabling repeat in visual mode
|
||||
vmap . :normal .<CR>
|
||||
" }}}
|
||||
|
||||
" Buffers {{{
|
||||
" Change CWD to current file's directory
|
||||
nnoremap <leader>cd :cd %:p:h<cr>:pwd<cr>
|
||||
|
||||
" Next/prev buffer
|
||||
nnoremap ]b :<C-u>bnext<CR>
|
||||
nnoremap [b :<C-u>bprevious<CR>
|
||||
" }}}
|
||||
|
||||
" Command {{{
|
||||
" Annoying command mistakes <https://github.com/spf13/spf13-vim>
|
||||
com! -bang -nargs=* -complete=file E e<bang> <args>
|
||||
com! -bang -nargs=* -complete=file W w<bang> <args>
|
||||
com! -bang -nargs=* -complete=file Wq wq<bang> <args>
|
||||
com! -bang -nargs=* -complete=file WQ wq<bang> <args>
|
||||
com! -bang Wa wa<bang>
|
||||
com! -bang WA wa<bang>
|
||||
com! -bang Q q<bang>
|
||||
com! -bang QA qa<bang>
|
||||
com! -bang Qa qa<bang>
|
||||
" Forget to sudo?
|
||||
com! WW w !sudo tree % >/dev/null
|
||||
|
||||
" Shortcuts
|
||||
cnoremap ;/ <C-R>=expand('%:p:h').'/'<CR>
|
||||
cnoremap ;; <C-R>=expand("%:t")<CR>
|
||||
cnoremap ;. <C-R>=expand("%:p:r")<CR>
|
||||
|
||||
" Mimic shortcuts in the terminal
|
||||
cnoremap <C-a> <Home>
|
||||
cnoremap <C-e> <End>
|
||||
" }}}
|
||||
|
||||
" External Tools {{{
|
||||
" Send cwd to tmux
|
||||
nnoremap <localleader>x :Tmux cd <C-r>=expand("%:p:h")<CR><CR>
|
||||
nnoremap <localleader>X :Tmux cd <C-r>=expand("%:p:r")<CR><CR>
|
||||
" }}}
|
||||
|
||||
" Plugins {{{
|
||||
" bufkill
|
||||
nnoremap zx :Bdelete<CR>
|
||||
|
||||
" CtrlP
|
||||
let g:ctrlp_map = ''
|
||||
" Only open CtrlP if the cwd ISN'T $HOME
|
||||
nnoremap <silent><expr> <leader>/ getcwd() != $HOME ? ":<C-u>CtrlPCurWD<CR>" : ":<C-u>echoe 'Cannot open CtrlP in HOME'<CR>"
|
||||
nnoremap <silent> <leader>. :CtrlPCurFile<CR>
|
||||
nnoremap <silent> <leader>, :CtrlPBuffer<CR>
|
||||
nnoremap <silent> <leader>; :CtrlPFunky<CR>
|
||||
nnoremap <silent> <leader>m :CtrlPMRU<CR>
|
||||
nnoremap <silent> <leader>M :CtrlPModified<CR>
|
||||
nnoremap <silent> <leader>t :CtrlPBufTag<CR>
|
||||
nnoremap <silent> <leader>T :CtrlPBufTagAll<CR>
|
||||
|
||||
" NERDTree
|
||||
map <localleader>\ :NERDTreeCWD<CR>
|
||||
map <localleader>. :NERDTreeFind<CR>
|
||||
|
||||
" Tabularize
|
||||
nmap <leader>a= :Tabularize /=<CR>
|
||||
vmap <leader>a= :Tabularize /=<CR>
|
||||
nmap <leader>a> :Tabularize /=><CR>
|
||||
vmap <leader>a> :Tabularize /=><CR>
|
||||
nmap <leader>a: :Tabularize /:<CR>
|
||||
vmap <leader>a: :Tabularize /:<CR>
|
||||
nmap <leader>a:: :Tabularize /:\zs<CR>
|
||||
vmap <leader>a:: :Tabularize /:\zs<CR>
|
||||
nmap <leader>a, :Tabularize /,<CR>
|
||||
vmap <leader>a, :Tabularize /,<CR>
|
||||
nmap <leader>a<Bar> :Tabularize /<Bar><CR>
|
||||
vmap <leader>a<Bar> :Tabularize /<Bar><CR>
|
||||
|
||||
" UltiSnips
|
||||
let g:UltiSnipsExpandTrigger = "<Tab>"
|
||||
let g:UltiSnipsJumpForwardTrigger = "<Tab>"
|
||||
let g:UltiSnipsJumpBackwardTrigger = "<S-Tab>"
|
||||
" Ignore the default snippets so I (and others) can define their own
|
||||
let g:UltiSnipsSnippetDirectories = ["snips"]
|
||||
|
||||
" Emmet
|
||||
imap <expr> <C-CR> emmet#expandAbbrIntelligent("\<tab>")
|
||||
|
||||
" YCM
|
||||
map g] :YcmCompleter GoToDefinitionElseDeclaration<CR>
|
||||
let g:ycm_key_list_select_completion = ['<C-j>', '<Down>']
|
||||
let g:ycm_key_list_previous_completion = ['<C-k>', '<Up>']
|
||||
|
||||
" vim-surround
|
||||
" I turned the keymappings around to restore the 'feedback'
|
||||
" I get from operator mode after common vim commands, like d
|
||||
" and c.
|
||||
let g:surround_no_mappings = 1
|
||||
nmap sd <Plug>Dsurround
|
||||
nmap sc <Plug>Csurround
|
||||
nmap s <Plug>Ysurround
|
||||
nmap S <Plug>YSurround
|
||||
nmap ss <Plug>Yssurround
|
||||
nmap Ss <Plug>YSsurround
|
||||
nmap SS <Plug>YSsurround
|
||||
xmap S <Plug>VSurround
|
||||
xmap Sg <Plug>VgSurround
|
||||
|
||||
" vim-switch
|
||||
nnoremap <CR> :Switch<CR>
|
||||
" }}}
|
||||
|
||||
" vim:set ft=vim:
|
|
@ -1,150 +0,0 @@
|
|||
" Appearance {{{
|
||||
NeoBundle 'reedes/vim-colors-pencil'
|
||||
|
||||
" Pretty indent indicators
|
||||
" NeoBundle 'Yggdroot/indentLine'
|
||||
" let g:indentLine_color_gui = '#4a514f'
|
||||
" }}}
|
||||
|
||||
" File search {{{
|
||||
" More powerful file searching
|
||||
if executable('ag')
|
||||
NeoBundle 'rking/ag.vim'
|
||||
elseif executable('ack')
|
||||
NeoBundle 'mileszs/ack.vim'
|
||||
endif
|
||||
|
||||
" Project-wide search and replace
|
||||
" NeoBundle 'skwp/greplace.vim'
|
||||
|
||||
" Netrw improvements
|
||||
NeoBundle 'scrooloose/nerdtree'
|
||||
let NERDTreeMinimalUI = 1
|
||||
let NERDTreeChDirMode = 2
|
||||
" let NERDTreeBookmarksFile = "$HOME/.vim/tmp/NERDtreeBookmarks"
|
||||
let NERDTreeIgnore = ['\~$', '\.swo$', '\.swp$', '\.git$', '\.hg', '\.svn', '\.bzr', '\.settings', '\.project', '\.DS_Store']
|
||||
let NERDTreeShowHidden = 1
|
||||
|
||||
" Command-T, Peepopen or Goto-anything, but for vim, written in VimL
|
||||
NeoBundle 'kien/ctrlp.vim'
|
||||
" Ctrlp extension for jumping to functions
|
||||
NeoBundle 'tacahiroy/ctrlp-funky'
|
||||
" Ctrlp extension for listing git modified files
|
||||
NeoBundle 'jasoncodes/ctrlp-modified.vim'
|
||||
let g:ctrlp_extensions = ['tag', 'buffertag', 'funky']
|
||||
" let g:ctrlp_max_height = 10
|
||||
let g:ctrlp_cache_dir = "~/.vim/tmp/ctrlp"
|
||||
let g:ctrlp_custom_ignore = {
|
||||
\ 'dir': '\.(git|hg|svn|settings)$|tmp$',
|
||||
\ 'file': '\.(exe|so|dll|sass-cache|classpaths|project|cache|jpg|png|gif|swf)$'
|
||||
\ }
|
||||
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
|
||||
let g:ctrlp_match_window = 'bottom,order:btt,min:10,max:10,results:10'
|
||||
" }}}
|
||||
|
||||
" Editing {{{
|
||||
" Extended visual mode commands, substitutes and searches
|
||||
NeoBundle 'vis'
|
||||
|
||||
" Auto-closes delimiters like (),{},[],etc.
|
||||
NeoBundle 'Raimondi/delimitMate'
|
||||
let g:delimitMate_expand_cr = 1
|
||||
let g:delimitMate_expand_space = 1
|
||||
|
||||
" HTML & CSS emmet goodness; Zen coding's successor
|
||||
NeoBundle 'mattn/emmet-vim'
|
||||
|
||||
" Clean way to close buffers without altering window layout
|
||||
" NeoBundle 'mattdbridges/bufkill.vim'
|
||||
NeoBundle 'moll/vim-bbye'
|
||||
|
||||
" For aligning text
|
||||
NeoBundle 'godlygeek/tabular'
|
||||
|
||||
" Comment out code with native comment syntax
|
||||
NeoBundle 'tomtom/tcomment_vim'
|
||||
let g:tcomment_types = {'blade': '{-- %s --}', 'twig': '{# %s #}'}
|
||||
|
||||
" Offers some plugins better compatibility with repeat ('.')
|
||||
NeoBundle 'tpope/vim-repeat'
|
||||
|
||||
" Easy changing and insertion of surrounding delimiters (e.g. quotes,
|
||||
" parenthesis, etc.)
|
||||
NeoBundle 'tpope/vim-surround'
|
||||
|
||||
" Snippets system
|
||||
if has("python")
|
||||
NeoBundle 'SirVer/ultisnips'
|
||||
|
||||
" My snippets
|
||||
NeoBundle 'hlissner/vim-ultisnips-snippets'
|
||||
endif
|
||||
|
||||
" One-key switching between true/false, yes/no, etc
|
||||
NeoBundle 'AndrewRadev/switch.vim'
|
||||
" }}}
|
||||
|
||||
" Remote resources {{{
|
||||
" Visual git diffs in the gutter
|
||||
NeoBundle 'airblade/vim-gitgutter'
|
||||
let g:gitgutter_realtime = 0
|
||||
let g:gitgutter_eager = 0
|
||||
|
||||
" 'a Git wrapper so awesome, it should be illegal'
|
||||
" NeoBundle 'tpope/vim-fugitive'
|
||||
|
||||
" Async compiler plugins
|
||||
" NeoBundle 'tpope/vim-dispatch'
|
||||
" }
|
||||
|
||||
" Programming {{{
|
||||
" Syntax checkers for a multitude of languages
|
||||
" NeoBundle 'scrooloose/syntastic'
|
||||
" let g:syntastic_auto_loc_list=0
|
||||
" " let g:syntastic_quiet_messages={'level': 'warnings'}
|
||||
" let g:syntastic_phpcs_disable=1
|
||||
" let g:syntastic_echo_current_error=1
|
||||
" let g:syntastic_enable_balloons = 0
|
||||
"
|
||||
" let g:syntastic_error_symbol = '►'
|
||||
" let g:syntastic_warning_symbol = '►'
|
||||
"
|
||||
" let g:syntastic_loc_list_height = 5
|
||||
" let g:syntastic_mode_map = {'mode': 'active', 'active_filetypes': [], 'passive_filetypes': ['html']}
|
||||
|
||||
" Running code inline for testing purposes
|
||||
NeoBundle 'notalex/vim-run-live'
|
||||
" }}}
|
||||
|
||||
" Syntax {{{
|
||||
" HTML
|
||||
" NeoBundle 'othree/html5.vim'
|
||||
|
||||
" CSS/SCSS/LESS
|
||||
NeoBundle 'cakebaker/scss-syntax.vim'
|
||||
|
||||
" PHP
|
||||
NeoBundleLazy 'StanAngeloff/php.vim', {'autoload': {'filetypes': ['php', 'blade']}}
|
||||
NeoBundleLazy '2072/PHP-Indenting-for-VIm', {'autoload': {'filetypes': ['php']}}
|
||||
" NeoBundleLazy 'stephpy/vim-phpdoc', {'autoload': {'filetypes': ['php']}}
|
||||
|
||||
" Python
|
||||
NeoBundleLazy 'indentpython.vim--nianyang', {'autoload': {'filetypes': ['python']}}
|
||||
NeoBundleLazy 'python_match.vim', {'autoload': {'filetypes': ['python']}}
|
||||
|
||||
" Javascript/Node
|
||||
NeoBundleLazy 'pangloss/vim-javascript', {'autoload': {'filetypes': ['javascript']}}
|
||||
" NeoBundleLazy 'moll/vim-node', {'autoload': {'filetypes': ['javascript']}}
|
||||
NeoBundleLazy 'marijnh/tern_for_vim', {'autoload': {'filetypes': ['javascript']}, 'build': {'mac' : 'npm install'}}
|
||||
|
||||
" C/C++
|
||||
"NeoBundle 'octol/vim-cpp-enhanced-highlight'
|
||||
|
||||
" Other
|
||||
NeoBundle 'tpope/vim-markdown'
|
||||
" }}}
|
||||
|
||||
" NeoBundleCheck
|
||||
filetype indent plugin on
|
||||
|
||||
" vim:set ft=vim:
|
270
vimrc
270
vimrc
|
@ -1,8 +1,5 @@
|
|||
|
||||
set nocompatible
|
||||
|
||||
let g:is_ssh = ($SSH_TTY != "")
|
||||
|
||||
" Initialize NeoBundle
|
||||
set rtp+=~/.vim/bundle/neobundle.vim/
|
||||
call neobundle#rc(expand('~/.vim/bundle'))
|
||||
|
@ -164,17 +161,264 @@ NeoBundleFetch 'Shougo/neobundle.vim'
|
|||
au BufRead,BufNewFile *.scss set filetype=scss
|
||||
" }}}
|
||||
|
||||
" Bundles and their settings are specified externally.
|
||||
source $HOME/.vim/rc/plugins.vim
|
||||
"""""""""""""""""""""""""""""""""""""""""
|
||||
" Packages/Bundles and their settings "
|
||||
"""""""""""""""""""""""""""""""""""""""""
|
||||
" {{{
|
||||
" File search {{{
|
||||
" More powerful file searching
|
||||
if executable('ag')
|
||||
NeoBundle 'rking/ag.vim'
|
||||
elseif executable('ack')
|
||||
NeoBundle 'mileszs/ack.vim'
|
||||
endif
|
||||
|
||||
" rcfiles
|
||||
source $HOME/.vim/rc/keymaps.vim
|
||||
source $HOME/.vim/rc/util.vim
|
||||
" Project-wide search and replace
|
||||
" NeoBundle 'skwp/greplace.vim'
|
||||
|
||||
" If one exists, this is where you'll want local settings
|
||||
try
|
||||
source $HOME/.vimrc.local
|
||||
catch
|
||||
endtry
|
||||
" Netrw improvements
|
||||
NeoBundle 'scrooloose/nerdtree'
|
||||
let NERDTreeMinimalUI = 1
|
||||
let NERDTreeChDirMode = 2
|
||||
" let NERDTreeBookmarksFile = "$HOME/.vim/tmp/NERDtreeBookmarks"
|
||||
let NERDTreeIgnore = ['\~$', '\.swo$', '\.swp$', '\.git$', '\.hg', '\.svn', '\.bzr', '\.settings', '\.project', '\.DS_Store']
|
||||
let NERDTreeShowHidden = 1
|
||||
|
||||
" Command-T, Peepopen or Goto-anything, but for vim, written in VimL
|
||||
NeoBundle 'kien/ctrlp.vim'
|
||||
" Ctrlp extension for jumping to functions
|
||||
NeoBundle 'tacahiroy/ctrlp-funky'
|
||||
" Ctrlp extension for listing git modified files
|
||||
NeoBundle 'jasoncodes/ctrlp-modified.vim'
|
||||
let g:ctrlp_extensions = ['tag', 'buffertag', 'funky']
|
||||
" let g:ctrlp_max_height = 10
|
||||
let g:ctrlp_cache_dir = "~/.vim/tmp/ctrlp"
|
||||
let g:ctrlp_custom_ignore = {
|
||||
\ 'dir': '\.(git|hg|svn|settings)$|tmp$',
|
||||
\ 'file': '\.(exe|so|dll|sass-cache|classpaths|project|cache|jpg|png|gif|swf)$'
|
||||
\ }
|
||||
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
|
||||
let g:ctrlp_match_window = 'bottom,order:btt,min:10,max:10,results:10'
|
||||
" }}}
|
||||
|
||||
" Editing {{{
|
||||
" Extended visual mode commands, substitutes and searches
|
||||
NeoBundle 'vis'
|
||||
|
||||
" Auto-closes delimiters like (),{},[],etc.
|
||||
NeoBundle 'Raimondi/delimitMate'
|
||||
let g:delimitMate_expand_cr = 1
|
||||
let g:delimitMate_expand_space = 1
|
||||
|
||||
" HTML & CSS emmet goodness; Zen coding's successor
|
||||
NeoBundle 'mattn/emmet-vim'
|
||||
|
||||
" Clean way to close buffers without altering window layout
|
||||
" NeoBundle 'mattdbridges/bufkill.vim'
|
||||
NeoBundle 'moll/vim-bbye'
|
||||
|
||||
" For aligning text
|
||||
NeoBundle 'godlygeek/tabular'
|
||||
|
||||
" Comment out code with native comment syntax
|
||||
NeoBundle 'tomtom/tcomment_vim'
|
||||
let g:tcomment_types = {'blade': '{-- %s --}', 'twig': '{# %s #}'}
|
||||
|
||||
" Offers some plugins better compatibility with repeat ('.')
|
||||
NeoBundle 'tpope/vim-repeat'
|
||||
|
||||
" Easy changing and insertion of surrounding delimiters (e.g. quotes,
|
||||
" parenthesis, etc.)
|
||||
NeoBundle 'tpope/vim-surround'
|
||||
|
||||
" Snippets system
|
||||
if has("python")
|
||||
NeoBundle 'SirVer/ultisnips'
|
||||
|
||||
" My snippets
|
||||
NeoBundle 'hlissner/vim-ultisnips-snippets'
|
||||
endif
|
||||
|
||||
" One-key switching between true/false, yes/no, etc
|
||||
NeoBundle 'AndrewRadev/switch.vim'
|
||||
" }}}
|
||||
|
||||
" Remote resources {{{
|
||||
" Visual git diffs in the gutter
|
||||
NeoBundle 'airblade/vim-gitgutter'
|
||||
let g:gitgutter_realtime = 0
|
||||
let g:gitgutter_eager = 0
|
||||
" }}}
|
||||
|
||||
" Programming {{{
|
||||
" Running code inline for testing purposes
|
||||
NeoBundle 'notalex/vim-run-live'
|
||||
" }}}
|
||||
|
||||
" Syntax {{{
|
||||
" CSS/SCSS/LESS
|
||||
NeoBundle 'cakebaker/scss-syntax.vim'
|
||||
|
||||
" PHP
|
||||
NeoBundleLazy 'StanAngeloff/php.vim', {'autoload': {'filetypes': ['php', 'blade']}}
|
||||
NeoBundleLazy '2072/PHP-Indenting-for-VIm', {'autoload': {'filetypes': ['php']}}
|
||||
" NeoBundleLazy 'stephpy/vim-phpdoc', {'autoload': {'filetypes': ['php']}}
|
||||
|
||||
" Python
|
||||
NeoBundleLazy 'klen/python-mode', {'autoload': {'filetypes': ['python']}}
|
||||
|
||||
" Javascript/Node
|
||||
NeoBundleLazy 'pangloss/vim-javascript', {'autoload': {'filetypes': ['javascript']}}
|
||||
|
||||
" Other
|
||||
NeoBundle 'tpope/vim-markdown'
|
||||
" }}}
|
||||
|
||||
" NeoBundleCheck
|
||||
filetype indent plugin on
|
||||
" }}}
|
||||
|
||||
"""""""""""""""""
|
||||
" Keymappings "
|
||||
"""""""""""""""""
|
||||
" {{{
|
||||
nnoremap <localleader>v :CtrlP ~/.vim<CR>
|
||||
|
||||
" Comma get some... sorry.
|
||||
let mapleader = ','
|
||||
let maplocalleader = '\'
|
||||
noremap ; :
|
||||
|
||||
" Trigger to preserve indentation on pastes
|
||||
set pastetoggle=<F12>
|
||||
" Easier than escape. Pinnacle of laziness.
|
||||
imap jk <ESC>
|
||||
" Turn off search highlighting
|
||||
noremap <silent> <leader>? :nohlsearch<CR>
|
||||
|
||||
" Navigation {{{
|
||||
" Normalize all the navigation keys to move by row/col despite any wrapped text
|
||||
noremap j gj
|
||||
noremap k gk
|
||||
" % matchit shortcut, but only in normal mode!
|
||||
nmap <Tab> %
|
||||
" Easier fold toggle
|
||||
nnoremap <C-j> 5j
|
||||
vnoremap <C-j> 5j
|
||||
nnoremap <C-k> 5k
|
||||
vnoremap <C-k> 5k
|
||||
|
||||
" f: Find. Also support repeating with .
|
||||
nnoremap <Plug>OriginalSemicolon ;
|
||||
nnoremap <silent> f :<C-u>call repeat#set("\<lt>Plug>OriginalSemicolon")<CR>f
|
||||
nnoremap <silent> t :<C-u>call repeat#set("\<lt>Plug>OriginalSemicolon")<CR>t
|
||||
nnoremap <silent> F :<C-u>call repeat#set("\<lt>Plug>OriginalSemicolon")<CR>F
|
||||
nnoremap <silent> T :<C-u>call repeat#set("\<lt>Plug>OriginalSemicolon")<CR>T
|
||||
" }}}
|
||||
|
||||
" Editing {{{
|
||||
nnoremap <C-b> <C-^>
|
||||
" Insert-mode navigation
|
||||
" Go to end of line
|
||||
inoremap <C-e> <Esc>A
|
||||
" Go to start of line
|
||||
inoremap <C-a> <Esc>I
|
||||
|
||||
" Make Y act consistant with C and D
|
||||
nnoremap Y y$
|
||||
|
||||
" Don't leave visual mode after indenting
|
||||
vnoremap < <gv
|
||||
vnoremap > >gv
|
||||
|
||||
" Textmate-like CMD+Enter (O in insert mode)
|
||||
inoremap <S-CR> <C-O>o
|
||||
inoremap <C-S-CR> <C-O>O
|
||||
|
||||
" Enabling repeat in visual mode
|
||||
vmap . :normal .<CR>
|
||||
" }}}
|
||||
|
||||
" Buffers {{{
|
||||
" Change CWD to current file's directory
|
||||
nnoremap <leader>cd :cd %:p:h<cr>:pwd<cr>
|
||||
|
||||
" Next/prev buffer
|
||||
nnoremap ]b :<C-u>bnext<CR>
|
||||
nnoremap [b :<C-u>bprevious<CR>
|
||||
" }}}
|
||||
|
||||
" Command {{{
|
||||
" Annoying command mistakes <https://github.com/spf13/spf13-vim>
|
||||
com! -bang -nargs=* -complete=file E e<bang> <args>
|
||||
com! -bang -nargs=* -complete=file W w<bang> <args>
|
||||
com! -bang -nargs=* -complete=file Wq wq<bang> <args>
|
||||
com! -bang -nargs=* -complete=file WQ wq<bang> <args>
|
||||
com! -bang Wa wa<bang>
|
||||
com! -bang WA wa<bang>
|
||||
com! -bang Q q<bang>
|
||||
com! -bang QA qa<bang>
|
||||
com! -bang Qa qa<bang>
|
||||
" Forget to sudo?
|
||||
com! WW w !sudo tree % >/dev/null
|
||||
|
||||
" Shortcuts
|
||||
cnoremap ;/ <C-R>=expand('%:p:h').'/'<CR>
|
||||
cnoremap ;; <C-R>=expand("%:t")<CR>
|
||||
cnoremap ;. <C-R>=expand("%:p:r")<CR>
|
||||
|
||||
" Mimic shortcuts in the terminal
|
||||
cnoremap <C-a> <Home>
|
||||
cnoremap <C-e> <End>
|
||||
" }}}
|
||||
|
||||
" External Tools {{{
|
||||
" Send cwd to tmux
|
||||
nnoremap <localleader>x :Tmux cd <C-r>=expand("%:p:h")<CR><CR>
|
||||
nnoremap <localleader>X :Tmux cd <C-r>=expand("%:p:r")<CR><CR>
|
||||
" }}}
|
||||
|
||||
" Plugins {{{
|
||||
" bufkill
|
||||
nnoremap zz :Bdelete<CR>
|
||||
|
||||
" CtrlP
|
||||
let g:ctrlp_map = ''
|
||||
" Only open CtrlP if the cwd ISN'T $HOME
|
||||
nnoremap <silent><expr> <leader>/ getcwd() != $HOME ? ":<C-u>CtrlPCurWD<CR>" : ":<C-u>echoe 'Cannot open CtrlP in HOME'<CR>"
|
||||
nnoremap <silent> <leader>. :CtrlPCurFile<CR>
|
||||
nnoremap <silent> <leader>, :CtrlPBuffer<CR>
|
||||
nnoremap <silent> <leader>; :CtrlPFunky<CR>
|
||||
nnoremap <silent> <leader>m :CtrlPMRU<CR>
|
||||
nnoremap <silent> <leader>M :CtrlPModified<CR>
|
||||
nnoremap <silent> <leader>t :CtrlPBufTag<CR>
|
||||
nnoremap <silent> <leader>T :CtrlPBufTagAll<CR>
|
||||
|
||||
" NERDTree
|
||||
map <localleader>\ :NERDTreeCWD<CR>
|
||||
map <localleader>. :NERDTreeFind<CR>
|
||||
|
||||
" Tabularize
|
||||
nmap <leader>= :Tabularize /
|
||||
|
||||
" UltiSnips
|
||||
let g:UltiSnipsExpandTrigger = "<Tab>"
|
||||
let g:UltiSnipsJumpForwardTrigger = "<Tab>"
|
||||
let g:UltiSnipsJumpBackwardTrigger = "<S-Tab>"
|
||||
" Ignore the default snippets so I (and others) can define their own
|
||||
let g:UltiSnipsSnippetDirectories = ["snips"]
|
||||
|
||||
" Emmet
|
||||
imap <expr> <C-CR> emmet#expandAbbrIntelligent("\<tab>")
|
||||
|
||||
" YCM
|
||||
map g] :YcmCompleter GoToDefinitionElseDeclaration<CR>
|
||||
let g:ycm_key_list_select_completion = ['<C-j>', '<Down>']
|
||||
let g:ycm_key_list_previous_completion = ['<C-k>', '<Up>']
|
||||
|
||||
" vim-switch
|
||||
nnoremap ! :Switch<CR>
|
||||
" }}}
|
||||
" }}}
|
||||
|
||||
" vim:set fdl=0 fdm=marker:
|
||||
|
|
Loading…
Reference in a new issue