Show the full output of command :hi in a scratch buffer:
:Redir hi
Show the full output of command :!ls -al in a scratch buffer:
I’ll assume you are on Linux or Mac OSX. For Windows, replace ~/.vim/ with $HOME\vimfiles\ and forward slashes with backward slashes.
Vim plugins can be single scripts or collections of specialized scripts that you are supposed to put in “standard” locations under your ~/.vim/ directory. Syntax scripts go into ~/.vim/syntax/, plugin scripts go into ~/.vim/plugin, documentation goes into ~/.vim/doc/ and so on. That design can lead to a messy config where it quickly becomes hard to manage your plugins.
This is not the place to explain the technicalities behind Pathogen but the basic concept is quite straightforward: each plugin lives in its own directory under ~/.vim/bundle/, where each directory simulates the standard structure of your ~/.vim/ directory.
This is a list of custom pseudo-text objects for Vim.
Note the use of "pseudo", here. Conceptually, text object are "special" motions but there is no proper mechanism dedicated to creating text objects, specifically. We are left with the generic mechanism succinctly described under the easy-to-miss :help omap-info.
Writing one's own pseudo-text objects and motions is a great way to extend Vim without perverting its nature ;-).
FOREWORDS
I don't mean the snippet at the bottom of this gist to be a generic plug-n-play solution to your search needs. It is very likely to not work for you or even break things, and it certainly is not as extensively tested and genericised as your regular third-party plugin.
My goal, here and in most of my posts, is to show how Vim's features can be leveraged to build your own high-level, low-maintenance, workflows without systematically jumping on the plugins bandwagon or twisting Vim's arm.
| function! Substitute(type, ...) | |
| let cur = getpos("''") | |
| call cursor(cur[1], cur[2]) | |
| let cword = expand('<cword>') | |
| execute "'[,']s/" . cword . "/" . input(cword . '/') | |
| call cursor(cur[1], cur[2]) | |
| endfunction | |
| nmap <silent> <key> m':set opfunc=Substitute<CR>g@ | |
| " Usage: |
You may want a linter plugin to lint your code in Vim but you probably don't need it. At least try the built-in way before jumping on the plugin bandwagon.
autocmd FileType <filetype> setlocal makeprg=<external command>
This autocommand tells Vim to use <external command> when invoking :make % in a <filetype> buffer. You can add as many similar lines as needed for other languages.