Skip to content

Tag: vim

How to set the path to the tags file?

I’ve tried to set the path to my project’s ctags file each time when I close the *.c file and go to terminal. I want the tags file to have been set when I open my code file. Or, maybe … can I set the tags file only for special directory? Answer Usually the path of the ctags file is

How to convert multiple letters to uppercase in vim?

I need to change all lowercase letters e, s, t, and a to uppercase letters in a text file in vim. I tried using :%s/e/E/g for all letters but I couldn’t find a better solution. I want to do it using the command, not via visual method. Answer Try this using %s.Capture the pattern first; and then change t…

Inserting text in vim causes each line to be shifted right

When I copy some text from one opened window (browser and text editor) to vim by pressing Shift + Insert, The text is inserted in a way that each consecutive line is shifted right with progressive amount of tabs. Meaning that second line is shifted by 1 tab, 3rd line is shifted by 2 tabs, 4th line is shifted …

Cannot go to the line of the reference

I recently installed cscope Vim plugin to make it easier to jump through code, but the main functionality – go to line, does not work. I have F2 key mapped to “Find all references”. When I select a function call for example, and press F2, I get the list of all the references, and the first r…

Vim Starts on Insert Mode and Inserts Special Characters

So vim just suddenly started flaking out on me today and I can’t pinpont the problem. Haven’t touch the configuration file and the last thing I worked on before I noticed the problem was updating my sshd_config and sshd_config.pacnew files. What I noticed is that upon opening the sshd_config file …

How to make z= look like ctrl-x s in vim spell check

So in insert mode if you hit ctrl-x s on a misspelled word you get a nicely formatted popup menu of spelling suggestions. This is awesome. The comparable command in normal mode (z=), however, gives a bland plain-text list that eats the whole screen. I’ve partially solved this by adding the following key…