Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor.

learn more… | top users | synonyms

0
votes
0answers
4 views

How to autocomplete python class in vim

In sublime text 3, if I'm editing a file.py and I type class it will automatically create this for me class ClassName(object): """docstring for ClassName""" def __init__(self, arg): ...
5
votes
3answers
373 views

Why does the system have /etc/sudoers.d?

Last time, I asked about the risk of these (in /etc/sudoers): user_name ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf %group_name ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf ...
0
votes
1answer
7 views

vim find buffer by absolute path

How can I find a buffer in vimscript when I have an absolute path, and as you know vim buffer names can be relative path? Is there a function for that?
0
votes
0answers
6 views

Is it possible to restart the internal python in Vim?

I'm running custom python code in my vimrc and If I often find myself in the position where I'm editing modules used by the vimrc, which causes script failures until I restart vim and its internal ...
0
votes
1answer
30 views

Vim: Managing multiple wording alternatives

(After reading this, please suggest another wording for the question, because I couldn't come up with a better one) When writing and editing in Vim, whether texts for humans or texts for humans and ...
1
vote
2answers
18 views

Open the output of a shell command in a split pane

I'm quite new to vim, so sorry, if the question is stupid. Consider any interpreted programming language. I can run the currently opened script using ! interpreter %, and use the return key to ...
7
votes
2answers
5k views

How do you change the default colorscheme in gvim?

In GVIM for Windows I know you are supposed to be able to add something to the $VIM/_vimrc file in order to customize the start up and I have managed how to figure out a few neat tricks with that but ...
25
votes
7answers
10k views

Vim: How to synchronize NERDTree with current opened tab file path?

When I open a new tab with different path from the previous file in VIM, NERDTree will still remains the same directory hierarchy of the previous file. Is there a sync shortcut to change the current ...
2
votes
1answer
4k views

How do I set up neocomplcache?

I just started using vim and saw a cool plugin: neocomplcache. My problem is that I can't get it to work properly. After installing, I took the example config from the help files of neocomplcache and ...
1
vote
1answer
19 views

MacVim / Vim retain content of all buffers (like Sublime Text). Preserve swap?

TL;DR: Can Vim store its swap files, and loads the same set of swap files and buffers on load every time? I'm on a Mac (OS: Maverick), where a number of application keeps the data in some sort of ...
1
vote
3answers
897 views

In Vim, how I can set a local match only for a specific filetype?

In Vimenter link description here, I can set local configuration as: setlocal number How I can set a local match only for a specific filetype? I use this: autocmd! BufEnter ...
5
votes
1answer
107 views

Tmux copy mode: stay in copy mode after selection

When using tmux, I often find a need to copy multiple items from one pane or window into another. When those items are located close to each other in a long scrollback buffer, my current workflow ...
23
votes
5answers
3k views

Vim - select text highlighted by search?

In vim, I often perform searches to hop to a word or phrase instead of navigating there with h/j/k/l. Then I hit n to hop between occurrences. Say I've got this text: Time flies like an arrow; fruit ...
11
votes
3answers
5k views

vim new line with same indentation

Then I press [Enter] in insert mode, there is a new line. But cursor places in the very beginning of a line. What do I do to create new line with the same indentation as the current's?
0
votes
1answer
12 views

Latex: customising syntax highlighting in vim

I made some custom commands to make writing equation blocks easier: % Equation starters \newcommand{\eqn}[1]{\begin{equation} #1 \end{equation}} \newcommand{\eqns}[1]{\begin{equation*} #1 ...
-3
votes
1answer
35 views

Set nano as a default editor over Vim

Every time I login to ssh terminal to edit files I execute the command export EDITOR=nano How Could I set nano as default editor so I shouldn't execute this command anymore
0
votes
1answer
32 views

How to permanently correct syntax highlighting after “?>”?

In Vim, I have a PHP script that contains a line similar to the following: $return = "<?xml attributes=\"values\" ?>"; Normally, the ?> characters will close an opening <?php tag, ...
0
votes
0answers
12 views

Can vim/gvim show “self” when editing a Ruby file?

When editing Ruby files in gvim, I'd like to be able to see which Ruby context the cursor is in. For example, if I have a file with several nested modules and classes, I want to be able to see what ...
0
votes
1answer
52 views

The risk of vim -Z (rvim)

Last time I asked about the way to prevent risks caused by these configurations: user_name ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf or %group_name ALL=(ALL) /usr/bin/vim ...
0
votes
1answer
24 views

Confusing end of line characters in Vim

How to view in Vim if there is any end of line character at the end of the file? If file content is '1234' as by echo -n 1234 > file.txt Vim shows (with :set list option) '1234$'. If file content ...
0
votes
1answer
14 views

Vim colorscheme not displaying properly

I realize that questions about Vim colorschemes have been asked quite frequently, but I believe I've tried the advice in all of them and I can't quite seem to get my colorschemes to work. That being ...
0
votes
1answer
14 views

Case insensitive search with accents

How can I tell Vim to search for a certain pattern in a case insensitive way taking into account also characters with accents? For example I would like to have /ü match both the capital U in Über and ...
1
vote
3answers
2k views

tgetent() not found while compiling vim

Currently I'm trying to install the YouCompleteMe extension to my vim setup, but it requires my vim to have the version of 7.3.584 or higher. The vim shipped with my Ubuntu 12.10 is 7.3.547, so I had ...
0
votes
2answers
44 views

Turn off vim's `filetype indent` for a specific filetype

In my .vimrc I have filetype indent on Now, the way it attempts to auto-indent yaml files is very confusing for me, so I want to turn filetype indent off, but only for yaml files, not for other ...
0
votes
0answers
12 views

Why doesn't Ctrl+[ (control + left bracket) work in GVim on Windows 8?

I'm on a macbook pro with a bootcamp partition running Windows 8.1. This problem also occurs on my PC with Windows 8.1 as well. In GVim, pressing Ctrl + [ should be equivalent to Esc but it does not ...
42
votes
8answers
24k views

How can I open a file read-only from command line with emacs/vi/vim

Is there a way to tell emacs/vi/vim (from the command line) that I want to view the file in view-mode or read-only. I know how to open a file as read only if emacs/vi/vim is already running.
7
votes
4answers
3k views

How to invert the selection in vim?

After selecting a range of lines with the V command, I would like to delete every line of the file that is NOT selected, so is a way to invert the selection -- select every line that is not selected? ...
3
votes
0answers
42 views

How to prevent security flows caused by sudo vim? [closed]

I learned doing sudo vim causes security problems. For example, user_name ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf or %group_name ALL=(ALL) /usr/bin/vim ...
0
votes
1answer
16 views

Scrolling through results of vim's silversearcher plug in

When I use :Ag "pattern" Let's say it finds 5 results and to scroll through them I use "cn" but it opens each one I scroll through in the buffer. Is there a way to open just the one I scroll to and ...
2
votes
2answers
1k views

Mouse scrolling in vim through tmux, how to configure?

I'm using a combination of PuTTY, tmux and vim. If I just open an SSH connection with PuTTY and then open vim, mouse scrolling works as expected. But if I open tmux and then open vim inside tmux the ...
0
votes
2answers
440 views

Mouse scrolling down in vim inside tmux via PuTTY, but not up

I'm experiencing an issue across multiple platforms where scrolling down with the mouse wheel works fine, but not scrolling up, while using vim within a tmux session within PuTTY. Any ideas? Maybe ...
0
votes
0answers
17 views

Bind Unite to <C-p> in vim

I love vim, and I personally think that CtrlP's trick of binding to <C-p> only when I'm not using it to yank-pop is awesome. Is there any way I can do this my self with Unite? Specifically: ...
1
vote
3answers
407 views

Git for Windows: Run vim in background without ampersand (&)

On my Windows machine, running gVim appears to tie up the git for windows shell, whereas if I run from the command prompt, this is not the case. How might I be able to run gVim (or any other program, ...
0
votes
4answers
950 views

Vim sync to remote on save

I'm looking for a plugin or script that works similarly to Sublime SFTP Basically, it should contain a configuration file and map the local and remote hierarchy. On save to a file, it should be able ...
4
votes
3answers
3k views

Vim Solarized dark theme looks weird on iTerm2

I just installed the solarized colorscheme following instructions on the project's page. This is what it looks like now: which is not like those screenshots on the official page. Any idea how to ...
0
votes
0answers
18 views

tmux printing u'0x001b' and “]112” randomly

So I've lived with this problem for several weeks now, hoping that if I just let it happen enough, I would figure out the underlying trigger. No luck. tmux in bash in gnome-terminal in XMonad on ...
0
votes
1answer
22 views

How can i insert a tab after choosing a proposed completion in vim

I thought I knew the answer to this. I used to do <C-V> tab as suggested in "How to insert a real tab with Vim SuperTab plugin if completion fails" and many others. If i set list though, I can ...
30
votes
3answers
17k views

How to add a command in vim editor?

If suppose my source code file name is "foo.c". While editing and debugging i always execute this command:- :!gcc -g foo.c -o foo;gdb foo Can I add a custom command to Vim such that If i type ...
1
vote
2answers
427 views

Vim colors do not appear correctly in tmux terminal running within rxvt-unicode terminal

I am using Debian (Jessie). My ~/.vimrc file contains the following statement. colorscheme murphy My ~/.Xresources file contains the following properties. URxvt.background: #000000 ...
1
vote
2answers
79 views

In VIM, how do you delete to end of line while in command mode :?

While in VIM, I have a leader shortcut for the following: :!git commit % -m 'updated '; git push; ...
2
votes
3answers
42 views

Vim copy/paste messing up indentaton

Whenever I copy something from another application and then go to paste it into vim, it messes up the indentation. For example, just now I tried to copy the manifest.json file from the hello-world ...
1
vote
2answers
2k views

My vim plugins are not loading

I am on a Mac. I want to install vim plugins. The problem like always is that after following exactly the instructions on https://github.com/tpope/vim-pathogen the plugin fugitive will not load. I ...
0
votes
2answers
34 views

How to run a grep in vim asynchronously?

I am using Vim in my development. Also using :vimgrep to search for text in files within Vim. But while vimgrep is searching, I can't do anything inside Vim until it finishes. A long time ago, I saw ...
39
votes
2answers
11k views

How to start vim without executing /etc/vimrc?

On my Linux server at work, the admins did not install cscope, and I installed it from source in my home directory and added it to the $PATH. The trouble is, the /etc/vimrc has a reference to ...
2
votes
3answers
916 views

Use of hash (#) on OS X with UK MacBook Pro

I have MacVim on a UK MacBook Pro. I can use the hash on TextMate by typing alt 3 but in vim this does not work. Do you know how I can type a hash using VIM on a UK MacBook Pro? The problem is ...
0
votes
1answer
137 views

(Mac)VIM disable NerdTREE for new and single files

I have configured NerdTree to open up when i start VIM by using Pathogen and placing NERDTree in my .vim/bundle directory. I have installed NERDTreeTabs the same way. I don't want NERDTree to open ...
0
votes
2answers
29 views

vim. ensure each buffer is mapped to 1 tab and always showing

So I want vim to behave like a "standard" text editor where whatever buffers are open will always map to a tab, and that tab only shows 1 buffer only. This is like say sublime text, where any open ...
7
votes
4answers
17k views

How do I make Vim beautiful (read: Textmate font/color ) on Mac OS X Lion? [closed]

I am just starting to make the Textmate to Vim switch. I love it, but it's so ugly. I'm running Mac OS X Lion and needed Ruby support so I am using Vim 7.3 as installed via Homebrew not the Vim Lion ...
5
votes
7answers
2k views

vim like navigation on Adobe Acrobat Reader

Adobe Acrobat Reader is currently one of the good pdf readers available on Linux platform. xpdf and evince to their job well, but acrobat's display seems to be better. I am used to vim editor and I ...
2
votes
3answers
1k views

PuTTY not sending Esc

I SSH with PuTTY from my Win7 x64 laptop to a Unix environment for my office. The problem I'm facing is very similar to this post where I cannot send an Esc character to the terminal. I first noticed ...