Skip to content

Instantly share code, notes, and snippets.

View chrisbra's full-sized avatar
:octocat:
Most likely working

Christian Brabandt chrisbra

:octocat:
Most likely working
View GitHub Profile
@chrisbra
chrisbra / gist:ff7162fbcec28cd795f6
Last active August 29, 2015 14:22
vim-airline crypt
diff --git a/autoload/airline.vim b/autoload/airline.vim
index ef74298..0b66c7d 100644
--- a/autoload/airline.vim
+++ b/autoload/airline.vim
@@ -161,7 +161,7 @@ function! airline#check_mode(winnr)
call add(l:mode, 'paste')
endif
- if g:airline_detect_crypt && !empty(&key)
+ if g:airline_detect_crypt && exists("+key") && !empty(&key)
@chrisbra
chrisbra / gist:0ba9df9011ddc38e7181
Created February 13, 2015 17:42
commentary-issue40
diff --git a/plugin/commentary.vim b/plugin/commentary.vim
index a91cd71..073e614 100644
--- a/plugin/commentary.vim
+++ b/plugin/commentary.vim
@@ -12,6 +12,16 @@ function! s:surroundings() abort
return split(get(b:, 'commentary_format', substitute(substitute(
\ &commentstring, '\S\zs%s',' %s','') ,'%s\ze\S', '%s ', '')), '%s', 1)
endfunction
+function! s:StripWhiteSpace(l,r,line)
+ " Strip whitespace from the comment,
diff --git a/plugin/commentary.vim b/plugin/commentary.vim
index a91cd71..e364a5f 100644
--- a/plugin/commentary.vim
+++ b/plugin/commentary.vim
@@ -24,6 +24,10 @@ function! s:go(type,...) abort
let uncomment = 2
for lnum in range(lnum1,lnum2)
let line = matchstr(getline(lnum),'\S.*\s\@<!')
+ if stridx(line,l) == -1 && stridx(line,l[0:-2])==0 && line[strlen(line)-strlen(r[1:]):-1]==r[1:]
+ let l = l[0:-2]
@chrisbra
chrisbra / write_conversion.diff
Created May 15, 2012 18:34
Fix conversion error
diff --git a/src/fileio.c b/src/fileio.c
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -113,6 +113,7 @@
int bw_fd; /* file descriptor */
char_u *bw_buf; /* buffer with data to be written */
int bw_len; /* length of data */
+ int do_write; /* really write */
#ifdef HAS_BW_FLAGS
int bw_flags; /* FIO_ flags */