Skip to main content

Home/ VIM Editor/ Group items tagged wiki

Rss Feed Group items tagged

reckoner reckoner

Search and replace in a visual selection - Vim Tips Wiki - a Wikia wiki - 0 views

  • In visual mode, / and ? will update the visual selection just like any other cursor-movement command. In order to actually search within the visual selection, you will need to use the \%V atom, or use the markers defined by the visual selection with \%>'< and \%<'> atoms. This is best done by leaving the visual selection with <esc> before entering your search. You may want to consider a mapping to automatically leave visual selection and enter the appropriate atom(s). For example:
reckoner reckoner

Tip #63 - Applying substitutes to a visual block : vim online - 0 views

  • Applying substitutes to a visual block  tip karma   Rating 155/45, Viewed by 8082  Read and edit this tip on the Vim tip wiki. The wiki may have a more recent version of this tip. created:   March 28, 2001 8:26      complexity:   intermediate author:   Chip Campbell      as of Vim:   5.7 If you'd like to apply a substitute, or even any ex command, to a visual-block selected text region (ctrl-v and move), then you'll want Stefan Roemer's http://www.erols.com/astronaut/vim/vimscript/vis.vim .  Just source it in, and then press ":B".  On the command line you'll see :'<,'>BCtrl-V Just continue with the substitute or whatever... :'<,'>B s/abc/ABC/g and the substitute will be applied to just that block of text
reckoner reckoner

Search for visually selected text - Vim Tips Wiki - a Wikia wiki - 0 views

  • With the following, you can use g/ (or g?) to search forwards (or backwards) for the currently selected text.
reckoner reckoner

Preexisting code indentation - Vim Tips Wiki - a Wikia wiki - 0 views

  • lternative: if your file has indent 4 and you want an indent of 3 and gg=G is not working as expected, try :set inde=indent(v:lnum)/4*3 then go ahead with the well known gg=G use tabs or spaces, doesn't matter
reckoner reckoner

To switch back to normal mode automatically after inaction - Vim Tips Wiki - a Wikia wiki - 0 views

  • " set 'updatetime' to 15 seconds when in insert mode au InsertEnter * let updaterestore=&updatetime | set updatetime=15000 au InsertLeave * let &updatetime=updaterestore
reckoner reckoner

what are safe key combinations to remap in vim - vim_use | Google Groups - 0 views

  • You can refer to the "Finding unused keys" section in the "Mapping keys in Vim" tutorial available at: http://vim.wikia.com/wiki/Mapping_keys_in_Vim_-_Tutorial_%28Part_2%29
  • eta keys are almost always safe (<M-A>, <M-B>, etc.). Check for mappings from plugins, etc. before using. When in doubt, use the help. For example, to see if CTRL-J is taken (it is, but there are several commands to do the same thing) type :help CTRL-J and then press CTRL-D instead of ENTER to list all results. Then view each result to see what they do and if there are any alternate ways to do the same thing before mapping. If the mapping is for one mode only, you can prepend the mode. For example, for CTRL-J in insert mode, :help i_CTRL-J
  • Oh, and you can also use the map leader (see :help <Leader>), which defaults to the backslash key. For example, nmap <leader>h :echo "hello world!"<CR>
1 - 15 of 15
Showing 20 items per page