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 y = 0 | |
| let c = 0 | |
| for x in ['== 1', '>1', '<1'] | |
| if eval(y . x) | |
| echo c | |
| break | |
| endif | |
| let c += 1 | |
| endfor |
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! WaitForKeyMap(start) | |
| let c = nr2char(getchar()) | |
| if maparg(a:start . c, 'i') != '' | |
| echo "soup!" | |
| call feedkeys(a:start . c) | |
| return '' | |
| else | |
| return c | |
| 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
| Large Object Motions: | |
| ( | |
| ) | |
| { | |
| } | |
| [[ | |
| [] | |
| ][ | |
| ]] | |
| [m |
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
| " author: godlygeek | |
| function s:movement_string(line, col) | |
| return a:line . "G0" . (a:col > 1 ? (a:col - 1) . "l" : "") | |
| endfunction | |
| function! s:VAR() | |
| let group = synID(line('.'), col('.'), 1) | |
| let orig = [ line('.'), col('.') ] |
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! RotateBuffer() | |
| let rb=[] | |
| for x in range(max(map(getline(1, '$'), 'len(v:val)'))) | |
| call add(rb, []) | |
| for y in range(line('$')) | |
| call add(rb[x], ' ') | |
| endfor | |
| endfor | |
| let y = 0 | |
| for line in getline(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
| # Copyright (c) 2010 by Barry Arthur <barry.arthur@gmail.com>: | |
| # | |
| # This program is free software; you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation; either version 3 of the License, or | |
| # (at your option) any later version. | |
| # | |
| # This program is distributed in the hope that it will be useful, | |
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
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
| " help.vim - ftplugin for better Help navigation and operation | |
| " Barry Arthur | |
| " jump to links with CR | |
| nmap <buffer> <CR> <C-]> | |
| " jump back with BS | |
| nmap <buffer> <BS> <C-T> | |
| " skip to next option link | |
| nmap <buffer> o /'[a-z]\{2,\}'<CR> | |
| " skip to previous option link |
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
| vnoremap <leader>d :call Test()<CR>gv"yp | |
| function! Test() | |
| "yank current visual selection to reg x | |
| normal! gv"xy | |
| "put new string value in reg y | |
| let @y = " IF (DEBUG.GT.0) THEN\n" . @x . "\n 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
| Possible List of Showcase Vids for Vim | |
| -------------------------------------- | |
| . text objects | |
| . search & replace (:s/// & :g//) (waz tutorial chapters 1-4 and vimranger poster) | |
| . macros (impromptu, dynamic short-term solutions) | |
| . registers (vimregrap poster) | |
| . buffers, windows, tabs & sessions (including --clientserver) | |
| . marks & jumps | |
| . :find & &path, :args & :e & :ls & :b (perhaps showcase some buffer switchers either here or in a dedicated vid) |
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
| " author: godlygeek | |
| " 22 Jun 2010 | |
| " | |
| " the objects returned are visual mode commands | |
| " in visual mode, o jumps to the other end of the match | |
| " | |
| function! s:VAC() | |
| if search('\m\%#/\*', 'bcnW') || search('\m/\%#\*', 'bcnW') | |
| " On /* | |
| return ']*o]*[*o' |