diff options
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/fall.vim | 38 | ||||
-rw-r--r-- | autoload/hints/plugins.vim | 19 | ||||
-rw-r--r-- | autoload/subwords.vim | 5 |
3 files changed, 52 insertions, 10 deletions
diff --git a/autoload/fall.vim b/autoload/fall.vim index 493ded3..feccc1a 100644 --- a/autoload/fall.vim +++ b/autoload/fall.vim @@ -77,4 +77,40 @@ function! fall#fall(dir, pattern) abort endwhile return "m'" . n . a:dir -endfunction! +endfunction + +function! fall#visual_same_character(dir) + let start_line = line(".") + let line = start_line + let column = col(".") + let char_to_match = matchstr(getline(line), '\%' . column . 'c.') + + let expr = "" + + if a:dir =~ 'k' + while line > 1 + let line -= 1 + if matchstr(getline(line), '\%' . column . 'c.') != char_to_match + break + endif + let expr .= 'k' + endwhile + endif + + if a:dir == 'jk' + let expr .= 'o' + let line = start_line + endif + + if a:dir =~ 'j' + while line <= line("$") + let line += 1 + if matchstr(getline(line), '\%' . column . 'c.') != char_to_match + break + endif + let expr .= 'j' + endwhile + endif + + return expr +endfunction diff --git a/autoload/hints/plugins.vim b/autoload/hints/plugins.vim index e3e5a9d..db08535 100644 --- a/autoload/hints/plugins.vim +++ b/autoload/hints/plugins.vim @@ -16,16 +16,17 @@ endfunction let s:WHITESPACE_OR_COMMENT='\(^\s*$\)\|\(^\s*//\)\|\(^\s*\*/\)' function! s:java_plugin.TagLine(linenr, line) dict - if self.last_line =~ s:WHITESPACE_OR_COMMENT - \ && !(a:line =~ s:WHITESPACE_OR_COMMENT) - let self.last_line = a:line - return v:true - endif - let self.last_line = a:line + return v:true + # if self.last_line =~ s:WHITESPACE_OR_COMMENT + # \ && !(a:line =~ s:WHITESPACE_OR_COMMENT) + # let self.last_line = a:line + # return v:true + # endif + # let self.last_line = a:line - return - \ a:line =~ '^\s*}$' || - \ a:line =~ '\<\(public\|private\|protected\|class\|static\|try\|while\|for\|if\|else\|catch\)\>' + # return + # \ a:line =~ '^\s*}$' || + # \ a:line =~ '\<\(public\|private\|protected\|class\|static\|try\|while\|for\|if\|else\|catch\)\>' endfunction function! hints#plugins#registerFt(filetype, plugin) abort diff --git a/autoload/subwords.vim b/autoload/subwords.vim index eef8f8b..2c5c0bc 100644 --- a/autoload/subwords.vim +++ b/autoload/subwords.vim @@ -49,6 +49,11 @@ function! subwords#next(vis, forward) let s:subword_nosave = 0 endfunction +" Zero-match the next subword baundary for repeatable cin- and cin_ commands. +function! subwords#visual_beginning(prefer_camel, around) + return subwords#visual(a:prefer_camel, a:around) . "oi v" +endfunction + " Visually highlights a subword. " " If a:prefer_camel is set, then WordsLike_This will be interpreted with |