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
nnoremap <silent> q: :call <SID>Open(':')<cr> | |
function! s:Open(type) abort | |
botright 7new | |
let b:type = a:type | |
call s:Redraw(a:type) | |
normal! 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
" Install by saving as plugin/placeholder_jump.vim in your config files. | |
" | |
" Search for <+text+>, <+other text+>, <++> etc, and enter select mode on top | |
" of the placeholders. | |
let s:placeholder_pattern = '<+.\{-}+>' | |
function! s:Next() abort | |
if search(s:placeholder_pattern) | |
exe "normal! va<o\<c-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
command! Cmarks call s:Cmarks() | |
function! s:Cmarks() abort | |
let items = [] | |
" Global marks: | |
let marklist = getmarklist() | |
" Local marks: | |
let marklist += getmarklist(bufnr()) | |
for mark in marklist |
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
" Install by saving as plugin/match_visual.vim in your Vim (or Neovim) config | |
" directory. | |
" | |
" Reimplementation of https://github.com/aaron-p1/match-visual.nvim | |
" | |
" Requires the function `getregion`, you have it if this expression prints 1: | |
" | |
" echo exists('*getregion') | |
" | |
if !exists('*getregion') |
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
" Save in ~/.vim/ftplugin/markdown_open_link.vim | |
nnoremap <buffer> gx :call <SID>OpenLink()<cr> | |
function! s:OpenLink() | |
let saved_view = winsaveview() | |
defer winrestview(saved_view) | |
let syntax_under_cursor = synIDattr(synID(line("."), col("."), 0), "name") | |
let url = '' |
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
" Save as ~/.vim/plugin/pophelp.vim | |
let s:popup = 0 | |
command! -range=0 -nargs=* -complete=help | |
\ Pophelp call s:Open(<q-args>, <count>) | |
command! Popclose call s:Close() | |
function! s:Open(topic, count) abort | |
if a:topic == '' |
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
" Save as ~/.vim/ftplugin/netrw_icons.vim | |
if exists('b:netrw_icons_loaded') | |
finish | |
endif | |
let b:netrw_icons_loaded = 1 | |
autocmd TextChanged <buffer> call s:NetrwAddIcons() | |
if empty(prop_type_get('netrw_file_icon', {'bufnr': bufnr('%')})) |
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
" Reimplementation of https://github.com/tonymajestro/smart-scrolloff.nvim | |
" Place in `~/.vim/plugin/` | |
" | |
" Note that the value is based on `&lines`, which is the global number of | |
" lines available to Vim. If you'd like to scale scrolloff based on window | |
" size, you could use `line('w$') - line('w0')`. In that case, you'd update | |
" `&l:scrolloff`, the window-local option. | |
" | |
" See `:help 'scrolloff'`, `:help 'lines'`, and `:help getpos()` for more | |
" details. |
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
times in msec | |
clock self+sourced self: sourced script | |
clock elapsed: other lines | |
000.013 000.013: --- VIM STARTING --- | |
000.147 000.134: Allocated generic buffers | |
000.259 000.112: locale set | |
000.270 000.011: GUI prepared | |
000.276 000.006: clipboard setup | |
000.280 000.004: window checked |
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
" As an example, put it in the statusline (you should not do this here, just put the %{} in your config): | |
let &statusline = substitute(&statusline, '%f', '%f%{get(b:,"ignore_status","")}', '') | |
" | |
" get(b:, "ignore_status", "") -> Get the key "ignore_status" from the | |
" dictionary b: (all buffer-local variables), defaulting to "" | |
" | |
augroup IgnoreStatus | |
autocmd! |
NewerOlder