Whenever I do a sublime find, at some match I wish to add the text. But is there a shortcut to edit without moving mouse and clicking the text (to bring cursor to that location)
Example gif (issue I'm facing) - https://imgur.com/wTe3vcA
Just press Esc after finding your text.
Related
Suppose I have the following text selected in vim using ctrl-v e e:
To delete all the text I can press x (or d) and to insert new text I can do shift-I, but is there a way to replace that text directly? I want all those four items to say "video frame rate" instead of video resolution. How would I do that in the most efficient way in vim?
ctrl-v and other magic to select the block
press s or c
write the text you want
press ESC
In Sublime Text I can highlight text between specific locations by holding down shift and clicking the start of the region I want highlighted and then the end.
How do I do this with just the keyboard?
Method 1
Explore the commands in the Edit > Mark submenu.
Move your cursor to the start of the desired selection and run Set Mark (Ctrl+K, Ctrl+space).
Then move your cursor to the end of the desired selection and run Select to Mark (Ctrl+K, Ctrl+A).
Method 2
Or, as noted in the comments, hold down Shift as you move across the desired selection (using arrows, etc.).
Try the key command Ctrl+Shift+End on Windows when you are at the beginning or in the middle somewhere of a document. This works with any program.
I am right now analyzing some code using VI editor. In my use case, I have selected code spanning 2 Pages by using ESC SHIFT v & selecting all the lines (Spanning 2 Pages). Now the issue I have is I am not able to hold the highlight until I need. As soon as I press ESC and move the cursor the highlight goes off.
How do I hold the highlight until my need
If you just want to reselect whatever you previously selected when you leave visual mode you can use gv. You can't keep highlight when leaving a visual mode, though.
Edit:
If you just need to view selected text and you don't want to be distracted by surrounding text, you can simply copy it to an empty buffer. To do so select your text in visual mode, press y then :new then P. When you finish you can close newly created buffer with :bd!.
I am implemented sample IME in this service using Notepad and I want to insert text at the cursor's position in the text. How can I get the cursor's position in windows 8?
ItfInsertAtSelection::InsertTextAtSelection inserts text at the selection. Since Notepad isn't TSF-aware, that's the only place you can insert text.
I am playing with my vimrc settings, and enabled the mouse support.
set mouse=a
Now, I miss the copy and paste option with mouse. Normally, if the mouse is not enabled, I could copy text with left click + drag, and paste by right click (in Insert mode). So,
How to get the copy, paste with mouse enabled (with mouse click, not Ctrl+v etc). The only option I need with mouse enabled is to click anywhere in the file and the cursor points to that location. This helps faster navigation.
I use putty (x-term) to connect to my debian server.
Easiest solution is just to hold shift down when you select text, to get the old behavior for mouse-copy. Paste with shift-mouseclick will usually work too.
jkerian's solution is generally what I do, but if you ever find yourself wanting to copy and paste a lot, and getting tired of holding down shift, you can do something like this:
" toggle between terminal and vim mouse
map <silent><F12> :let &mouse=(&mouse == "a"?"":"a")<CR>:call ShowMouseMode()<CR>
imap <silent><F12> :let &mouse=(&mouse == "a"?"":"a")<CR>:call ShowMouseMode()<CR>
function ShowMouseMode()
if (&mouse == 'a')
echo "mouse-vim"
else
echo "mouse-xterm"
endif
endfunction
On OSX in a Terminal window you need to hold down the fn key when you want to select some text with the mouse in vim that you want to copy. You can tell it's selected as it is highlighted in a different colour (for the 'Homebrew' profile it's blue) as opposed to vim's default highlight colour (e.g. green). Then you can copy the selected text as usual using ⌘+C.
And to add if you want to do this in iTerm2 you need to hold down the ⌥ (Alt/Option) and mouse to select text for copying - see the iTerm2 FAQ for more selection region options.
Hold the shift button and select the text to copy.
Then either click middle mouse button or right click to paste in console. To paste in vim, shift+insert in insert mode.