vim (Vi IMproved) is a text editor supporting different editing modes.
5
votes
2answers
91 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 ...
2
votes
3answers
68 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" ...
2
votes
1answer
911 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
65 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 ...
5
votes
2answers
119 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
46 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
57 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
31 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
26 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
108 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 ...
2
votes
2answers
39 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
149 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 ...
3
votes
1answer
46 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
60 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
228 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:
...
1
vote
2answers
77 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
62 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
2answers
74 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 ...
0
votes
1answer
61 views
How to reload a file in vim?
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 ...
3
votes
0answers
212 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
68 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 ...
1
vote
1answer
80 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
37 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 ...
2
votes
4answers
113 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
49 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 ...
0
votes
0answers
49 views
Annoying process table in vim with altgr
I have a problem under vim. When I want to do a "{" (Alt r + 4) most of the time no problem.
But some times a strange character appear like "^\" and if I do Ctrl+C a process table appear . I then ...
6
votes
1answer
108 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 ...
0
votes
1answer
84 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 ...
7
votes
1answer
139 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>
...
0
votes
3answers
289 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 ...
3
votes
1answer
163 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 ...
6
votes
3answers
136 views
How can I open a file in VIM in readonly mode if it already has a swapfile?
When I use the command :e filename to open a file and this file is already opened by another vim instance, I get a prompt asking me if I want to open the file in read-only mode, edit anyway, recover, ...
2
votes
1answer
69 views
Why does insert-mode map “<F4>” unpredictably inserts itself or executes intended key strokes?
In Vim 7.3.1-762, mintty 1.1.2 (xterm), cygwin, Windows XP, the insert-mode map <F4> executes the intended key strokes at one time but inserts itself at another time. This undeterministic ...
3
votes
4answers
156 views
Utilize a different user's vimrc as well as vim folder
First of all, to prevent an X/Y Problem, I'll just state that what I really want is:
Run vim as the root user.
Instruct vim to use my nice pretty color scheme and all my plugins.
Do all this without ...
0
votes
1answer
135 views
Write out without quitting in Vim?
I looked through the vim manual, and I could only find the commands for "write and quit" and "write (if edited) and quit". Is there a command for "write out without quitting", similar to ^o in nano?
1
vote
2answers
411 views
How to change variable color in vim solarized theme?
I have just installed solarized theme for vim from https://github.com/altercation/vim-colors-solarized
But the problem for me is that the background stays black and I have the variable names in ...
16
votes
6answers
1k 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 ...
0
votes
0answers
19 views
Configuring Vim in NACT
I am trying to configure vim in NACT to be used with Nautilus right click, but it does not work. I used:
/usr/bin/vim
Parameter %f (or %d/%f)
But nothing happen. A ps -ef shows the process as ...
2
votes
1answer
326 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]
> ...
1
vote
1answer
127 views
Reload Vim highlight setting and colorscheme
If I change Vim's highlight setting, how do I "reload" it for colorschemes to take effect?
So, in my case, I remove highlight's cursor line number—
se hl-=N:CursorLineNr
Changing highlight from—
...
3
votes
1answer
110 views
What does vim consider to be a word? [duplicate]
Possible Duplicate:
Match word containing characters beyond a-zA-Z
I do not understand vims definition of a word. From the help for the motion w
(:h w):
w [count] words forward. ...
1
vote
2answers
370 views
vim how to configure backspace and delete key's both as normal
How to configure following keys in vim?
Backspace key to delete a character backwards.
Delete key to delete a character forwards.
After reading some posts, I got to know that only one of those can ...
3
votes
1answer
95 views
How to scroll large datafile while keeping header
Suppose I have some large datafile, which overflow the screen in both vertical and horizontal direction. How can I browse this file, while the header-lines stay on the screen?
For the moment, I am ...
3
votes
1answer
248 views
How to set the bash display to not show the vim text after exit?
My question is simple, but I am finding it hard to frame/explain it easily.
I log into several Unix boxes with different accounts. I see 2 different things for user1 and user2, while editing text ...
3
votes
2answers
216 views
The key codes for Caps Lock, Shift, Left Control and FN key?
Can somebody please provide the key codes for these keys:
Caps Lock
Left Shift
Left Control
Option key
FN
The key code I'm talking about is something along the lines of \<Esc>[200~, although ...
2
votes
2answers
98 views
How to consistently start Vim's command line to make a mapping work in any mode?
I try to normalize access to Vim's command line mode from any other mode in order to simplify my actual mappings. For example to make the <f6> key work from anywhere I define the following ...
4
votes
1answer
168 views
Match word containing characters beyond a-zA-Z
To match a word one can use
\v(\w+)
From the vim help :h \w:
\w word character: [0-9A-Za-z_]
This works exactly as described in the manual. However, I want to
match words that contain ...
2
votes
1answer
103 views
How to change Vim's command type mode programmatically?
Is there a simple way to switch from one command type mode to another without loosing the current command line?
In my ~/.vimrc file I remap the <space> and <c-space> character, coming ...
2
votes
1answer
117 views
Jump between the “if” and “fi” in vim, while editing a bash script?
Just like you could jump between pairs, i.e (), can I extend this feature to jump between beginning tags and ending tags?
i.e in bash, jump between if and fi
5
votes
2answers
109 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 ...


