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

learn more… | top users | synonyms

2
votes
2answers
307 views

Live diff-mode editing in vim

I want a live view of diffs while I am editing a file. vimdiff is able to do something I want, like highlighting the differences between two files. However there are two drawbacks of vimdiff that ...
2
votes
3answers
611 views

Open multiple files in Vim with a filelist

I have a file 'filelist' that contains the following lines: text1.txt text2.txt text3.txt I am looking for a command line invocation that opens the 3 files in vim. I tried the following: $ cat ...
88
votes
2answers
45k views

Ctrl-s hang terminal emulator?

I came across a sentence in vimdoc: Note: CTRL-S does not work on all terminals and might block further input, use CTRL-Q to get going again. and this key indeed hangs my vim. I was ...
3
votes
1answer
3k views

Vim - how to increase each number in visual block?

I have the following SQL: update am.PERMISSIONS set PRM_ORDER = 35 PRM_VISIBLE = b'1' where PRM_ID = 3; update am.PERMISSIONS set PRM_ORDER = [35] PRM_VISIBLE = b'1' where PRM_ID = 7; update am....
2
votes
2answers
2k views

How do I set bash aliases and variables from within vim?

In cmdline mode, the following examples do not work for me. !alias lol='echo lol' !lol='echo lol'
2
votes
2answers
1k views

gvim colors the same as is the terminal

Is there a command I can put in the .vimrc to make gvim look like vim's setup in the terminal? Same back ground, syntax highlighting, colors, and font. To add to my question, is there a may for gvim ...
3
votes
1answer
324 views

Autocompletion of email addresses in vim

I'm playing around with various bits of an email solution, including notmuch and alot. I write my emails in vim and I'd like to have tab completion of email addresses while writing email. Is there a ...
1
vote
2answers
82 views

What are some ways to compare file type and encodings to resolve buggy grep…?

In this case I have a folder of .txt files I created using drag and copy and paste from Adobe Acrobat PDFs and Text Editor in OSX. I've been editing these files in vim. Now I'm using grep to find ...
2
votes
1answer
483 views

Is there a file menu plugin for vim (not gVim) that creates a text-based GUI menu system?

I'm curious to see if there are any plugins that create a menu inside vim (not gVim). Perhaps something simple like a menu bar at the top, with drop down menus that are drawn with text. EDIT: The ...
15
votes
5answers
20k views

How can I exit from read-only mode in Vim?

I opened a file in readonly mode; is there a way to get out of readonly mode?
0
votes
0answers
45 views

screen flashes when I press ^S in gvim

I bind ^S in gvim, by: map <C-S> :w<CR> Now if I press the ^S combination, althrough file is saved (I saw the XXX written message), but gvim window flashes, is there a way to avoid that?
2
votes
1answer
114 views

Convert table in LaTeX

I copy the table from Calc (or Tracker) In my research I know three ways: 1: Record a macro: @a0f cw & <ESC>;.;.I\hline <ESC>A \\ (the spaces count ;) ) And then VG:normal @a<...
2
votes
1answer
127 views

Vim :fold of python code not different to C/C++ code

When I enter the command :fold inside my python code in .py files, Vim inserts the /*{{{*/ and /*}}}*/ tags. They, of course, cannot be parsed by python interpreter. When I'm in python I would like ...
3
votes
1answer
91 views

Switching to edit mode in VIM rc?

Still related to the previous question, but switching mode with exe "a" doesn't seem to work, I still have to press the a button manually Here upon opening a newly created a file, a template is in ...
1
vote
1answer
70 views

Jump to the first position of text “<CURSOR>”

I'm using a file template directory for newly created files, autocmd! BufNewFile * silent! 0r ~/.vim/skel/tmpl.%:e Now I want to add another function, that move the cursor to somewhere (defined in ...
1
vote
3answers
1k views

No syntax highlighting when editing crontab

I am trying to figure out why I don't have syntax highlighting when editing my crontab. I have both $EDITOR and $VISUAL set to /usr/bin/vim: > echo $EDITOR /usr/bin/vim > echo $VISUAL /usr/bin/...
5
votes
3answers
3k views

Can't open syntax.vim error when using vimrc

When I try to open my .bashrc file. then it shows these lines: Errordetected while processing /etc/vimrc: line 45: E848: Can't open file /usr/share/vim/vim70/syntax/syntax.vim Press ENTER or type ...
5
votes
6answers
15k views

How to select complete file in vi, to be pasted in gedit?

I know that doing %y a will yank complete file into register a. However this doesn't help in pasting the file content in another text editor (say gedit). What alternative is there for doing so?
1
vote
2answers
61 views

Adding a line in vim adds it at the line after the cursor, I would like to insert

I have this keybinding in .vimrc: map + :put=''<cr> map - dd I find it really useful for fast layout and source file cleaning with + and -. But using :put=""<cr> adds a line after the ...
2
votes
2answers
467 views

Seeing scons file like python file in vim. File dependent properties

I know I can setf python and then the file is recognized as python. However I must redo this everytime I reload the scons file. I have read some weeks ago that one could write in the last lines of a ...
5
votes
2answers
3k views

exact match in regrex when using vim, man, or less

when using vim, man, or less, I want to do some exact match in regrex for example, when using man, I want to check the argument '-c' if I use /'-c' the matching could be -cim -covert.........
2
votes
3answers
103 views

Ctrl+W in vi[m] to erase to whitespace

I want to mimic the functionality of bash readline in vim. Is there an easy way to do that? Currently in vim Ctrl+W "cuts" from cursor back to special char or whitespace. ie. In bash Ctrl+W "cuts" ...
25
votes
2answers
31k views

How do I get the solarized colour scheme working with gnome-terminal, tmux and vim?

There's a lot of questions around this, but it's because there are so many variables. I had to piece together instructions from many sites before I got this working. First, I could not easily set up ...
1
vote
2answers
196 views

How can I load the right hand pane of vim with a new file in linux?

I want to compare two files(say A and B) side by side(vertically) in in Vim. I open one of those two files(say A) and as per this answer in this site issue a Ctrl+w v . Now both the panels are showing ...
6
votes
2answers
884 views

Remove all Vim undo files in all but one directory

I just realized that I have tons of Vim undo (.un~) files sprinkled around my file system. I'd like to delete all of these files except in one directory—~/.tmp. My first problem is that I can't seem ...
2
votes
1answer
65 views

Manipulate color in VIM

In hlsearch mode, seems that you can set only one color. Now I want to use a script to get multiple colors for multiple keywords, is that possible?
0
votes
1answer
330 views

Vim - Tabs in :o Show up as ^I and Autocomplete Does Not Function

The title basically says it all - in Vim, my tab's show up as ^I, and I'm wondering if anybody knows why this might be. This is especially annoying when using :o to open a file, as the autocomplete ...
0
votes
1answer
84 views

Select line not selecting whitespace

Is there a way to select (or paste) text without trailing/ending whitespace? eg. To copy the whole line I press y, to paste it somewhere else I use p, but it pastes the whole text with the trailing ...
0
votes
1answer
108 views

Automatically insert fold tags around visually selected text in vim

I have started to use set foldmethod=marker, because I find it more convenient to use rather than syntax. But it has the disadvantage of needing to write // {{{ my title and // }}} around any ...
4
votes
1answer
234 views

Different vim colorscheme depending on mode

I'm often doing the same mistake in vim: I forget whether I'm in insert or command mode, then I type in, I get random commands or I modify/delete code, and I have to undo. I do this mistake really ...
3
votes
2answers
104 views

Is there a way in vim to know I am in the left most split?

I want to detect whether or not I am in the right most (or left, top, bottommost) split. In other words, when ctrl-w h would do nothing. Is there a way to do that?
1
vote
1answer
1k views

vim install on freebsd has taken 5 hours and counting

Ok, so installed portmaster and I'm trying with it, I'm hoping it won't take time. So I've been up all night and my vim installation is still going on. I have an amazon ec2 freebsd server setup. I ...
4
votes
1answer
376 views

lsof doesn't return files open by the same user

Consider this simple scenario: I open a text file ~/textfile.txt with vim in one terminal (tried with both edit and read-only modes). In a different terminal, I run /usr/sbin/lsof ~/textfile.txt ...
0
votes
1answer
869 views

Changing color of tabs titles in vim color files

In my custom color.vim file there are multiples entries like these ones: :hi VertSplit gui=none cterm=reverse :hi Folded ctermfg=grey ctermbg=darkgrey :hi FoldColumn ctermfg=4 ctermbg=7 :hi IncSearch ...
2
votes
2answers
1k views

How do I get pkg_add to look in the correct directory on the remote ftp repository when installing vim?

I have a brand new clean installation of FreeBSD 9.1 on Virtualbox. Running pkg_add -r -v vim, the terminal runs an ftp script to: ftp://ftp.freebsd.org/pub/FreeBSD/pub/i386/packages-9.1-release/...
2
votes
2answers
833 views

.exrc file in home dir not effective

I made a simple .exrc vim config file in my home directory on RHEL 5.8. Here are the contents: set nu However, when I go into vim, the line number are not shown. It may be worth noting that I am ...
1
vote
4answers
95 views

Editors Nano/VIM not using resources

Does anyone here know the resources it takes for editors to search and replace in a large file? The reason I am asking, is I have a 32 core server that HTOP is only showing one core at 100% when ...
3
votes
3answers
298 views

File goes missing for a short period of time after saving it using VIM

I am having a strange problem that seams to be caused by VIM, the Linux VFS cache, ecryptfs and/or something file system related: I open a file in VIM, modify it and save it. I try to access the ...
2
votes
1answer
182 views

How to reload a file in vim? [duplicate]

Various editors like gedit detect if the file is changed and asks to reload it. Sometimes in vim when I got many files to edit, I sometimes end up opening same file in different tabs for quick look ...
4
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 #...
1
vote
2answers
120 views

Cron creates vim process but does not display vim

Under MacOSX 10.8.2 I am able to run vim as follows in the bash shell: /usr/bin/vim -c "normal G" -c 'startinsert' ~/.journal If I put the exact same command in a script: #! /bin/bash export ...
2
votes
1answer
481 views

Launch R code from within vim-r-plugin as separate window instead of inside tmux/screen?

I use the vim-r-plugin to write R code in vim. It is a nice plugin and I love that the plugin lets me run code directly from within vim. However, the R prompt is opened in a console which is ...
1
vote
1answer
52 views

Replaced matched text in Vim with pattern

Here's a minimal example of what I'm trying to do. Start with: "this") "that") [hundreds of lines like this] End with: "this",&this) "that",&that) [hundreds of lines like this] I have gotten this ...
3
votes
4answers
328 views

What are some of the main differences between vim and vi?

What are a few of the main differences between vi and vim? Are there any significant keyboard shortcut differences, any features that one has that the other does not? Yes, I do know that I asked ...
3
votes
1answer
117 views

Is this crazy vim register voodoo (incrementing alpha registers) possible within a macro?

I have 4 lines. foo ["bar"] baz ["k"] daskhfkjhadsfj ["askfjhfjdsh"] dfjhafkjhfha ["skkksks"] I'd like to do a macro that takes the word and yanks it into a register, but I want the register to ...
6
votes
1answer
3k views

Rename current file in vim

Searching over net shows :f filename would rename the current file in vim. But executing this and later exiting vim, shows the new file with all the contents and also the old file is present with the ...
4
votes
1answer
369 views

In Vim, how can I automatically determine whether to use spaces or tabs for indentation?

Sometimes I edit others source code where the prevailing style is to use tabs. In this case, I want to keep the existing convention of using literal tabs. For files I create myself, and files that ...
16
votes
1answer
6k views

Vim: Making XML text “pretty”

Is there an easy way within vi to make your XML text "pretty"? For example: I want this.. <person> <name>Nick</name> <age>26</age> <gender&...
0
votes
3answers
2k views

Kate vs VIM/Emacs regarding speed [closed]

I'm trying to learn C++ in school using a UNIX environment and our professor urges us to use VIM or Emacs because a GUI is disadvantageous for two reasons: Moving your hands off the keyboard and ...
4
votes
1answer
2k views

How to enable nano-like whitespace highlighting in vim?

nano has a useful bit of syntax highlighting that actually highlights whitespace (tabs and spaces), under two conditions: (1) the whitespace does not have a non-whitespace character between either the ...