In Vim if I hit SHIFT * over fooBar, or type
/fooBar
all instances of 'fooBar' in the file will be highlighted and I can navigate through them using the N key.
How do I get this highlighting in Sublime Text 2 with Vintage enabled and VintageEx plugin installed (not Insert mode using ALT F3)?
In SublimeText 2, using / to start and type your search, hold down command and hit g to cycle through the highlighted results. Hit enter to go into visual mode on the result you selected.
I am also a heavy vimer who want try press N to jump to next searching word,as well as I am looking for one plugin which should done as your expect in the past,but I have changed my habit with use shift+enter or minimap to scroll instead of press N to jump, It works effective for me now.
NOTICE:
Don't press ENTER when finished press /foo with Vintage plugin on,this well stop draw outline.
The Vintageous package highlights all / instances by default.
Related
I have a new installation of Visual Studio Code (default configuration, with vim keymap). I want to use the command "add selection to find next match". I think this is equivalent to how multicursors work in sublime text and vim (with an extension), or Atom (find and replace: select next).
When I try to run the command directly by using Ctrl D it does not work, taking me to the last line in the file. This might be some kind of conflict that might be easy to solve.
More interestingly, when I run the command from the command palette Ctrl Shift P.
The first time selects the word I am at (well done!)
The second time selects the next occurrence of that word, but loses the selection, moving the two cursors right after the two first occurrences of the word.
The third time and next times nothing happens, the selection was lost in the previous time.
How to get the awesome normal behaviour that other editors have?
PD: I have now confirmed that this behavior is not present without the vim keymap, may they be compatible somehow?
Ctl + D is a default Vim keybind that scrolls the window down in the buffer. This is expected behavior for the Vim extension, and you should disable the mapping if you wish to use it to run the VSCode command "Add Selection To Find Next Match".
To do this, open the extension's setting by clicking File > Preferences > Extensions. From there, choose the Vim extension and select the option to Configure Extension Settings. There will be an option called Handle Keys, where you can enter JSON data to send certain key combos back to VSCode (and there's another option to turn off all Ctl + Letter combos, called Use Ctrl Keys). You can find some examples of such data on the extension's Marketplace page. Below is the snippet of code that I added to my settings.json file to get Ctl + D back.
"vim.handleKeys": {
"<C-d>": false
}
From my testing, it looks like changing this setting also fixes the behavior when using the Command Palette. It might be a bug, but who cares when you are most likely just going to use Ctl + D anyway. :)
This is currently how I copy code from an editor to a search field in VS code using vscodevim.
Select text in editor somehow
Right click to open up the contextual menu (since pressing Ctrl+C does not seem to work on Ubuntu, even when in input mode, and 'p' does not work in the search field) and click copy
Press Ctrl+Shift+F to open the search field
Press Ctrl+V
I'm pretty sure this is not how copying from an editor to search field is intended to work. It it the steps 1 and 2 I would like to change to something better.
What is a more efficient and vim-like sequence?
If you want to search for the word under the cursor
Ctrl-F will do the trick.
Or you can use Vim's * command, which effectively does the same, but jumps to the next occurrence right away by default.
Otherwise
If you need to use the search field for whatever reason, then the standard Vim way to copy stuff to the clipboard works, so you can yank into the * or + registers. The steps will then be:
Select text
"+y (you can create a shortcut for this combination if you want)
Ctrl-Shift-F, Ctrl-V
See also: How to make vim paste from (and copy to) system's clipboard?.
Having said that, the more obvious approach might be to use Vim's built-in search features, so after selecting the text, the remaining steps would be y: (yanking selection to the default register and opening the command-line) then / or ? (search forward or backward), then <C-v> (pasting the yanked selection to the command-line - this works only in the VSCode plugin, while in Vim you should use <C-r>").
I'm new to VIM so there might be a better way using VIM commands but for now this works pretty well.
Go into insert mode with i than select the word you would like to search for (I'm using the mouse) and than just press ctrl + f. Your search window will open as usual containing the selected word in it.
I got "additional" functionality either from vim or some plugin. Recently I updated vim to 8.0.216 and updated all my plugins. The "additional" functionality I get is when I search for string in a file with / and paste, for example "term", the resulted pasted text become <PasteStart>term<PasteEnd>.
How can I disable this annoying functionality?
I tried to disable all my plugins and removed .vimrc completely, but the wrapping is still there. Is this something new build to vim?
Edit:
I use iTerm2. Tried in buit-in terminal - its the same.
I saw somewhere this is related with tmux. Removed tmux and loaded fresh console. Same.
I am using oh-my-zsh if this could be related.
Edit2
I use shortcut commands for both copy and paste.
I have found three possible workarounds:
1, Use iTerm's Paste special and uncheck the Bracketed paste mode. Unfortunately, that's 3 extra clicks.
2, Use the Bracketed paste plugin, or add the relevant commands to your .vimrc:
execute "set <f28>=\<Esc>[200~"
execute "set <f29>=\<Esc>[201~"
cmap <f28> <nop>
cmap <f29> <nop
3, Create an alternate shortcut to paste with Bracketed paste mode disable:
Go to prefs>keys
Click the +
Select the keyboard shortcut field and press ⌘⌥v
For Action, select Paste…
Select the desired options. E.g. Disable Bracketed paste mode.
Press ok
Source of alternative shorcut.
NOTE: You could simply re-bind the Command + V.
The answer is: update your Vim.
Apparently it's a bug and updating Vim (to 8.0.0237) has solved it for me.
qnamebuf plugin description says:
<S-F4> opens an explorer from the current working directory showing all files which are not in a hidden directory (one that starts with '.')
I'm not very good with Vim, but I imagine S-F4 is a capital S followed by F4. However, when I press S, I find myself in insert mode, and pressing F4 after this, just adds an F4 in the window. What should I do to make the command work? I am running gVim under Windows.
The S stands for Shift. So try pressing Shift-F4.
I have a two part question regarding mouse clicks on gvim.
1.) I would like to change my gvim double left mouse click into something similar to the windows environment (ie Notepad, Microsoft Word), wherein it: highlights the current word, and replaces it with whatever I type. This is akin to pressing 'cw' for changeword in vim.
2.) I would like my single mouse click to place a cursor upon the selected text and enter insert mode. Again like how a mouse normally behaves in Windows.
1) nmap <2-LeftMouse> ciw
You could use viw here, which will visually select the current word, but then you will still have to press c to replace it.
2) nmap <LeftMouse> <Leftmouse>i
Or replace the i with an a if you would prefer to append, rather than insert.
You can use behave mswin or so $VIMRUNTIME/mswin.vim so set up a lot of stuff so that it works more like a regular windows program.
The specific setting you are looking for are:
set select=mouse
this causes the mouse to start select mode instead of visual mode. Select mode causes the selection to be deleted and insert mode to be entered when a printable key is pressed.
As in Prince Goulash's answer
nmap <LeftMouse> <LeftMouse>i
will turn on a sort of click-to-type mode.