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

learn more… | top users | synonyms

1
vote
0answers
12 views

How to use vim-slime from within a single tmux session?

I'm trying to integrate ipython and vim through a single tmux session using the popular vim plugin "vim-slime." The problem is that while I can get it to work fine provided that vim is opened in a ...
15
votes
3answers
12k views

How can I set “vi” as my default editor in UNIX?

I believe I can do something like export EDITOR=vi, but I'm not sure what exactly to enter, and where. How can I set "vi" as my default editor?
2
votes
1answer
23 views

How to clear search and command history in Vim?

If you search something in Vim by prepending searchterm with a forward slash, e.g. /searchterm, Vim puts that searchterm into the search string history table. You then are able to navigate through ...
2
votes
1answer
11 views

Setting up a secondary Vim environment

I've setup the YADR dotfile repo on one of my machines, and find it very powerful/useful. Though it's definitely slower than my present Vim setup with all its plugins, I'd still like to be able to ...
-1
votes
2answers
35 views

Vim,how to escape &?

Simply question,i want to search & as exact word,how to do in vim? I had try \& and \<&> but doesn't work
6
votes
1answer
40 views

How can I make `sudo crontab -e` use my `sudoedit` environment?

I've started using sudoedit <file> instead of sudo vim <file>. One of the advantages is that it uses my local ~/.vimrc. However, when using sudo crontab -e, it uses /root/.vimrc instead. ...
0
votes
1answer
13 views

Vim - inconsistency between :tabnext N and :tabprev N

From Vim's :help tabs: :tabp[revious] {count} :tabN[ext] {count} {count}<C-PageUp> {count}gT Go {count} tab pages back. Wraps around from the first one to the last one. While ...
0
votes
1answer
21 views

Create parameterized keybindings

I'd like to map +Ngt and -Ngt to :tabnext N and :tabprev N. I can create key bindings such as: nnoremap <buffer> <silent> +1gt :tabnext 1 nnoremap <buffer> <silent> +2gt ...
1
vote
1answer
661 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 ...
6
votes
2answers
1k views

Can vim display ASCII characters only, and treat other bytes as binary data?

I already know vim -b, however, depending on the locale used, it displays multi-byte characters (like UTF-8) as single letters. How can I ask vim to only display ASCII printable characters, and ...
0
votes
1answer
11 views

How can I expand directories by default in Vim's netrw tree view?

I can make netrw use the tree view by default by adding this to my vimrc: let g:netrw_liststyle=3 But I can't figure out how to expand sub-directories by default, is there a way?
1
vote
1answer
37 views

White terminal cursor and yellow Vim searches

I have a blinking block cursor in the XTerm. The goal is to always be able to tell my current position. It usually works fine, but it fails when I place my cursor on a background similar to the cursor ...
17
votes
5answers
2k views

Vim interface on web browser input fields?

I am looking for a browser plugin which inputs textin of input boxes with the same keyboard interface of the Vim text editor. I have adopted Vimium which makes general navigation much more effective, ...
1
vote
1answer
30 views

Cannot get vim to recognize unicode

I am having the most trouble ever getting vim to recognize unicode. At the top of my vimrc I have set encoding=utf-8 set fileencoding=utf-8 and LANG shows echo $LANG en_US.UTF-8 but when I open ...
1
vote
0answers
32 views

does vi have a bug which changes spaces in unedited lines, or is there an option to turn this “feature” off?

I changed a file by just adding a few lines, then ran a git diff and found changes strewn throughout the file resembling as shown in the image above: an extra space at the end of a line in the ...
24
votes
4answers
1k views

How do I remotely edit files via ssh?

I have to edit some files placed on some server I could reach via ssh. I would prefer to edit these files in customized vim on my workstation (I have not rights to change vim settings on remote ...
1
vote
4answers
39 views

Comparing files with vimdiff from a script

I'm writing a script to compare two directories recursively and run vimdiff when it finds a difference: #!/bin/bash dir1=${1%/} dir2=${2%/} find "$dir1/" -type f -not -path "$dir1/.git/*" | while ...
0
votes
1answer
23 views

vim: multiple substituons like sed

Simply question,with sed is possible to do a multiple substitution sed -e s/uno/due/ -e s/uno/due/ Is possible something similar with VIM internal substitution? :'<,'>s/445/53/a/444/53/g ...
2
votes
2answers
95 views

How to escape correctly this word on vim?

I want to substitute this word ${ARRAY1[@]} with $1 on vim substitution command I did :%s:\$\{ARRAY1[\@]\}:\$1:g But give me error about number of repetition,i try also "" but doesn't work How to ...
1
vote
2answers
125 views

Set makeprg to gradlew

First a bit of context for those who don't know gradle. It's basically like make except that you don't have to have gradle installed on your computer. It ships with projects as a file called gradlew. ...
0
votes
0answers
19 views

Plugin to fix vim's key bindings in terminal

Is there somewhere a plugin for vim which fixes all (most of) the keys issues related with using vim in terminal? If no could you recommend anything which could automate this feature? May be ...
0
votes
3answers
31 views

Vim replace in a visual mode

In a block of test like this cron.allow cron.deny I want to substitute cron with at,only in the range selcted by visual mode(ctrl+v) So i press ctrl+v : and appear the ! prompt ok I do sed ...
1
vote
2answers
56 views

VIM solarized color scheme looks wrong when using tmux

I am trying to use the solarized color scheme in VIM using gnome terminal (Ubuntu). When I run vim without tmux, it looks great, see below: If I add the following commands to my .bashrc # tmux ...
25
votes
7answers
24k views

Vi vs vim, or, is there any reason why I would ever want to use vi?

I know a bit about *NIX text editors (currently migrating from nano to vim), and, after looking around a bit on the Unix & Linux SE, have noticed that a fair about of question use vi instead of ...
1
vote
1answer
43 views

Installing VIM with Python support locally without sudo

I'm trying to install VIM with Python support on Linux without sudo, but for some reason VIM always gets installed without python ( -python in vim --version ) I first installed Python locally by ...
1
vote
0answers
41 views

Fetch patches from mailing list with mutt and vim

How can I fetch patches from a subscribed development mailinglist with mutt and vim so that they can be applied with "git am" or "git apply" command easily? Is it either possible to save it ...
1
vote
3answers
276 views

Alt mappings for vim in urxvt

My mappings which contain Alt aren't working in vim when using in urxvt. They work fine in gvim. An example of such mapping map <silent> <A-h> <C-w>< In insert mode when I type ...
33
votes
3answers
3k views

Why does Vim indent pasted code incorrectly?

In Vim, if I paste this script: #!/bin/sh VAR=1 while ((VAR < 10)) do echo "VAR1 is now $VAR" ((VAR = VAR +2)) done echo "finish" I get these strange results: ...
1
vote
2answers
44 views

Is there a way to edit a password-protected file without having to retype the password all the time?

I want to encrypt a text file using a password and a way to safely edit that file. The problem I am having is that I haven't managed to find a simple way to do that while only requiring the password ...
2
votes
1answer
30 views

Using 256 colour themes not working in vim/putty

PuTTY shows the the correct xterm-256color. Colours section shows "Allow Terminal to specify ANSI colours" and "Allow terminal to use xterm-256-colour mode". Yet when I use themes, they don't work, ...
3
votes
1answer
43 views

What is the difference between .exrc and .vimrc?

I know from experience that the ~/.exrc file can be used to configure vim. I also know that the ~/.vimrc file can be used for the same purpose. However, If I use .exrc to configure vim, this leads ...
3
votes
2answers
222 views

Why do I receive a “/bin/bash cannot find command” error for an alias?

I am using multiple python, I alias python3 to py: alias py="/opt/python3.4/bin/python3" I want to run python in vim so I write this: map <F9> :call SpecialCompileRun()<CR> func! ...
2
votes
1answer
803 views

vim: hide status line in the bottom

Sometimes I work with really small terminal windows and need every piece of space available. So I want to hide the vim status line. I already set laststatus=0 this hides one of the status lines. But ...
18
votes
1answer
297 views

Why does exporting vim as EDITOR in zsh disable keyboard shortcuts?

My .zshrc looks like this: export EDITOR="/usr/bin/vim" Now when I open a terminal and enter a keyboard shortcut like ctrla to go to the beginning of the line, it doesn't work. Instead, the string ...
1
vote
1answer
36 views

my Vimrc disabled the copy/paste action using mouse right click

Am using an open source .vimrc file from https://github.com/amix/vimrc/blob/master/vimrcs/basic.vim, but it is screwing up my default mouse right click copy paste actions. Whenever I do a right click, ...
15
votes
6answers
7k views

How to insert the result of a command into the text in vim?

For instance, :echo strftime(%c) will show the current time on the bottom, but how to insert this time string to the text (right after the cursor)?
3
votes
1answer
1k views

ls and vim color on SunOS 5.8/Solaris 8

I want to use ls and vim with color on Sunos 5.8 SunOS 5.8 Generic_117350-11 sun4u sparc SUNW,Sun-Blade-2500 I have installed ls (GNU coreutils) 6.9 and vim 7.2 In ~/.cshrc: setenv TERM sun-color ...
4
votes
1answer
33 views

How can I uniquely identify different GVim instances?

With gnome-terminal, I can use the --role command line argument to make the new terminal window uniquely identifiable by the window manager or other applications, for example: gnome-terminal ...
2
votes
1answer
20 views

Vim and unified diffs

In my daily work, I only deal with unified diffs, so I would like to define the alias alias diff='diff -puN' in my .zshrc. This alias is not respected when I use the shell from the vim command ...
3
votes
3answers
816 views

How can I make shell aliases available when shelling out from Vim?

In my .zshrc, I declare some aliases. Eg, which dbstart shows the contents of that alias. If I open vim from that shell, it is a child process. In Vim, I can run shell commands with :! some_command. ...
2
votes
1answer
74 views

Blank lines of unknown origin when running vim after tput clear

I have a rather bizarre issue with terminal behaviour. If I execute tput clear to clear the screen, my cursor (as expected) goes to the top of the terminal. If I run vi after that (vim actually), ...
1
vote
1answer
159 views

Is vim multithreaded?

I have a HUGE (and I mean huge) text file that I am going to process with vim. I could process it using two different (debian) machines. One is duel-core and one is octo-core. A single core on my ...
1
vote
1answer
50 views

Background color mismatch in vim and tmux

I'm having trouble getting the full range of colors to work in vim when I'm running through tmux. I belive that it's some sort of trouble with TERM variables or 256colors, but I've done everything I ...
0
votes
1answer
28 views

Why whitespace isn't include in vim backreference wrapped content?

I got some code with the format looks like: print 'hi' # sample comment. And I used :%s/^\([^#]*\)\(#.*\)/\2\r \1/gc to change their format in vim. By the command above, I got the result ...
3
votes
3answers
103 views

What is the correct way to access a specific help file in Vim?

In Vim, if you type :help into the status bar, you get a window with this (contents truncated to the relevant bits): *help.txt* For Vim version 7.4. Last change: 2012 Dec 06 ...
10
votes
3answers
7k views

disabling mouse support in `vim` in a `gnome-terminal` environment

Edit: The problem of an enabled mouse in vim appears to be specific to gnome-terminal (version 3.4.1.1-1; I am using gnome 3 fallback mode). If I run xterm, mouse support in vim is disabled by ...
2
votes
1answer
76 views

What is the difference between vim and vim-lite?

I want to install vim on my FreeBSD machine, and this other site suggests installing from FreeBSD ports like this: # cd /usr/ports/editors/vim-lite/ # make install clean This is all great, and I ...
5
votes
1answer
59 views

Share a buffer between tmux / vim splits

+-------------+ | | | 1 | | | |=============| | | | 2 | | | +-------------+ Each tmux split has vim open. I would like to do ...
6
votes
1answer
28 views

Copy to both X11 clipboards from vim

As far as I can see, with VIM I can choose between set clipboard=unnamed - yank to X11's primary selection buffer (middle-mouse button paste) and set clipboard=unnamedplus - yank to to X11's ...
0
votes
1answer
19 views

Where to set Vim colouring when logged into a remote machine

I do most of my development on a desktop, using Eclipse, but occasionally I have to log into the production machine to look at or edit files. Usually I use vi - which is an alias to Vim 7.2. The ...