diff --git a/settings/base.vim b/settings/base.vim index 8807d30..6d7076e 100644 --- a/settings/base.vim +++ b/settings/base.vim @@ -1,306 +1,306 @@ -" modeline and notes {{{ -" vim: set ft=vim sw=4 ts=4 sts=4 et tw=78 foldlevel=0 foldmethod=marker: -" -" Copyright 2015 gisphm -" Author: gisphm -" -" Licensed under the Apache License, Version 2.0 (the "License"); -" you may not use this file except in compliance with the License. -" You may obtain a copy of the License at -" -" http://www.apache.org/licenses/LICENSE-2.0 -" -" Unless required by applicable law or agreed to in writing, software -" distributed under the License is distributed on an "AS IS" BASIS, -" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -" See the License for the specific language governing permissions and -" limitations under the License. -" -" }}} - -" General {{{ - -set background=dark -filetype plugin on -syntax on " Syntax highlighting -set mouse=a " Automatically enable mouse usage -set mousehide " Hide the mouse cursor while typing -scriptencoding utf-8 -set encoding=utf-8 -set fileencodings=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,utf-16le,cp2512,iso-8859-15,latin1 -set fileencoding=utf-8 - - -if has('clipboard') - if has('unnamedplus') " When possible use + register for copy-paste - set clipboard=unnamed,unnamedplus - else " On mac and Windows, use * register for copy-paste - set clipboard=unnamed - endif -endif - -autocmd BufEnter * if bufname("") !~ "^\[A-Za-z0-9\]*://" | lcd %:p:h | endif - -set autowrite " Automatically write a file when leaving a modified buffer -set shortmess+=filmnrxoOtT " Abbrev. of messages (avoids 'hit enter') -set viewoptions=folds,options,cursor,unix,slash " Better Unix / Windows compatibility -set virtualedit=onemore " Allow for cursor beyond last character -set history=1000 " Store a ton of history (default is 20) -set spell " Spell checking on -set hidden " Allow buffer switching without saving -set iskeyword-=. " '.' is an end of word designator -set iskeyword-=# " '#' is an end of word designator -set iskeyword-=- " '-' is an end of word designator - -au FileType gitcommit au! BufEnter COMMIT_EDITMSG call setpos('.', [0, 1, 1, 0]) - -augroup resCur - autocmd! - autocmd BufWinEnter * call ResCur() -augroup END - -set backup " Backups are nice ... -if has('persistent_undo') - set undofile " So is persistent undo ... - set undolevels=1000 " Maximum number of changes that can be undone - set undoreload=10000 " Maximum number lines to save for undo on a buffer reload -endif - -let g:skipview_files = [ - \ '\[example pattern\]' - \ ] - -set dir=~/.vim/tmp/swap/ -set backupdir=~/.vim/tmp/backup/ -set undodir=~/.vim/tmp/undo/ -set viewdir=~/.vim/tmp/view/ - -" Resolve performance problems -" clear match command gracefully -autocmd BufWinLeave * call clearmatches() - -" }}} - -" Vim UI {{{ - -set tabpagemax=15 " Only show 15 tabs -set showmode " Display the current mode - -au WinLeave * set nocursorline nocursorcolumn -au WinEnter * set cursorline cursorcolumn -set cursorline cursorcolumn - -highlight clear SignColumn " SignColumn should match background -highlight clear LineNr " Current line number row will have same background color in relative mode - -if has('cmdline_info') - set ruler " Show the ruler - set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%) " A ruler on steroids - set showcmd " Show partial commands in status line and -endif - -if has('statusline') - set laststatus=2 - - " Broken down into easily includeable segments - set statusline=%<%f\ " Filename - set statusline+=%w%h%m%r " Options - if filereadable(expand('~/.vim/bundle/vim-fugitive/README.markdown')) - set statusline+=%{fugitive#statusline()} " Git Hotness - endif - set statusline+=\ [%{&ff}/%Y] " Filetype - set statusline+=\ [%{getcwd()}] " Current dir - set statusline+=%=%-14.(%l,%c%V%)\ %p%% " Right aligned file nav info -endif - -set backspace=indent,eol,start " Backspace for dummies -set linespace=0 " No extra spaces between rows -set number " Line numbers on -set showmatch " Show matching brackets/parenthesis -set incsearch " Find as you type search -set hlsearch " Highlight search terms -set winminheight=0 " Windows can be 0 line high -set ignorecase " Case insensitive search -set smartcase " Case sensitive when uc present -set wildmenu " Show list instead of just completing -set wildmode=list:longest,full " Command completion, list matches, then longest common part, then all. -set whichwrap=b,s,h,l,<,>,[,] " Backspace and cursor keys wrap too -set scrolljump=5 " Lines to scroll when cursor leaves screen -set scrolloff=3 " Minimum lines to keep above and below cursor -set foldenable " Auto fold code -set list -set listchars=tab:»\ ,trail:•,extends:#,nbsp:. " Highlight problematic whitespace - -" }}} - -" Formatting {{{ - -set wrap -set autoindent -set shiftwidth=4 -set expandtab -set tabstop=4 -set softtabstop=4 -set nojoinspaces -set splitright -set splitbelow -set pastetoggle= -autocmd FileType puppet,ruby,yml setlocal expandtab shiftwidth=2 softtabstop=2 -autocmd BufNewFile,BufRead *.coffee set filetype=coffee -autocmd FileType * autocmd BufWritePre call Preserve("%s/\\s\\+$//e") - -" }}} - -" Key Mappings {{{ - -let mapleader = ";" -let maplocalleader = "_" - -map j_ -map k_ -map l_ -map h_ - -nnoremap j gj -nnoremap k gk -imap jk - -" Map g* keys in Normal, Operator-pending, and Visual+select -noremap $ :call WrapRelativeMotion("$") -noremap :call WrapRelativeMotion("$") -noremap 0 :call WrapRelativeMotion("0") -noremap :call WrapRelativeMotion("0") -noremap ^ :call WrapRelativeMotion("^") -" Overwrite the operator pending $/ mappings from above -" to force inclusive motion with :execute normal! -onoremap $ v:call WrapRelativeMotion("$") -onoremap v:call WrapRelativeMotion("$") -" Overwrite the Visual+select mode mappings from above -" to ensure the correct vis_sel flag is passed to function -vnoremap $ :call WrapRelativeMotion("$", 1) -vnoremap :call WrapRelativeMotion("$", 1) -vnoremap 0 :call WrapRelativeMotion("0", 1) -vnoremap :call WrapRelativeMotion("0", 1) -vnoremap ^ :call WrapRelativeMotion("^", 1) - -map gT -map gt - -if has("user_commands") - command! -bang -nargs=* -complete=file E e - command! -bang -nargs=* -complete=file W w - command! -bang -nargs=* -complete=file Wq wq - command! -bang -nargs=* -complete=file WQ wq - command! -bang Wa wa - command! -bang WA wa - command! -bang Q q - command! -bang QA qa - command! -bang Qa qa -endif -cmap Tabe tabe - -nnoremap Y y$ - -nmap f0 :set foldlevel=0 -nmap f1 :set foldlevel=1 -nmap f2 :set foldlevel=2 -nmap f3 :set foldlevel=3 -nmap f4 :set foldlevel=4 -nmap f5 :set foldlevel=5 -nmap f6 :set foldlevel=6 -nmap f7 :set foldlevel=7 -nmap f8 :set foldlevel=8 -nmap f9 :set foldlevel=9 - -"UPPERCASE and lowsercase conversion -nnoremap g^ gUiW -nnoremap gv guiW - -"go to first and last char of line -nnoremap H ^ -nnoremap L g_ -vnoremap H ^ -vnoremap L g_ - -nmap / :nohlsearch - -" Find merge conflict markers -map fc /\v^[<\|=>]{7}( .*\|$) - -" Shortcuts -" Change Working Directory to that of the current file -cmap cwd lcd %:p:h -cmap cd. lcd %:p:h - -" Visual shifting (does not exit Visual mode) -vnoremap < >gv - -" Allow using the repeat operator with a visual selection (!) -" http://stackoverflow.com/a/8064607/127816 -vnoremap . :normal . - -" For when you forget to sudo.. Really Write the file. -cmap w!! w !sudo tee % >/dev/null - -" Some helpers to edit mode -" http://vimcasts.org/e/14 -cnoremap %% =fnameescape(expand('%:h')).'/' -map ew :e %% -map es :sp %% -map ev :vsp %% -map et :tabe %% - -" Adjust viewports to the same size -map = = - -" Map ff to display all lines with keyword under cursor -" and ask which one to jump to -nmap ff [I:let nr = input("Which one: ")exe "normal " . nr ."[\t" - -" Easier horizontal scrolling -map zl zL -map zh zH - -" Easier formatting -nnoremap q gwip - -" FIXME: Revert this f70be548 -" fullscreen mode for GVIM and Terminal, need 'wmctrl' in you PATH -map :call system("wmctrl -ir " . v:windowid . " -b toggle,fullscreen") - -nmap _$ :call Preserve("%s/\\s\\+$//e") - -" }}} - -" Functions {{{ - -function! Preserve(command) - let _s=@/ - let l=line(".") - let c=col(".") - execute a:command - let @/=_s - call cursor(l,c) -endfunction - -function! WrapRelativeMotion(key, ...) - let vis_sel="" - if a:0 - let vis_sel="gv" - endif - if &wrap - execute "normal!" vis_sel . "g" . a:key - else - execute "normal!" vis_sel . a:key - endif -endfunction - -function! ResCur() - if line("'\"") <= line("$") - normal! g`" - return 1 - endif -endfunction - -" }}} +" modeline and notes {{{ +" vim: set ft=vim sw=4 ts=4 sts=4 et tw=78 foldlevel=0 foldmethod=marker: +" +" Copyright 2015 gisphm +" Author: gisphm +" +" Licensed under the Apache License, Version 2.0 (the "License"); +" you may not use this file except in compliance with the License. +" You may obtain a copy of the License at +" +" http://www.apache.org/licenses/LICENSE-2.0 +" +" Unless required by applicable law or agreed to in writing, software +" distributed under the License is distributed on an "AS IS" BASIS, +" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +" See the License for the specific language governing permissions and +" limitations under the License. +" +" }}} + +" General {{{ + +set background=dark +filetype plugin on +syntax on " Syntax highlighting +set mouse=a " Automatically enable mouse usage +set mousehide " Hide the mouse cursor while typing +scriptencoding utf-8 +set encoding=utf-8 +set fileencodings=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,utf-16le,cp2512,iso-8859-15,latin1 +set fileencoding=utf-8 + + +if has('clipboard') + if has('unnamedplus') " When possible use + register for copy-paste + set clipboard=unnamed,unnamedplus + else " On mac and Windows, use * register for copy-paste + set clipboard=unnamed + endif +endif + +autocmd BufEnter * if bufname("") !~ "^\[A-Za-z0-9\]*://" | lcd %:p:h | endif + +set autowrite " Automatically write a file when leaving a modified buffer +set shortmess+=filmnrxoOtT " Abbrev. of messages (avoids 'hit enter') +set viewoptions=folds,options,cursor,unix,slash " Better Unix / Windows compatibility +set virtualedit=onemore " Allow for cursor beyond last character +set history=1000 " Store a ton of history (default is 20) +set spell " Spell checking on +set hidden " Allow buffer switching without saving +set iskeyword-=. " '.' is an end of word designator +set iskeyword-=# " '#' is an end of word designator +set iskeyword-=- " '-' is an end of word designator + +au FileType gitcommit au! BufEnter COMMIT_EDITMSG call setpos('.', [0, 1, 1, 0]) + +augroup resCur + autocmd! + autocmd BufWinEnter * call ResCur() +augroup END + +set backup " Backups are nice ... +if has('persistent_undo') + set undofile " So is persistent undo ... + set undolevels=1000 " Maximum number of changes that can be undone + set undoreload=10000 " Maximum number lines to save for undo on a buffer reload +endif + +let g:skipview_files = [ + \ '\[example pattern\]' + \ ] + +set dir=~/.vim/tmp/swap/ +set backupdir=~/.vim/tmp/backup/ +set undodir=~/.vim/tmp/undo/ +set viewdir=~/.vim/tmp/view/ + +" Resolve performance problems +" clear match command gracefully +autocmd BufWinLeave * call clearmatches() + +" }}} + +" Vim UI {{{ + +set tabpagemax=15 " Only show 15 tabs +set showmode " Display the current mode + +au WinLeave * set nocursorline nocursorcolumn +au WinEnter * set cursorline cursorcolumn +set cursorline cursorcolumn + +highlight clear SignColumn " SignColumn should match background +highlight clear LineNr " Current line number row will have same background color in relative mode + +if has('cmdline_info') + set ruler " Show the ruler + set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%) " A ruler on steroids + set showcmd " Show partial commands in status line and +endif + +if has('statusline') + set laststatus=2 + + " Broken down into easily includeable segments + set statusline=%<%f\ " Filename + set statusline+=%w%h%m%r " Options + if filereadable(expand('~/.vim/bundle/vim-fugitive/README.markdown')) + set statusline+=%{fugitive#statusline()} " Git Hotness + endif + set statusline+=\ [%{&ff}/%Y] " Filetype + set statusline+=\ [%{getcwd()}] " Current dir + set statusline+=%=%-14.(%l,%c%V%)\ %p%% " Right aligned file nav info +endif + +set backspace=indent,eol,start " Backspace for dummies +set linespace=0 " No extra spaces between rows +set number " Line numbers on +set showmatch " Show matching brackets/parenthesis +set incsearch " Find as you type search +set hlsearch " Highlight search terms +set winminheight=0 " Windows can be 0 line high +set ignorecase " Case insensitive search +set smartcase " Case sensitive when uc present +set wildmenu " Show list instead of just completing +set wildmode=list:longest,full " Command completion, list matches, then longest common part, then all. +set whichwrap=b,s,h,l,<,>,[,] " Backspace and cursor keys wrap too +set scrolljump=5 " Lines to scroll when cursor leaves screen +set scrolloff=3 " Minimum lines to keep above and below cursor +set foldenable " Auto fold code +set list +set listchars=tab:»\ ,trail:•,extends:#,nbsp:. " Highlight problematic whitespace + +" }}} + +" Formatting {{{ + +set wrap +set autoindent +set shiftwidth=4 +set expandtab +set tabstop=4 +set softtabstop=4 +set nojoinspaces +set splitright +set splitbelow +set pastetoggle= +autocmd FileType puppet,ruby,yml setlocal expandtab shiftwidth=2 softtabstop=2 +autocmd BufNewFile,BufRead *.coffee set filetype=coffee +autocmd FileType * autocmd BufWritePre call Preserve("%s/\\s\\+$//e") + +" }}} + +" Key Mappings {{{ + +let mapleader = ";" +let maplocalleader = "_" + +map j_ +map k_ +map l_ +map h_ + +nnoremap j gj +nnoremap k gk +imap jk + +" Map g* keys in Normal, Operator-pending, and Visual+select +noremap $ :call WrapRelativeMotion("$") +noremap :call WrapRelativeMotion("$") +noremap 0 :call WrapRelativeMotion("0") +noremap :call WrapRelativeMotion("0") +noremap ^ :call WrapRelativeMotion("^") +" Overwrite the operator pending $/ mappings from above +" to force inclusive motion with :execute normal! +onoremap $ v:call WrapRelativeMotion("$") +onoremap v:call WrapRelativeMotion("$") +" Overwrite the Visual+select mode mappings from above +" to ensure the correct vis_sel flag is passed to function +vnoremap $ :call WrapRelativeMotion("$", 1) +vnoremap :call WrapRelativeMotion("$", 1) +vnoremap 0 :call WrapRelativeMotion("0", 1) +vnoremap :call WrapRelativeMotion("0", 1) +vnoremap ^ :call WrapRelativeMotion("^", 1) + +map gT +map gt + +if has("user_commands") + command! -bang -nargs=* -complete=file E e + command! -bang -nargs=* -complete=file W w + command! -bang -nargs=* -complete=file Wq wq + command! -bang -nargs=* -complete=file WQ wq + command! -bang Wa wa + command! -bang WA wa + command! -bang Q q + command! -bang QA qa + command! -bang Qa qa +endif +cmap Tabe tabe + +nnoremap Y y$ + +nmap f0 :set foldlevel=0 +nmap f1 :set foldlevel=1 +nmap f2 :set foldlevel=2 +nmap f3 :set foldlevel=3 +nmap f4 :set foldlevel=4 +nmap f5 :set foldlevel=5 +nmap f6 :set foldlevel=6 +nmap f7 :set foldlevel=7 +nmap f8 :set foldlevel=8 +nmap f9 :set foldlevel=9 + +"UPPERCASE and lowsercase conversion +nnoremap g^ gUiW +nnoremap gv guiW + +"go to first and last char of line +nnoremap H ^ +nnoremap L g_ +vnoremap H ^ +vnoremap L g_ + +nmap / :nohlsearch + +" Find merge conflict markers +map fc /\v^[<\|=>]{7}( .*\|$) + +" Shortcuts +" Change Working Directory to that of the current file +cmap cwd lcd %:p:h +cmap cd. lcd %:p:h + +" Visual shifting (does not exit Visual mode) +vnoremap < >gv + +" Allow using the repeat operator with a visual selection (!) +" http://stackoverflow.com/a/8064607/127816 +vnoremap . :normal . + +" For when you forget to sudo.. Really Write the file. +cmap w!! w !sudo tee % >/dev/null + +" Some helpers to edit mode +" http://vimcasts.org/e/14 +cnoremap %% =fnameescape(expand('%:h')).'/' +map ew :e %% +map es :sp %% +map ev :vsp %% +map et :tabe %% + +" Adjust viewports to the same size +map = = + +" Map ff to display all lines with keyword under cursor +" and ask which one to jump to +nmap ff [I:let nr = input("Which one: ")exe "normal " . nr ."[\t" + +" Easier horizontal scrolling +map zl zL +map zh zH + +" Easier formatting +nnoremap q gwip + +" FIXME: Revert this f70be548 +" fullscreen mode for GVIM and Terminal, need 'wmctrl' in you PATH +map :call system("wmctrl -ir " . v:windowid . " -b toggle,fullscreen") + +nmap _$ :call Preserve("%s/\\s\\+$//e") + +" }}} + +" Functions {{{ + +function! Preserve(command) + let _s=@/ + let l=line(".") + let c=col(".") + execute a:command + let @/=_s + call cursor(l,c) +endfunction + +function! WrapRelativeMotion(key, ...) + let vis_sel="" + if a:0 + let vis_sel="gv" + endif + if &wrap + execute "normal!" vis_sel . "g" . a:key + else + execute "normal!" vis_sel . a:key + endif +endfunction + +function! ResCur() + if line("'\"") <= line("$") + normal! g`" + return 1 + endif +endfunction + +" }}} diff --git a/settings/css.vim b/settings/css.vim index 77217a7..d1bf5ee 100644 --- a/settings/css.vim +++ b/settings/css.vim @@ -1,30 +1,30 @@ -" modeline and notes {{{ -" vim: set ft=vim sw=4 ts=4 sts=4 et tw=78 foldlevel=0 foldmethod=marker: -" -" Copyright 2015 gisphm -" Author: gisphm -" -" Licensed under the Apache License, Version 2.0 (the "License"); -" you may not use this file except in compliance with the License. -" You may obtain a copy of the License at -" -" http://www.apache.org/licenses/LICENSE-2.0 -" -" Unless required by applicable law or agreed to in writing, software -" distributed under the License is distributed on an "AS IS" BASIS, -" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -" See the License for the specific language governing permissions and -" limitations under the License. -" -" }}} - -" CSS {{{ - -augroup VimCSS3Syntax - autocmd! - autocmd FileType css setlocal iskeyword+=- -augroup END -au BufRead,BufNewFile *.scss set filetype=scss.css -autocmd FileType scss set iskeyword+=- - -" }}} +" modeline and notes {{{ +" vim: set ft=vim sw=4 ts=4 sts=4 et tw=78 foldlevel=0 foldmethod=marker: +" +" Copyright 2015 gisphm +" Author: gisphm +" +" Licensed under the Apache License, Version 2.0 (the "License"); +" you may not use this file except in compliance with the License. +" You may obtain a copy of the License at +" +" http://www.apache.org/licenses/LICENSE-2.0 +" +" Unless required by applicable law or agreed to in writing, software +" distributed under the License is distributed on an "AS IS" BASIS, +" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +" See the License for the specific language governing permissions and +" limitations under the License. +" +" }}} + +" CSS {{{ + +augroup VimCSS3Syntax + autocmd! + autocmd FileType css setlocal iskeyword+=- +augroup END +au BufRead,BufNewFile *.scss set filetype=scss.css +autocmd FileType scss set iskeyword+=- + +" }}} diff --git a/settings/general.vim b/settings/general.vim index fd91027..3ff052d 100644 --- a/settings/general.vim +++ b/settings/general.vim @@ -1,175 +1,158 @@ -" modeline and notes {{{ -" vim: set ft=vim sw=4 ts=4 sts=4 et tw=78 foldlevel=0 foldmethod=marker: -" -" Copyright 2015 gisphm -" Author: gisphm -" -" Licensed under the Apache License, Version 2.0 (the "License"); -" you may not use this file except in compliance with the License. -" You may obtain a copy of the License at -" -" http://www.apache.org/licenses/LICENSE-2.0 -" -" Unless required by applicable law or agreed to in writing, software -" distributed under the License is distributed on an "AS IS" BASIS, -" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -" See the License for the specific language governing permissions and -" limitations under the License. -" -" }}} - -" ColorTheme {{{ - -if filereadable(expand("~/.vim/bundle/vim-colorschemes/README.md")) && - \ !has('gui_running') - colorscheme molokai - let g:molokai_original = 1 - let g:rehash256 = 1 -endif - -" }}} - -" AutoPairs {{{ - -let g:AutoPairsMapSpace = 0 -let g:AutoPairsMultilineClose = 0 - -" }}} - -" Tabularize {{{ - -nmap a& :Tabularize /& -vmap a& :Tabularize /& -nmap a= :Tabularize /^[^=]*\zs= -vmap a= :Tabularize /^[^=]*\zs= -nmap a=> :Tabularize /=> -vmap a=> :Tabularize /=> -nmap a: :Tabularize /: -vmap a: :Tabularize /: -nmap a:: :Tabularize /:\zs -vmap a:: :Tabularize /:\zs -nmap a, :Tabularize /, -vmap a, :Tabularize /, -nmap a,, :Tabularize /,\zs -vmap a,, :Tabularize /,\zs -nmap a :Tabularize / -vmap a :Tabularize / - -" }}} - -" Session {{{ - -set sessionoptions=blank,buffers,curdir,folds,tabpages,winsize -let g:session_autoload = "no" -let g:session_directory = "~/.vim/tmp/sessions/" -let g:session_lock_directory = "~/.vim/tmp/lock/" -let g:session_autosave = "yes" -let g:session_autosave_periodic = 1 -nmap so :OpenSession -nmap ss :SaveSession -nmap sc :CloseSession -nmap sd :DeleteSession -nmap sr :RestartVim -nmap sv :ViewSession - -" }}} - -" Airline {{{ - -let g:airline_theme_patch_func = 'AirlineThemePatch' -let g:airline_theme = 'badwolf' -let g:airline_powerline_fonts = 1 -let g:airline_mode_map = { - \ '__' : '-', - \ 'n' : 'N', - \ 'i' : 'I', - \ 'R' : 'R', - \ 'c' : 'C', - \ 'v' : 'V', - \ 'V' : 'V', - \ '' : 'V', - \ 's' : 'S', - \ 'S' : 'S', - \ '' : 'S', - \ } -if !exists('g:airline_symbols') - let g:airline_symbols = {} -endif -let g:airline_left_sep = '' -let g:airline_left_alt_sep = '' -let g:airline_right_sep = '' -let g:airline_right_alt_sep = '' -let g:airline_symbols.branch = '' -let g:airline_symbols.readonly = '' -let g:airline_symbols.linenr = '' -let g:airline_symbols.paste = '∥' -let g:airline_symbols.whitespace = 'Ξ' -nnoremap ar :AirlineRefresh - -" }}} - -" Wildfire {{{ - -let g:wildfire_objects = { - \ "*" : ["i'", 'i"', "i)", "i]", "i}", "ip"], - \ "html,xml" : ["at"], - \ } - -" }}} - -" UndoTree {{{ - -nnoremap u :UndotreeToggle -" If undotree is opened, it is likely one wants to interact with it. -let g:undotree_SetFocusWhenToggle = 1 - -" }}} - -" Signature {{{ - -let g:SignatureMap = { - \ 'Leader' : "m", - \ 'PlaceNextMark' : "m,", - \ 'ToggleMarkAtLine' : "m.", - \ 'PurgeMarksAtLine' : "m-", - \ 'DeleteMark' : "dm", - \ 'PurgeMarks' : "mda", - \ 'PurgeMarkers' : "m", - \ 'GotoNextLineAlpha' : "']", - \ 'GotoPrevLineAlpha' : "'[", - \ 'GotoNextSpotAlpha' : "`]", - \ 'GotoPrevSpotAlpha' : "`[", - \ 'GotoNextLineByPos' : "]'", - \ 'GotoPrevLineByPos' : "['", - \ 'GotoNextSpotByPos' : "mn", - \ 'GotoPrevSpotByPos' : "mp", - \ 'GotoNextMarker' : "[+", - \ 'GotoPrevMarker' : "[-", - \ 'GotoNextMarkerAny' : "]=", - \ 'GotoPrevMarkerAny' : "[=", - \ 'ListLocalMarks' : "ms", - \ 'ListLocalMarkers' : "m?" - \ } - -" }}} - -" Indent Guides {{{ - -let g:indent_guides_start_level = 2 -let g:indent_guides_guide_size = 1 -let g:indent_guides_enable_on_vim_startup = 1 -let g:indent_guides_auto_colors = 1 - -" }}} - -" Functions {{{ - -function! AirlineThemePatch(palette) - if g:airline_theme == 'badwolf' - for colors in values(a:palette.inactive) - let colors[3] = 245 - endfor - endif -endfunction - -" }}} +" modeline and notes {{{ +" vim: set ft=vim sw=4 ts=4 sts=4 et tw=78 foldlevel=0 foldmethod=marker: +" +" Copyright 2015 gisphm +" Author: gisphm +" +" Licensed under the Apache License, Version 2.0 (the "License"); +" you may not use this file except in compliance with the License. +" You may obtain a copy of the License at +" +" http://www.apache.org/licenses/LICENSE-2.0 +" +" Unless required by applicable law or agreed to in writing, software +" distributed under the License is distributed on an "AS IS" BASIS, +" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +" See the License for the specific language governing permissions and +" limitations under the License. +" +" }}} + +" ColorTheme {{{ + +if filereadable(expand("~/.vim/bundle/vim-colorschemes/README.md")) && + \ !has('gui_running') + colorscheme molokai + let g:molokai_original = 1 + let g:rehash256 = 1 +endif + +" }}} + +" AutoPairs {{{ + +let g:AutoPairsMapSpace = 0 +let g:AutoPairsMultilineClose = 0 + +" }}} + +" Tabularize {{{ + +nmap a& :Tabularize /& +vmap a& :Tabularize /& +nmap a= :Tabularize /^[^=]*\zs= +vmap a= :Tabularize /^[^=]*\zs= +nmap a=> :Tabularize /=> +vmap a=> :Tabularize /=> +nmap a: :Tabularize /: +vmap a: :Tabularize /: +nmap a:: :Tabularize /:\zs +vmap a:: :Tabularize /:\zs +nmap a, :Tabularize /, +vmap a, :Tabularize /, +nmap a,, :Tabularize /,\zs +vmap a,, :Tabularize /,\zs +nmap a :Tabularize / +vmap a :Tabularize / + +" }}} + +" Airline {{{ + +let g:airline_theme_patch_func = 'AirlineThemePatch' +let g:airline_theme = 'badwolf' +let g:airline_powerline_fonts = 1 +let g:airline_mode_map = { + \ '__' : '-', + \ 'n' : 'N', + \ 'i' : 'I', + \ 'R' : 'R', + \ 'c' : 'C', + \ 'v' : 'V', + \ 'V' : 'V', + \ '' : 'V', + \ 's' : 'S', + \ 'S' : 'S', + \ '' : 'S', + \ } +if !exists('g:airline_symbols') + let g:airline_symbols = {} +endif +let g:airline_left_sep = '' +let g:airline_left_alt_sep = '' +let g:airline_right_sep = '' +let g:airline_right_alt_sep = '' +let g:airline_symbols.branch = '' +let g:airline_symbols.readonly = '' +let g:airline_symbols.linenr = '' +let g:airline_symbols.paste = '∥' +let g:airline_symbols.whitespace = 'Ξ' +nnoremap ar :AirlineRefresh + +" }}} + +" Wildfire {{{ + +let g:wildfire_objects = { + \ "*" : ["i'", 'i"', "i)", "i]", "i}", "ip"], + \ "html,xml" : ["at"], + \ } + +" }}} + +" UndoTree {{{ + +nnoremap u :UndotreeToggle +" If undotree is opened, it is likely one wants to interact with it. +let g:undotree_SetFocusWhenToggle = 1 + +" }}} + +" Signature {{{ + +let g:SignatureMap = { + \ 'Leader' : "m", + \ 'PlaceNextMark' : "m,", + \ 'ToggleMarkAtLine' : "m.", + \ 'PurgeMarksAtLine' : "m-", + \ 'DeleteMark' : "dm", + \ 'PurgeMarks' : "mda", + \ 'PurgeMarkers' : "m", + \ 'GotoNextLineAlpha' : "']", + \ 'GotoPrevLineAlpha' : "'[", + \ 'GotoNextSpotAlpha' : "`]", + \ 'GotoPrevSpotAlpha' : "`[", + \ 'GotoNextLineByPos' : "]'", + \ 'GotoPrevLineByPos' : "['", + \ 'GotoNextSpotByPos' : "mn", + \ 'GotoPrevSpotByPos' : "mp", + \ 'GotoNextMarker' : "[+", + \ 'GotoPrevMarker' : "[-", + \ 'GotoNextMarkerAny' : "]=", + \ 'GotoPrevMarkerAny' : "[=", + \ 'ListLocalMarks' : "ms", + \ 'ListLocalMarkers' : "m?" + \ } + +" }}} + +" Indent Guides {{{ + +let g:indent_guides_start_level = 2 +let g:indent_guides_guide_size = 1 +let g:indent_guides_enable_on_vim_startup = 1 +let g:indent_guides_auto_colors = 1 + +" }}} + +" Functions {{{ + +function! AirlineThemePatch(palette) + if g:airline_theme == 'badwolf' + for colors in values(a:palette.inactive) + let colors[3] = 245 + endfor + endif +endfunction + +" }}} diff --git a/vundles/general.vim b/vundles/basic.vim similarity index 78% rename from vundles/general.vim rename to vundles/basic.vim index c470d4b..23fa0de 100644 --- a/vundles/general.vim +++ b/vundles/basic.vim @@ -1,46 +1,60 @@ -" modeline and notes {{{ -" vim: set ft=vim sw=4 ts=4 sts=4 et tw=78 foldlevel=0 foldmethod=marker: -" -" Copyright 2015 gisphm -" Author: gisphm -" -" Licensed under the Apache License, Version 2.0 (the "License"); -" you may not use this file except in compliance with the License. -" You may obtain a copy of the License at -" -" http://www.apache.org/licenses/LICENSE-2.0 -" -" Unless required by applicable law or agreed to in writing, software -" distributed under the License is distributed on an "AS IS" BASIS, -" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -" See the License for the specific language governing permissions and -" limitations under the License. -" -" }}} - -" General {{{ - -Plugin 'tpope/vim-surround' -Plugin 'tpope/vim-repeat' -Plugin 'jiangmiao/auto-pairs' -Plugin 'kristijanhusak/vim-multiple-cursors' -Plugin 'Firef0x/matchit' -Plugin 'bling/vim-airline' -Plugin 'Lokaltog/vim-easymotion' -Plugin 'flazz/vim-colorschemes' -Plugin 'mbbill/undotree' -Plugin 'nathanaelkane/vim-indent-guides' -Plugin 'vim-scripts/restore_view.vim' -Plugin 'tpope/vim-abolish.git' -Plugin 'osyo-manga/vim-over' -Plugin 'kana/vim-textobj-user' -Plugin 'kana/vim-textobj-indent' -Plugin 'gcmt/wildfire.vim' -Plugin 'godlygeek/tabular' -Plugin 'Raimondi/delimitMate' -Plugin 'xolox/vim-misc' -Plugin 'xolox/vim-session' -Plugin 'roman/golden-ratio' -Plugin 'kshenoy/vim-signature' - -" }}} +" modeline and notes {{{ +" vim: set ft=vim sw=4 ts=4 sts=4 et tw=78 foldlevel=0 foldmethod=marker: +" +" Copyright 2015 gisphm +" Author: gisphm +" +" Licensed under the Apache License, Version 2.0 (the "License"); +" you may not use this file except in compliance with the License. +" You may obtain a copy of the License at +" +" http://www.apache.org/licenses/LICENSE-2.0 +" +" Unless required by applicable law or agreed to in writing, software +" distributed under the License is distributed on an "AS IS" BASIS, +" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +" See the License for the specific language governing permissions and +" limitations under the License. +" +" }}} + +" General {{{ + +Plugin 'tpope/vim-surround' +Plugin 'tpope/vim-repeat' +Plugin 'jiangmiao/auto-pairs' +Plugin 'kristijanhusak/vim-multiple-cursors' +Plugin 'Firef0x/matchit' +Plugin 'bling/vim-airline' +Plugin 'Lokaltog/vim-easymotion' +Plugin 'flazz/vim-colorschemes' +Plugin 'mbbill/undotree' +Plugin 'nathanaelkane/vim-indent-guides' +Plugin 'vim-scripts/restore_view.vim' +Plugin 'tpope/vim-abolish.git' +Plugin 'osyo-manga/vim-over' +Plugin 'kana/vim-textobj-user' +Plugin 'kana/vim-textobj-indent' +Plugin 'gcmt/wildfire.vim' +Plugin 'godlygeek/tabular' +Plugin 'Raimondi/delimitMate' +Plugin 'roman/golden-ratio' +Plugin 'kshenoy/vim-signature' + +" }}} + +" Deps {{{ + +Plugin 'Shougo/vimproc.vim' +Plugin 'Shougo/neomru.vim' +Plugin 'Shougo/unite.vim' +Plugin 'Shougo/vimfiler.vim' +Plugin 'Shougo/unite-outline' +Plugin 'Shougo/context_filetype.vim' +Plugin 'MarcWeber/vim-addon-mw-utils' +Plugin 'tomtom/tlib_vim' +if executable('ack') + Plugin 'mileszs/ack.vim' +endif + +" }}} diff --git a/vundles/deps.vim b/vundles/deps.vim deleted file mode 100644 index ef93f08..0000000 --- a/vundles/deps.vim +++ /dev/null @@ -1,35 +0,0 @@ -" modeline and notes {{{ -" vim: set ft=vim sw=4 ts=4 sts=4 et tw=78 foldlevel=0 foldmethod=marker: -" -" Copyright 2015 gisphm -" Author: gisphm -" -" Licensed under the Apache License, Version 2.0 (the "License"); -" you may not use this file except in compliance with the License. -" You may obtain a copy of the License at -" -" http://www.apache.org/licenses/LICENSE-2.0 -" -" Unless required by applicable law or agreed to in writing, software -" distributed under the License is distributed on an "AS IS" BASIS, -" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -" See the License for the specific language governing permissions and -" limitations under the License. -" -" }}} - -" Deps {{{ - -Plugin 'Shougo/vimproc.vim' -Plugin 'Shougo/neomru.vim' -Plugin 'Shougo/unite.vim' -Plugin 'Shougo/vimfiler.vim' -Plugin 'Shougo/unite-outline' -Plugin 'Shougo/context_filetype.vim' -Plugin 'MarcWeber/vim-addon-mw-utils' -Plugin 'tomtom/tlib_vim' -if executable('ack') - Plugin 'mileszs/ack.vim' -endif - -" }}}