This file contains hidden or 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
| let s:undo_stack = [] | |
| command! -nargs=1 With call s:With(<f-args>) | |
| function! s:With(expression) | |
| if a:expression[0] == '*' | |
| return s:WithFunction(a:expression) | |
| else | |
| return s:WithVariable(a:expression) | |
| endif | |
| endfunction |
This file contains hidden or 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
| " Using the `,p` mapping would paste text below the current line, using the line's indentation. | |
| " The `,P` mapping does the same, except pasting above the current line. | |
| " | |
| " This could be useful for indent-based languages. For example: | |
| " | |
| " foo = (bar) -> | |
| " console.log bar | |
| " | |
| " baz = (qux) -> | |
| " console.log qux |
This file contains hidden or 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 _w :Wincmd<cr> | |
| nnoremap _. :WincmdRepeat<cr> | |
| command! Wincmd call s:Wincmd('') | |
| function! s:Wincmd(cmd_count) | |
| let cmd_count = a:cmd_count | |
| " echo the command so far for some visual feedback | |
| redraw | echo cmd_count.'wincmd' |
This file contains hidden or 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
| if exists("g:loaded_nerdtree_custom_maps") | |
| finish | |
| endif | |
| let g:loaded_nerdtree_custom_maps = 1 | |
| "adds a keymapping on 'o' that overrides the standard nerdtree 'o' mapping and | |
| "to open the file node and close the tree | |
| call NERDTreeAddKeyMap({ | |
| \ 'key': 'o', |
This file contains hidden or 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
| function! inline_edit#VimEmbeddedScript() | |
| let start_pattern = '^\s*\(\%(rub\|py\|pe\|mz\|lua\)\S*\)\s*<<\s*\(.*\)$' | |
| " If we don't find the start by going backwards, bail out. | |
| if search(start_pattern, 'Wb') <= 0 | |
| return [] | |
| endif | |
| " The start of the code will be the line after the one we just found | |
| let start = line('.') + 1 |
This file contains hidden or 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! -nargs=1 -complete=custom,s:TabjCompletion Tabj call s:Tabj(<f-args>) | |
| function! s:Tabj(name) | |
| for i in range(tabpagenr('$')) | |
| let tabnr = i + 1 | |
| for bufnr in tabpagebuflist(tabnr) | |
| if stridx(bufname(bufnr), a:name) >= 0 | |
| exe 'tabnext '.tabnr | |
| while bufnr('%') != bufnr |
This file contains hidden or 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
| " Place in ftplugin/qf.vim | |
| xnoremap <buffer> d :DeleteLines<cr> | |
| nnoremap <buffer> dd :DeleteLines<cr> | |
| nnoremap <buffer> u :UndoDelete<cr> | |
| if !exists(':DeleteLines') | |
| let b:deletion_stack = [] | |
| " Delete by a pattern (with undo placing them all on top): |