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
0410dc929cd88232a75fe0cd33a0bbf1cf050cc6aa93912393251a997df4ead4b1f0e71a14586594dbdb242f74b4acec05e1e76957ac7f75ae7b323e30b6c8499e;nortss |
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
" Unique Bufname {{{ | |
fu! s:update_buflist(bufnr) | |
let bufname = bufname(str2nr(a:bufnr)) | |
if bufname == '' | |
retu | |
en | |
let slash = exists('+ssl') && !&ssl ? '\' : '/' | |
" Check if the new buffer has a duplicate | |
let bufname = fnamemodify(bufname, ':t') | |
if exists('s:buflist_short') && exists('s:buflist') && !count(s:buflist_short, bufname) |
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
if exists('loaded_ctrlpasync') || &cp || version < 700 | |
fini | |
en | |
let loaded_ctrlpasync = 1 | |
let s:locked = 0 | |
fu! s:async(path) | |
if !has('clientserver') || s:locked | retu | en | |
let svid = get(filter(split(serverlist(), "\n"), 'v:val !=? v:servername'), 0, '') |
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
" Sharing the buffer list between Vim instances | |
" Usage: | |
" Run :BufSyncServer in the main Vim instance | |
" Run :BufSyncClient in the client instance(s) | |
" Option: | |
let s:buflist = 'path/to/cachefile' | |
" Commands: |
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
" require Vim 7.1.299+ | |
fu! s:localrc(...) | |
let path = a:0 ? expand('%:p:h', 1) : getcwd() | |
if path =~ '^.\+://' | |
retu | |
en | |
let rc = findfile('.lvimrc', path.';') | |
if rc != '' && filereadable(rc) | |
exe 'so' fnameescape(rc) |
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
fu! s:savecwd() | |
if !exists('g:CWDS') | |
let g:CWDS = [] | |
en | |
let cwd = getcwd() | |
let idx = index(g:CWDS, cwd) | |
if idx >= 0 | |
cal remove(g:CWDS, idx) |
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/vcsdir.vim | |
" Description: VCS directory extension | |
" Author: Kien Nguyen <github.com/kien> | |
" ============================================================================= | |
" User Configuration {{{1 | |
" Enable: | |
" let g:ctrlp_extensions = ['vcsdir'] | |
" 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
func! s:indentobj(i, ...) | |
let ls = { 0: 1, 1: line('.'), 2: line('$') } | |
if getline(ls[1]) =~ '^\s*$' | retu | en | |
let idt = max([indent(ls[1]) - &sw * ( v:count1 - 1 ), 0]) | |
for [idx, rs] in items({ 0: range(ls[1], 1, -1), 2: range(ls[1], ls[2]) }) | |
for line in rs | if getline(line) !~ '^\s*$' && indent(line) < idt | |
cal extend(ls, { idx : line }) | brea | |
en | endfo | |
endfo | |
exe 'keepj norm! '.( ls[0] + a:i ).'GV'.( ls[2] - ( a:i || a:0 ) ).'G' |
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 |
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 |
NewerOlder