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
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 / 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,
@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 / 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 */
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index f71c4ad..6b1b067 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -7374,7 +7374,8 @@ A jump table for the options with a short description can be found at |Q_op|.
By default, tag searches are case-sensitive. Case is ignored when
'ignorecase' is set and 'tagcase' is "followic", or when 'tagcase' is
- "ignore".
+ "ignore" or when 'tagcase' is "followscs" and 'smartcase' is set and
:version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Oct 17 2016 20:39:57)
Included patches: 1-41
Compiled by chrisbra@debian
Huge version without GUI. Features included (+) or not (-):
+acl +cmdline_compl +digraphs +folding +langmap -mouseshape -mzscheme +python3/dyn +syntax -toolbar +writebackup
+arabic +cmdline_hist -dnd -footer +libcall +mouse_dec +netbeans_intg +quickfix +tag_binary +user_commands +X11
+autocmd +cmdline_info -ebcdic +fork() +linebreak +mouse_gpm +num64 +reltime +tag_old_static +vertsplit +xfontset
-balloon_eval +comments +emacs_tags +gettext +lispindent -mouse_jsbterm +packages +rightleft -tag_any_white +virtualedit -xim
-browse +conceal +eval -hangul_input +listcmds +mouse_netterm +path_extra -rub
func! SearchHighlight(timer) abort
if !v:hlsearch || mode() isnot 'n'
return
else
let cmd="\<c-\>\<c-n>:let v:hlsearch=0\<cr>\<c-l>"
sil call feedkeys(cmd, 'n')
endif
endfu
func! s:TimerHighlight() abort
" First, let's define an empty dictionary and assign it to the "palette"
" variable. The # is a separator that maps with the directory structure. If
" you get this wrong, Vim will complain loudly.
let g:airline#themes#dark_minimal#palette = {}
" First let's define some arrays. The s: is just a VimL thing for scoping the
" variables to the current script. Without this, these variables would be
" declared globally. Now let's declare some colors for normal mode and add it
" to the dictionary. The array is in the format:
" [ guifg, guibg, ctermfg, ctermbg, opts ]. See "help attr-list" for valid
@chrisbra
chrisbra / evalfunc.patch
Created April 20, 2017 16:20
Vim issue #1590
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 83bc8f379..884f4501c 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -7092,9 +7092,9 @@ shellescape({string} [, {special}]) *shellescape()*
{special}) when 'shell' contains "csh" in the tail. That is
because for csh and tcsh "!" is used for history replacement
even when inside single quotes.
- The <NL> character is also escaped. With a |non-zero-arg|
- {special} and 'shell' containing "csh" in the tail it's
From 24b4a451e95c58479ff84d2e169673db963cfebf Mon Sep 17 00:00:00 2001
From: Christian Brabandt <cb@256bit.org>
Date: Fri, 23 Jun 2017 11:09:43 +0200
Subject: [PATCH] Fix issue #1788
hitting ctrl-n in insert mode when the cursor is at the first position,
the order of completion items won't be that one as expected (e.g. the
order of words should be in the order of appearance in the buffer).
Internally, Vim decrements the cursor position by 1 byte so that the