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

learn more… | top users | synonyms

1
vote
0answers
15 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
71 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
366 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 ...
0
votes
1answer
24 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 ...
12
votes
4answers
1k views

How can I constantly see the current filename in vim?

I am using vim and I need a way to always be able to see the file that I am working on without having to do ^G. I see the file name when I start vim but when I start to work and use various functions ...
1
vote
1answer
24 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 ...
2
votes
3answers
955 views

console vim in screen session: remap Ctrl-Shift-Left, Ctrl-Shift-Right to not delete lines

I have my gvim setup so that I can select word-wise with Ctrl-Shift-Right, Ctrl-Shift-Left etc. (yes, I know it's a bad habit, but it works for me..). Unfortunately, these key combinations delete ...
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 ...
15
votes
3answers
9k views

What does the noeol indicator at the bottom of a vim edit session mean?

I open a file using vim in ubuntu, and this is displayed at the bottom of the screen. "file.py" [noeol] 553L, 16620C What does noeol indicate ?
3
votes
3answers
1k views

Using CtrlP isn't giving very good results - am I using it wrong?

I was hoping that I could just type "job.php" and be directed to the job.php in my /lib/model/ folder, but I've mostly just get many other files returned: [No name] > ...
2
votes
2answers
83 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 ...
39
votes
8answers
27k views

How can I edit multiple files in VIM?

I know I can open multiple files with vim by doing something like vim 2011-12*.log, but how can I switch between files and close the files one at a time? Also, how can I tell the file name of the ...
1
vote
1answer
18 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
3answers
90 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 ...
7
votes
3answers
2k views

What does [converted] mean at the bottom of vim?

I have a log file, and when I open it via vim, it looks not readable, and it has [converted] at the bottom. What does [converted] mean? Is there a way to fix the format issue so that it is human ...
4
votes
2answers
109 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 ...
0
votes
1answer
20 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 ...
1
vote
1answer
34 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: ...
11
votes
4answers
12k views

How to select/delete until end of file in vim/gvim?

Accidentally I managed to copy-paste a paragraph in vim a zillion times. How do I select and then delete the text from my current position to the end of file? In Windows, this would be ...
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 ...
6
votes
4answers
1k views

How to search the current word in all opened tabs in Vim?

I have started learning Vim word-search using * and # while the cursor is over the current word. But this search is limited to the current file buffer. Is there a command or a shortcut to extend this ...
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 ...
7
votes
9answers
4k views

Compiling code from vim

New to vim and and I want to be able to compile code from within vim without running a new terminal and calling the compiler. How do I go about doing this? Note that this requirement is not ...
3
votes
1answer
49 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
50 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
74 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 ...
2
votes
3answers
152 views

Can I speed up pasting into vim?

I copied a part of the HTML out of a web page and wanted to save it in a file. For that I started a new vim session in a terminal window, with a (new) filename specified on the commandline, hit i to ...
3
votes
6answers
4k views

How can I check what version of the VI editor I have?

How can I check what version of the vi editor I have? What's the best way to upgrade it or install vim on Solaris?
11
votes
2answers
1k views

How to change the name of a vim buffer

Is it possible to change the name of a buffer in vim? Specifically, I'm using Conque Shell to open shells in vim (each shell is in a buffer) and with multiple shells, I see: 10: bash - 1 11: bash - ...
1
vote
1answer
454 views

Vim colorscheme background not filling terminal

I am using vim with lxterminal, and the colorscheme kolor, and I am experiencing an issue where vim's background color does not fill the entire terminal. It can be seen clearly at the bottom of ...
5
votes
2answers
6k views

“No protocol specified” when running vim with sudo

Recently I start to get "No protocol specified" when using sudo vim. It's just a warning I guess, because everything was working normally (I can open, edit and save files). The message doesn't appear ...
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
27 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
81 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.
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 ...
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?
4
votes
1answer
357 views

Vi: On startup, highlight tags and display tags in a preview window

I am using vi as a note-taking and outlining tool. I am constructing the "tags" file by myself. What I would like to do is that when I open my notes or outline file, vi reads the tags present in this ...
18
votes
7answers
5k views

Advantages of using set -o vi

I have seen many developers using this command to set the option to vi. I never understood the real use of this? When using bash commands, what help does switching to vi provide?
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 ...
1
vote
2answers
44 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
37 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
34 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 ...
6
votes
2answers
2k views

How to allow Page Up in GNU Screen?

I use Vim to edit text files on Linux. Commonly I connect to remote Linux machines using PuTTY from Windows. I use GNU Screen commonly as well. When using Vim inside Screen I am unable to use the ...
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
86 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?