New answers tagged

1

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 ...


1

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: function! CompleteLine(...


3

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 ...


1

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" a' "a quoted string". Selects the text from the previous quote until the next quote. i" i' Like a", a' and ...


0

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.


1

With a help of vimscript you might have following: func! InsertWord() " 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[0] == ' ' ...


0

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 ...


Top 50 recent answers are included