Tagged Questions

vim (Vi IMproved) is a text editor supporting different editing modes.

learn more… | top users | synonyms

6
votes
2answers
290 views

In VIM, replace path with slashes without using escape slashes

In vim I want to substitute a long path /a/b/f/g/d/g with another /s/g/w/d/g/r in a text file. Usually I use \/ but there are too many slashes here. Is there an easier way?
0
votes
0answers
12 views

NERDTree don't create window on open when file is not saved

Is there a way to convince NERDTree to always hide editor window? Because when I open file and I have unsaved changes in previous one, NERDTree will open new window, so it is opened in split. I don't ...
0
votes
1answer
33 views

Auto code completion in GEdit and VIM, for C++

Being a Visual Studio fan, I am just wondering if I can have same feature in GEdit and VIM. PS : I’m new to VIM and currently using CentOS and Ubuntu.
0
votes
2answers
42 views

Adding color scheme to Vim

I would like to add this color scheme to Vim any suggestions on how I could accomplish that ?
2
votes
3answers
37 views

The vim navigation sweet spot, medium-distance jumps

In vim I often find myself j-stepping by line to go, say, 8 or 10 lines down. For example, if I have a directory open in netrw and the directory I want is 8 lines down I will just jjjjjjjj+ENTERENTER. ...
0
votes
1answer
16 views

Move to other end of paragraph in vim (not a visual block)

If I have a paragraph selected in visual mode (eg, vap), I can swap the cursor between the ends by using Shift-O. Is there a way to do this in normal mode?
1
vote
1answer
34 views

In VIM how do you run a command silently in the background?

I'm using ubuntu and currently have the following line in my vimrc file: nnoremap < leader >dc :execute 'silent !drush cc all' | redraw! The command works but it doesnt hit me back to the ...
1
vote
1answer
21 views

Vim command to turn hard wrapped lines into visually wrapped lines with preserved formatting

Given the following strings each on a separate line (which I indicate by prefixing line numbers) with syntax specific indendation: 1 Standard string with only text or code from some programming ...
0
votes
1answer
8 views

:bnext not cycling through all buffers in vim

For some reason :bnext is not cycling though all the buffers shown by :buffers I have 5 buffers open but only 3 buffers are visited when I used :bnext repeatedly. How can I cycle through all the ...
0
votes
2answers
39 views

Select an item in vim autocomplete list without inserting line break

A rather annoying feature of vim is that if you are in insert mode and do an autocomplete (Ctrl-N), arrow key down to the desired item, and press the Enter key, then it inserts the item but also ...
0
votes
1answer
74 views

How do I use vim on the command line to add text to the middle of a file?

I am trying to write a command along the lines of the following: vim -c "XXXXXX" myFile Instead of the "XXXXX" I want to supply some commands to vim to add some text to an arbitrary point in the ...
-1
votes
1answer
30 views

How to run a Perl program? [duplicate]

For my new Job. I want to write a Perl program. What are the things that may I have and how to run that program? I have a file named example.tex. if the file (example.tex) contain the word ...
1
vote
0answers
26 views

Gbrowse not working correctly on MAC

I'm using vim and have installed Pathogen and vim-fugative, but when editing a file under source control on github.com I use the command :Gbrowse and nothing happens. I've tried most of the advice I ...
0
votes
1answer
34 views

The form of the cursor in vim in konsole in kde with tmux

I use KDE and for vim in Konsole, I have such commands in my .vimrc: " Konsole " solid underscore let &t_SI = "\033]50;CursorShape=2\007" " solid block let &t_EI = "\033]50;CursorShape=0\007" ...
2
votes
1answer
86 views

/usr/bin/vim vs. /bin/vim

I get that binaries can be in different places. What I don't understand is why when I run whereis, which and type it says vim is at /usr/bin/vim, but when I try to run it using sudo it says I can't ...
0
votes
1answer
32 views

Why does my vim status line say “Obtaining ../”?

On the righthand side of my vim status line it says "Obtaining ../" and is highlighted yellow. Why does it say this? The results of :set are: :set --- Options --- cpoptions=BceFs history=1000 ...
2
votes
1answer
21 views

Position-based tag filtering in vim

When jumping to a tag with CTRL-] and having multiple tag matches, one has to choose which tag to use. Is it possible to filter the multiple match menu based on things like position or active syntax ...
2
votes
1answer
26 views

Why can I not do visual mode when using visudo?

I thought perhaps vim was in some compatibility mode of some sort. To make sure it was using vim instead of vi, I set the VISUAL environment variable but was still unable to get into visual mode ...
4
votes
4answers
69 views

Replace using vim - Replace a pattern […] by a string

I have a file containing lines in below e.g. format - [foo@host.com, bar@host.com], Payment processed - 23499, params = {'invoice':3243} I only want the account numbers i.e. 23499. It's a number. ...
0
votes
1answer
32 views

How do you track down why a Vim plugin does not work?

I have installed the plugin vim startify which worked fine in my remote server where I use it. Something happened (I think an upgrade) and the plugin no longer seems to work!
But I don't get any error ...
0
votes
2answers
32 views

“abbreviation” for dd$ if current line is empty

Example: I type "abc" then [newline]. Now I want to effectively just remove the [newline] to remove the current line (dd) and then jump to the end of "abc" ($). It might seem odd to ask for ...
0
votes
0answers
21 views

View .deb package files in vim

vim is capable of reading compressed files (for common methods, at least). However, it sees Debian package files as binary gibberish. The Archive Manager tool can, however, open package files and show ...
2
votes
1answer
42 views

How to toggle mouse support in vim?

I have been working on my laptop a lot lately, and I am accidentally clicking while typing. I know I could remove set mouse=a in my .vimrc, but sometimes I like using the mouse. What can I do to ...
1
vote
1answer
56 views

Neither `less` or `less -X` clear screen on exit

Neither less or less -X clear screen on exit. At the same time, vim does.... Env iTerm2, protocol mosh, server Centos + tmux + zsh iTerm2: report term as xterm-256color tmux: set -g ...
5
votes
9answers
516 views

Replace several strings with other string in several files

I have several text files. All these text files need to undergo a set to editing which can be done in vim. I want to automate this. vim has several commands for replacement. Suppose the text files ...
1
vote
1answer
102 views

vim replace search text by manipulated search text

This is a very simplified version of my problem. Suppose I have a text file containing several places the code 20091a or 20092a or 20093a. I'm wishing to surround all this code by the text ...
4
votes
3answers
413 views

Switching among cli and vim and other files workflow

I saw some kind of workflow in vim: Vim had a file open. Then some combination of keys made vim disappear and the user was in the command line working in cli mode, then opened another file and then ...
0
votes
0answers
38 views

Folding in vimrc does not work as expected

I added these to my vimrc: set foldenable set foldmethod=syntax set foldlevelstart=1 let javaScript_fold=1 " JavaScript let perl_fold=1 " Perl let php_folding=1 ...
2
votes
1answer
98 views

What does the underscore motion do in vim?

I don't understand the underscore motion in vim, at least in the context of yank (y). My cheat sheet reads "soft" bol down which I do not comprehend. If I use the motion alone it seems to be the ...
3
votes
3answers
208 views

Method for storing/remembering one liner commands

Often when configuring and adjusting unix-based systems I use a lot of one-line commands that are difficult to remember. For example, to determine what version of ntp (the time server) is running, you ...
4
votes
1answer
296 views

Vim Copy to System Clipboard without overwriting the default register(")

When I use "+y to copy to the system clipboard, the selected content is copied to the + register as well as the default(") register. How can I ensure that the content is copied only to the + register ...
1
vote
2answers
57 views

Vim - statusline and links

Given this situation: cd ~/temp ln -s /var/lib/alsa alsa cd alsa pwd -> /home/<username>/temp/alsa But if I open some file in the directory output of pwd, the vim statusline gives me: ...
2
votes
1answer
24 views

Reverse global and local marks in vi/vim

How can I reverse the capitalization convention of marks in vi/vim? Normally a lower-case mark like "a" means it is local to the current file, but upper case marks like "A" are global to the session. ...
0
votes
1answer
34 views

Cursor keys do not jump over tabs in Vim

When I step over a tab with the cursor keys (h and l), the cursor does not jump over the tab, it just goes one space at a time. This is annoying because I am not sure if there is a tab there or ...
0
votes
1answer
39 views

Can I get my iTerm key-combos working in tmux?

I have some shortcut keys defined in iTerm, and I use them for key-mappings in Vim. For example, I map Ctrl-Enter to send a ^[O2P escape code, which I then use to define a Ctrl-Enter key-mapping in ...
6
votes
1answer
61 views

Change inside comments with Vim

Is there a way to change inside of a comment with Vim? I know you can change inside brackets and quotes with i] and i". For example, If you are on a quote you can press, ci"my new textESC And ...
-2
votes
1answer
60 views

Why are there several keys unbound in vim?

There are several keys that are unbound in vi/vim, such as g, q, v and #. Is there a particular reason why these keys are unbound? Can I just use them however I want or will I be breaking certain ...
1
vote
0answers
279 views

Terminal colors for Vim Airline and Tmux Tmuxline

When using Vim on its own with Vundle and Airline the theme appears normally: When I have loaded it up in Tmuxline, the theme uses different colors and even Vim looks different: Here's my Tmux ...
1
vote
2answers
33 views

Random colored column?

For whatever reason, the first column is highlighted and I can't figure out why. I have not messed with my vimrc file, nor any zsh options. This column is only highlighted only with, "aliases.zsh", ...
8
votes
2answers
146 views

Vim spell punctuation for ⸮

I am finding myself using the point d'irony (⸮) more and more. However, vim spelling does not recognise it as a valid punctuation character. How can I add it to vim so that the spelling works?
1
vote
2answers
39 views

How to open chapters of Vim user manual in Vim

I opened the Vim user manual with the :h user-manual | only command (to open it in one window) and now I want to enter/open the separate text files. I tried to put my cursor over a section, such as ...
1
vote
3answers
81 views

Find and change certain LaTeX coding in vim, using regular expressions?

How can I change the following LaTeX coding: \cite{1,3-7,9} to \cite{1,3,4,5,6,7,9} in vim? I would prefer to use regular expressions.
5
votes
2answers
47 views

Color coding html color sequeces in vim

It it possible to setup syntax highlighting in vim so that a html color sequence is colored in that color, e.g. #FF0000 would show up as red. I'd also be ok with it underlining the text that color ...
2
votes
1answer
31 views

Vim: Exit single character replace mode with <C-C> when using `nnoremap <C-C> <silent> <C-C>`

I've become far too trained to use <C-C> to return to normal mode. I understand there is a difference between <C-C> and <ESC> but that's beside the point of this question. I use the ...
1
vote
2answers
50 views

How can I replace ^I into tab spaces in vim editor for .java file?

When I open my .java file in vim, I could see a couple of lines prefixed with one / more ^I characters. It looks like tabs in Eclipse that has got converted into ^I. I would like to replace a single ...
2
votes
1answer
31 views

Using vim-latex with latexmk and evince results in garbled text (GLib-GObject-CRITICAL)

When I compile a latex file in vim with the vim-latex plugin with \ll usinglatexmk, my vim terminal text content gets littered with error messages like the following dispersed through the text: ...
1
vote
2answers
112 views

Vim: join lines by replacing ^M

I have a file which has embedded ^M characters. I wish to join the lines at the ^M character. ie: change this: ^M être, ^M étant, ^M ...
1
vote
0answers
16 views

how to create a v.imrc [duplicate]

I created a macro in vim and stores in key s. example let @s='sample'. I want to write this macro in q.vimrc. How can this possible?. please give a simple sample program.
1
vote
1answer
42 views

Vim delay when using Ctrl+C, but only in SQL files

I'm working on a side project with both JavaScript and SQL source files. When I'm editing the JavaScript, Vim behaves normally. However, when I'm editing the SQL files, there's about a one-second ...
2
votes
2answers
113 views

How do I change the colour of text matching a regex in vim?

Suppose I want to make all text that matches some regex persistently and automatically (and without affecting / searches) appear in a different color. How would I do this in vim 7.4?