-
Notifications
You must be signed in to change notification settings - Fork 105
Implement useful mappings, operators and text-objects #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
@uryupinsk 👍 |
Closed
Here are some suggestions: Section Jumping:" section jumping
nnoremap <buffer><silent> ]] :<c-u>call <SID>TexJump2Section( v:count1, '' , 0)<CR>
nnoremap <buffer><silent> [[ :<c-u>call <SID>TexJump2Section( v:count1, 'b', 0)<CR>
xnoremap <buffer><silent> ]] :<c-u>call <SID>TexJump2Section( v:count1, '' , 1)<CR>
xnoremap <buffer><silent> [[ :<c-u>call <SID>TexJump2Section( v:count1, 'b', 1)<CR>
onoremap <buffer><silent> ]] :<c-u>normal ]]<CR>
onoremap <buffer><silent> [[ :<c-u>normal [[<CR>
function! s:TexJump2Section( cnt, dir, vis )
if a:vis
normal! gv
endif
let i = 0
let pattern = '\v^#{1,6}.*$|^.+\n%(\-+|\=+)$'
let flags = 'W' . a:dir
while i < a:cnt && search( pattern, flags ) > 0
let i = i+1
endwhile
endfunction LaTeX environments:" From https://github.com/gibiansky/vim-latex-objects/blob/da66a67199c7c55f582b8720e4b06819c78f6478/plugin/vim-latex-objects.vim
function! <sid>NextEnd()
let curline = line(".") + 1
let begins = 1
while begins > 0
if getline(curline) =~ '.*\\begin.*$'
let begins += 1
endif
if getline(curline) =~ '.*\\end.*$'
let begins -= 1
endif
let curline += 1
endwhile
return curline - 1
endfunction
function! <sid>PrevBegin()
let curline = line(".")
let ends = 1
while ends > 0
if getline(curline) =~ '.*\\begin.*$'
let ends -= 1
endif
if getline(curline) =~ '.*\\end.*$'
let ends += 1
endif
let curline -= 1
endwhile
return curline + 1
endfunction
function! <sid>SelectInEnvironment(surround)
let start = <sid>PrevBegin()
let end = <sid>NextEnd()
call cursor(start, 0)
if !a:surround
normal! j
end
normal! V
call cursor(end, 0)
if !a:surround
normal! k
end
endfunction
" Operate on environments (that have begin and ends on separate lines)
xnoremap <buffer><silent> ie <ESC>:call <sid>SelectInEnvironment(0)<CR>
xnoremap <buffer><silent> ae <ESC>:call <sid>SelectInEnvironment(1)<CR>
nnoremap <buffer> <SID>(V) V
onoremap <buffer> ie :execute "keepjumps normal \<SID>(V)ie"<CR>
onoremap <buffer> ae :execute "keepjumps normal \<SID>(V)ae"<CR> |
Could the bib reference list show in a separate window, such as NERDTree or Tagbar? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'll keep this issue open for stuff I think should be implemented. Suggestions are most welcome.
Text objects
With these, we could, for example, change stuff with natural vim idioms (
cipp
for changing inside a pandoc paragraph,dipli
for deleting a list item, etc.)Text style operators
Commands
Mappings for operations like inserting a table row, creating a reference, etc.
Handle tables.(see Support for assisted table creation #95)Other
The text was updated successfully, but these errors were encountered: