Tag Info

Hot answers tagged

26

You can use another character instead of slash / as delimiter to substitution command. Example using #: :%s#/a/b/f/g/d/g#/s/g/w/d/g/r#


3

I don't think you can map CapsLock from within Vim. You remap it within X using setxkbmap: setxkbmap -option caps:swapescape For remapping in the console, if your distro uses systemd, you can use a custom keyboard layout in /etc/vconsole.conf as described on the Arch Wiki, and for other init systems see this U&L answer.


2

Maybe you can use sed Example 1 – sed @ delimiter: Substitute /opt/omni/lbin to /opt/tools/bin When you substitute a path name which has /, you can use @ as a delimiter instead of /. In the sed example below, in the last line of the input file, /opt/omni/lbin was changed to /opt/tools/bin. $ sed 's@/opt/omni/lbin@/opt/tools/bin@g' path.txt ...


2

What you can do is use :redir to write them out to a file and then edit them: :redir > variables.vim :let g: :redir END :n variables.vim or use variables.vim as input to some other command.


2

The NrrwRgn - A Narrow Region Plugin similar to Emacs plugin can show parts of the buffer in a separate scratch buffer, with automatic syncing back. That looks like a solution when you're concerned about moving away from the view. Otherwise, I would just size a split window to show exactly what you want, and keep it at that.


1

This happens when TERM isn’t set to the correct screen[-256color] in Vim’s environment, usually by some shell startup script. If that is the case – for example, you have a TERM=xterm-256color , either remove it or make sure it checks the original value of TERM before changing it, e.g. if [[ $TERM == xterm ]]; then TERM=xterm-256color fi


1

I needed two autocmds to do this. To reach the gap between the headers and the message, search for an empty line: autocmd BufRead /tmp/mutt-* execute "normal /^$/\n" then to enter insert mode: autocmd BufRead /tmp/mutt-* execute ":startinsert"


1

You'll have to live without ctrlS because that is the terminal command to stop output (ctrlQ undoes that). Other function keys should be mappable without any problem, just enter :map , then hit the function key you want to map which should show e.g.<F5> for F5, then space, then what you want the key to map to. You can put that line (without the ...


1

First, you need to know what ci" mean in vim: c means change i means inside " means double quote literal text object. So, ci" means change a string inside quotes. Adding 2 applied change command over 2 quotes.


1

I suggest you read doc/motion.txt. It states that with count 2 the quotes are included and thus i" works a bit like a" except no extra whitespace is added. EDIT: Just to be clear, I don't strictly speaking provide an answer. I take this behaviour as the design decision of the author and since he did not provide rationale in the manual, you can only ask ...


1

Yes, you can have that same auto code completion for C++ feature. Both Gedit and Vim have facilities for extension through plug-ins. This allows you to write the completion, so you can have that feature in either of them. You might want to spent some time looking if someone has not already done so.


1

I found that this happens when I enter netrw (with :Explore, for example) and press O on a file, it attempts to "obtain" this file resulting in an error message and this text being appended to my status line. I haven't found a way to get rid of it other than to use :set, copy out the normal status line, and re-set my status line to the proper one without ...



Only top voted, non community-wiki answers of a minimum length are eligible