Surround has a philosophy of being very « vim-like »—it uses operators to work on objects, much like many of vim’s most powerful normal mode constructs. I would argue that it is not what some expect because they expect an auto-pairs-like experience that they are used to from other editors, or because they are still learning about normal-mode and the many ...
You can use a user defined complete function to implement this kind of custom completion.
See :help complete-function for how to write such a function.
For example, the function below will use the beginning of the current line as the pattern to search, and will try to match it as a substring, on all the other lines in the same buffer:
Plug-in wellle/targets.vim implements this feature, through an in' text-object (n for "next".) You can use it with a count, so you can use c3in' or 3cin' to change inside the third next single quoted string from the cursor.
See the README section for the next and last pair (and also the linked cheat sheet.)
This kind of mapping is made possible ...
I'm afraid it is not possible (but we can make a nice mapping, skip to the end for that). See :h object-select for reference. Unlike other
commands, such as i(, iW, etc., i' does not have an optional [count].
"a quoted string". Selects the text from the previous
quote until the next quote.
Like a", a' and ...
I would do that with mouse clicks. First highlight the word (this could be done with a double-click of the mouse) and then move the mouse to where you want to insert and press middle button of the mouse.
With a help of vimscript you might have following:
" get previous line number
let prevline = line('.')-1
" get the line from current position to the end
let rest_of_line = strcharpart(getline(prevline), virtcol('.')-1)
" if cursor was on a space, return 1 <C-y>
if rest_of_line == ' '
As already mentioned, remapping of CAPSLOCK to ESC and CTRL requires additional SW. For me, this is not an issue and I'm enjoying this mapping a lot! This is how I did it:
Remap CAPSLOCK to ESC and CTRL on Windows
If you want to remap CAPSLOCK to both
to ESC (when pressed alone)
to CTRL (when pressed with other keys)
you can use this little piece of open ...