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
" <leader>B to toggle. The value of guibg must be hexadecimal. | |
" http://www.reddit.com/r/vim/comments/l8gua/code_block_background_color_is_there_a_way_to/ | |
nn <silent> <leader>B :cal BlockColor(8, 0x101010)<cr> | |
func! BlockColor(max, step, ...) "{{{ | |
let [max, bufnr] = [a:max, bufnr('%')] | |
" Colors | |
if !exists('g:colors_name') | let g:colors_name = 'default' | endif | |
if !exists('g:bc_highl') || ( exists('g:bc_highl') && g:bc_highl != g:colors_name ) |
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
" Timestamping {{{ | |
function! s:LastModified() | |
if &modified | |
let cursor = getpos(".") | |
sil! undoj | |
keepj exe '1,'.line("$").'s#^\(.\{,10} Last Modified « \)[^«»]\+\( »[^«»]*\)#\1'. | |
\ strftime('%a, %d %b %Y %X').'\2#e' | |
cal histdel("search", -1) | |
cal setpos(".", cursor) | |
endif |
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
" List user-defined commands that don't have a mapping assigned to them. | |
" Run ":so %". | |
func! s:UnmappedCommands() | |
let lst = s:Lst() | |
for each in range(1, len(lst) - 1) | |
let str2 = matchstr(lst[each], '[^ ]\+', 4).' ' | |
" Echo each line | |
echon each.':' | |
echoh Function |
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
" Vim plugin for showing matching html tags. | |
" Maintainer: Greg Sexton <gregsexton@gmail.com> | |
" Credits: Bram Moolenar and the 'matchparen' plugin from which this draws heavily. | |
if exists("b:did_ftplugin") | |
fini | |
en | |
let s:selfclosing = ['meta', 'link', 'img', 'input', 'area', 'base', 'br', | |
\ 'hr', 'param', 'col'] |
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
" ============================================================================= | |
" File: autoload/ctrlp/script.vim | |
" Description: Find loaded vimscripts (:scriptnames) | |
" Author: Kien Nguyen <github.com/kien> | |
" ============================================================================= | |
" Init {{{1 | |
if exists('g:loaded_ctrlp_script') && g:loaded_ctrlp_script | |
fini | |
en |
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
" Repeatable <c-w> and family | |
nn <silent> <c-w> <esc>:cal wincmd#init()<cr> | |
nn <silent> _. <esc>:cal wincmd#repeat('act')<cr> | |
nn <silent> _; <esc>:cal wincmd#repeat('cur')<cr> |
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
" ============================================================================= | |
" File: autoload/ctrlp/oldfiles.vim | |
" Description: Find files saved in viminfo: jumplist, changelist, marks ... | |
" Author: Kien Nguyen <github.com/kien> | |
" ============================================================================= | |
" User Configuration {{{1 | |
" Enable: | |
" let g:ctrlp_extensions += ['oldfiles'] | |
" Create A Command: |
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
" Repeatable g, z, [ and ] mappings | |
nn <silent> g :<c-u>cal keycmd#init('g', v:register)<cr> | |
nn <silent> z :<c-u>cal keycmd#init('z', v:register)<cr> | |
nn <silent> [ :<c-u>cal keycmd#init('[', v:register)<cr> | |
nn <silent> ] :<c-u>cal keycmd#init(']', v:register)<cr> | |
nn <silent> _g :cal keycmd#repeat('g')<cr> | |
nn <silent> _z :cal keycmd#repeat('z')<cr> | |
nn <silent> _[ :cal keycmd#repeat('[')<cr> | |
nn <silent> _] :cal keycmd#repeat(']')<cr> |
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
" File: after/plugin/ctrlp.vim | |
" Description: Custom statusline example | |
" Make sure ctrlp is installed and loaded | |
if !exists('g:loaded_ctrlp') || ( exists('g:loaded_ctrlp') && !g:loaded_ctrlp ) | |
fini | |
en | |
" ctrlp only looks for this |
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
" Set the working directory to the project's root, or to the parent directory | |
" of the current file if a root can't be found. | |
func! s:etwd() | |
let cph = expand('%:p:h', 1) | |
if match(cph, '\v^<.+>://') >= 0 | retu | en | |
for mkr in ['.git/', '.hg/', '.vimprojects'] | |
let wd = call('find'.(mkr =~ '/$' ? 'dir' : 'file'), [mkr, cph.';']) | |
if wd != '' | let &acd = 0 | brea | en | |
endfo |
OlderNewer