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

learn more… | top users | synonyms

2
votes
1answer
56 views

Is replacing a particular line in a file through a bash script possible in VIM or EX?

I would like to modify a particular line, say line 5, in a file by using the EOEX construct how can I achieve my aim? The code snippet that I use to achieve my purpose is as follows: #!/bin/bash ...
-1
votes
2answers
26 views

How to insert specific lines into a file using vim?

I am using vim for both programming and competitive coding. Now, since I want to insert specific macros whenever I open a source file when I am doing competitive coding. I just copy paste the entire ...
2
votes
1answer
39 views

How to update a date in a file if applicable and increment the last digit by one if one writes to the file using Vim?

Aim The aim is to update a number in a file if one writes to a file using Vim. If the date resides in the file the date part should be left unchanged, but the last digit needs to be incremented by ...
6
votes
2answers
90 views

How to show line numbers in vim on the right side of the buffer?

I have set nu in my .vimrc which shows line numbers on the left side of current buffer. I would like to see line numbers on the right side. How to achieve this? UPDATE: This should also work for set ...
7
votes
6answers
414 views

vi commandline, goto line and column

I have been mixing the use of emacs and vi (vim) for a long time. Each of them has its advantage. I parse error output from a compilation like process and get a line and column number but I can only ...
1
vote
1answer
30 views

YouCompleteMe vim extension: How to jump to next error?

Is there any way when using the YouCompleteMe vim extension to jump to the next point in the file with an error? I find myself just scrolling through the page until I find the error highlight, but ...
0
votes
1answer
25 views

Vim mappings stop working

Some of my Vim mappings have stopped working, even though :map <keys> shows that the mapping has been registered. One example is map <S-CR> O<Esc> in my .vimrc, which does not work ...
1
vote
0answers
9 views

Supress standard output in vim-latex-suite

I use Vim Latex-Suite together with the PDF reader Zathura. In the last versions of Zathura they decided to output the following warning: "warning: Failed to loads bookmarks" whenever a document ...
1
vote
1answer
20 views

vim :grep using the bash 'globstar' option

I am (slowly) switching to Vim for everyday Ruby on Rails coding (Linux Cinnamon 64bit). Being a newbie, I recently came across something I don't understand. I want to use the :vimgrep and :grep ...
2
votes
2answers
85 views

Use Netrw or Nerdtree in Zsh/Bash to select a file BY BROWSING?

Often I find myself in the shell, wanting to insert a filename into a lengthy command. I'd like to hit a shortcut, and use Netrw or Nerdtree to browse for a file or directory, and have it pasted in ...
2
votes
3answers
93 views

Vim: consolidate regex-matching lines

I've pasted a log generated by rsync running through Cygwin on a Windows 2008 server. I am rsync'ing data over to a new file server (Synology), and after trimming out anything that's not an error, I ...
0
votes
1answer
23 views

PluginInstall vs BundleInstall command in Vundle?

On the Vundle GitHub page it says that one should use PluginInstall to install plugins, but when I search for Vundle on the web people often use BundleInstall instead. Both commands seems to be ...
4
votes
2answers
110 views

Can .vimrc be divided into multiple files?

Say I have some hundred custom re-mappings with iab for Java and some other hundred or so re-mappings for Haskell, then I'd want do divide these into different files to make it more manageable. What ...
1
vote
1answer
35 views

C++ header/source files in file chooser

By convention, our C++ headers live in .hpp files. When I open a gvim window with a .cpp file (so C++ source), then use the open menus, I get file chooser window which allows me to select files for: ...
2
votes
2answers
47 views

vim disassembles my indentation [duplicate]

When i'm in Insert mode at vim, and press Shift+Insert to paste my code to my file, vim disassembles my indentation , Such as: Question: How can i solve this problem?
1
vote
1answer
22 views

Vim visual selection method differs between Windows & Linux?

In Linux vim and gvim, I can make a visual selection by pressing V (e.g., v VISUAL or Shift+V VISUAL LINE), releasing it, and using movement keys (e.g., arrows) to highlight the desired text. In ...
3
votes
1answer
53 views

Vim emulation in IDEs vs gVim as IDE

I am currently using gVim as editor and cannot think about going back to mode-less editing. I code in Java for Android and in Python for another project. While trying to set up gVim as my primary ...
2
votes
1answer
51 views

A Sublime editor feature for vim… File pre-view?

I was wondering if there was a vim plug-in for the Sublime editor feature showing a smaller version of the file currently being edited, generally in the right hand side of the window -- see picture ...
1
vote
3answers
75 views

How to hide a content of a file? [closed]

Is there any way to hide the content of a file? Suppose I have the file bind which contains the following line: This is a test. After saving the file, it should not display its content. Is there ...
1
vote
1answer
22 views

Creating specialised dictionary file for VIM (from Wikipedia?)

I use VIM's dictionary completion feature very frequently, yet have found it unhelpful when it comes to 'specialized' terminology, in my case German philosophical terms. I would now like to create my ...
0
votes
2answers
23 views

Is there a way to limit a vim window to show only a portion of a buffer?

Sometimes when working with big files containing many functions I would like to create some splits showing specific functions and nothing more. Is it possible in vanilla vim or with some plugin to ...
2
votes
1answer
28 views

Vim - Automatically changing the pair of a changed HTML tag

How can I configure Vim so that when I change one member of a matching pair of HTML tags, the other is automatically changed to match? For example: given <span>content</span>, I want to ...
0
votes
0answers
20 views

Set default editor for 'info coreutils' [duplicate]

I'm using Ubuntu 14.04 and have this in my .bash_profile: export EDITOR=/usr/bin/vim export VISUAL=/usr/bin/vim man respects this setting but info always opens in something else, nano or it's own ...
2
votes
1answer
89 views

tmux vim colorscheme background is not showing

I have installed tmux but now text mode vim colorschemes do not fill the background colour properly. Here is how it looks with colorscheme xoria256 in the normal Ubuntu 14.10 terminal: And here ...
1
vote
0answers
28 views

How to map emacs multi-modifier keys in vim?

I want to be able to map the multi-modifier keys of emacs in vim. I am trying this for exiting vim: imap <C-x><C-c> <ESC>ZZ However, this does not work.
1
vote
1answer
126 views

Vim search in global variables

I can display variables in vim using :let g: but I cannot search in it (keybindings seem very limited). Can vim open this content as internal buffer or pass to some other command?
1
vote
2answers
46 views

Getting vim to go to the first line and enter insert mode when writing an email with mutt

Mutt uses vim as its editor, and its temp files are in /tmp/mutt-* I want vim to auto-insert on the first line when replying to an email in mutt. here is the applicable line from my .vimrc: autocmd ...
1
vote
1answer
41 views

Vim: x-terminal key mapping

I normally use Vim on Windows and have had no problems with key-mapping, but now that I'm using a virtual machine running Ubuntu, accessed through MobaXterm, things don't quite work as they should. ...
1
vote
2answers
41 views

In Vim, why does `2ci"` delete the surrounding quotes?

ci" (and 1ci") leave "s intact; why does 2ci" (and the same formula with any higher number) delete them?
0
votes
0answers
37 views

Gvim terribly slow redraw

I am on the last Arch Linux distribution using gnome desktop. And it is nearly impossible to work with gvim. For example, using opening python files make a mess on a screen when I start opening ...
1
vote
1answer
39 views

.vimrc does not working as expected

I've been trying new color schemes and I set: colorscheme gotham256 set background=dark set t_Co=256 highlight Normal ctermbg=NONE highlight nonText ctermbg=NONE but these thing ...
2
votes
1answer
89 views

How to use CapsLock instead of Escape in Vim?

I would like to map my CapsLock to Escape. How do I represent CapsLock in .vimrc? I know to map space to a command I would do something like this: :map <space> viw How would I map CapsLock ...
7
votes
2answers
427 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
38 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
69 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
74 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
43 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
18 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
48 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
24 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
10 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
86 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
104 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
vote
0answers
35 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
41 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
125 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
2answers
39 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 ...
3
votes
1answer
27 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
30 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
89 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. ...