vi is a text editor of the Unix operating system.
0
votes
1answer
31 views
Getting rid of characters when doing gf in vim
I am using vim for coding. When I have something like the following:
SomeModule->actualMethod() if I take the cursor to SomeModule and I do a gf I get a complaint that SomeModule- does not exist in ...
0
votes
1answer
28 views
Is there a way to filter out filenames from vim's “oldfiles”, perhaps using a pattern?
I use vim's :browse oldfiles a lot to edit files I've recently worked with. However, there are some files, such as git's auto-generated COMMIT_EDITMSG, which clutter that list and which I never need ...
0
votes
2answers
36 views
What does shiftwidth do in VIM editor
I read this about shiftwidth option on Google: To change the number of space characters inserted for indentation, use the 'shiftwidth' option.
Ok Ok, but what's that more exactly? How can I try this ...
-1
votes
1answer
60 views
Cannot use vi editor
When I try to launch vi using vi or vim, it fails to start.
ozzesh:~ # clear
ozzesh:~ # vi
ozzesh:~ # echo $?
0
ozzesh:~ #
The above vi / vim command can't launch vi.
3
votes
2answers
89 views
vi/vim alternative to sublimetext's “Expand selection to scope”
Sublime text has a cool feature called "Expand selection to scope" SHIFT+CMD+SPACE which selects the everything within the scope.
It select everything in scope, works perfectly ( ) or [ ] or { } ...
3
votes
2answers
35 views
vi swap file is empty
If vim crashes and leaves me with a .swp file that is empty (i.e., file size = 0), does that mean I didn't make any changes to the file during the session in which my computer crashed?
If so, then is ...
2
votes
2answers
123 views
Why provide vi and vim?
I think I'm right in saying RedHat and other distributions provide both vi and Vim.
Does anyone know what the rationale is behind providing both when presumably if Vim is provided it covers the ...
1
vote
1answer
33 views
Bash readline move cursor to previous forward slash
In bash , we can move back or forward by 1 word or character. Is there any option where i can move the cursor to the previous character that i specify, for example Forward Slash. ? Something like the ...
2
votes
4answers
103 views
In vim, what keystrokes (did I accidentally hit to) bring up :'<,'> and how do you set those marks?
I fumbled in vi and briefly saw this at the bottom of the screen, just as I was hitting ESC:
:'<,'>
Like it was ready for me to type an arbitrary ed command over a range spanned by the marks ...
1
vote
2answers
26 views
how to match string in “sk_term(” in vi
I have a sql file where I want to match the string "sk_term(" in the file
when I am using
:/sk_term(
it giving the following error
E486: Pattern not found: sk_term(
0
votes
2answers
83 views
Error location navigation in Vim Syntastic
I've got Syntastic installed in Vim and it is finding errors perfectly (mostly in Python code I'm working on). If I jump around normally in the file I see the errors in the status bar when the cursor ...
0
votes
1answer
45 views
Is it possible to launch MacVim NOT in full screen mode?
Whenever I Launch MacVim it takes up the whole screen. I don't want this. Is there any way to prevent it from happening?
I run OS X 10.8.
0
votes
0answers
72 views
Sharing a Virtualbox VM between a Windows 7 machine and Mac OS X machine
I installed Windows 7 64 bit onto a Virtualbox VM, using a VDI saved to a flash drive. I use the VM for Outlook and share it between a desktop PC and a laptop PC (both with Windows 7).
Now I'd like ...
1
vote
1answer
100 views
Vim has unexpected key presses on startup, what could be causing this?
Whenever I open a file with vim, the vim session starts with 2c having been automatically/programmatically 'pressed'. This means that if I start off trying to move down the file by pressing j, then ...
1
vote
2answers
48 views
Why am I not able to go to the next matching entry in vim by just pressing n?
vimtutor says this in lesson 4.2 : The search command
In Normal mode type the / character. Notice that it and the cursor
appear at the bottom of the screen as with the : command.
...
1
vote
1answer
79 views
Vim: edit multiple lines
I was looking for a way to edit multiple line simultaneously.
I found that Ctrl-V + selecting the lines + I should be the solution. The problem is that, for me, after pressing I (in fact Shift-i) I'm ...
0
votes
2answers
34 views
In 'vi', how can I navigate to the function declaration?
In Vi editor, if I am in the middle of a function, how can I navigate back to the function declaration?
Thank you.
-1
votes
1answer
63 views
Reg: Vi Editor tutorial for cygwin VI EDITO [closed]
Thank you for your offline support. Just now I have installed vi editor from your offline support. Now it is working fine.
Also please do let me know where we could I get the Vi editor tutorial for ...
4
votes
1answer
109 views
Edit text areas using vi key bindings, inside the textbox, in Firefox (without opening a separate window)
I'm using Firefox. Is there any way to edit the contents of a textbox using vi key bindings, inside the text area (not in a separate window)? For instance, is there a Firefox extension for that?
I ...
0
votes
3answers
113 views
What is the keyboard shortcut to go to the end of the file in vi?
I'm using putty to view a 30+MB file in vi on a Linux server, and I have to use PgDn to scroll to the bottom of the page. I realize I can use tail but I want to be able to move up and down the file ...
1
vote
2answers
83 views
need to get rid of strange symbols in text
I need to process the following text to get rid of the strange symbols such as:
â<80><99> â<80><9c> â<80>?
Example text:
With the mystery unexplained, the Hyatt ...
3
votes
1answer
50 views
Escape not idempotent in zsh's vi emulation?
I have zsh configured to use vi keybindings. I've noticed some unexpected behavior with "escape". In vim (I haven't tested vanilla vi) if I hit escape twice, I can hit 'i' once to return to insert ...
2
votes
2answers
102 views
In Vim, what are the differences between using :sus and :sh to access the shell without ending the Vim session?
I know that, while in Vim (and Vi, too, I think), if I want to temporarily access the shell I can do one of several things:
Use :sh (a.k.a. :shell), then log out from the shell to return to Vim
Use ...
2
votes
2answers
166 views
How can I remap CAPSLOCK key to ESC in Cygwin?
How can I remap the Capslock key to ESC in a Windows Cygwin shell?
Ideally I would only remap the value in Cygwin shells instead of everywhere, preserving behavior in other apps (although admittedly ...
1
vote
2answers
235 views
Vim is not reading gzipped files automatically
I want to see some zipped log files .gz in unix through putty. When I open them in vim the contents are not readable. I think vim is not able to unzip them.
1
vote
1answer
326 views
How to get vim color mode to work in vim under cygwin
I have installed vim 7.3 under cygwin.
And I have this in my ~/.vimrc
$ cat .vimrc
colorscheme wombat
And then I have this file wombat.vim under '.vim/colors'.
$ ls -la .vim/colors/
total 8.0K
...
0
votes
1answer
38 views
How to add a shell output content to vim?
When using vim, we can use :!ls to execute shell command, but how can we import the ls output into vim for editing?
1
vote
2answers
107 views
Copy visual mode selection below selection in vi
In vim, I often find myself repeating the same steps to copy a section before making changes to it:
V to start Visual mode linewise
j until I have selected the section I want to copy
y to yank the ...
0
votes
1answer
191 views
Why does VIM say there is trailing whitespace on this command?
I am trying to write a beautify CSS command in vim that sorts and alphabetizes all of the CSS properties as well as checks to see if there is not a space after the colon and inserts one.
Here is my ...
0
votes
3answers
78 views
how do i turn a whole file into uppercase?
I have a file on a server on another campus that's all in lowercase that i need to changed to all uppercase. Is there any simple unix command that will do this? [i'm using PuTTy on a PC if that makes ...
0
votes
1answer
37 views
When I try to change mode in VI it prompts ^[ char
I am using FreeBsd 9 and I need to use Vi.
My problem related with the changing mode (command to insert or insert to command) in VI.
I know that I need to use ESC key to change mode.
But in Insert ...
0
votes
0answers
95 views
Using vi/vim key binding in MS office and outlook
Is there a cost effective way to use vi like key binding in office suit like word, outlook, etc? I know there is viemu.com but 1) it's a bit costly 2) it seems to only support pre 2007 version of ...
5
votes
2answers
91 views
Is it possible to control the whole Gnome desktop with vi-like commands?
I know with readline you can use emacs or vi commands to edit the input of several
interactive text programs. I wonder if there exists such a similar facility to control
the whole desktop in Gnome or ...
2
votes
1answer
62 views
Is there a single key in vim that both cancels the command I've just entered and takes me back to normal mode?
Because I'm still learning vim, I quite often find myself mistakenly entering the wrong command (for example, let's say I entered ci{, when I meant ca{). When I do this, vi enters insert mode and (in ...
1
vote
1answer
48 views
“autocmd FileType” doesn't work the same way in Mac and Linux
Here is a small vimrc snippet that I was trying to use on my Mac
function SetCommonDefaults()
" Set line numbers
set nu
endfunction
autocmd FileType cpp call SetCommonDefaults()
What I expect ...
0
votes
1answer
66 views
How can I switch vim mode quickly?
This question is not the same as In vim, how can I quickly switch between tabs?, but what I want is a bit similar to it, since we are all trying to find shortcuts when editing with vim:)
Now I am in ...
2
votes
1answer
70 views
vi insert text for specific line ranges
Seeking help in vi editor.
I want to insert in the begin of line. I wanted it to be insserted for specific line ranges. for eg, line number 1 to line number 20.
Any idea
2
votes
4answers
209 views
Syntax highlighting in vi
I use vi in Linux to edit e.g. JSP files.
The code is not syntax highlighted. I think this should be possible to enable, but I haven't found out how. Is this possible to do in vi?
update1:
# vi ...
1
vote
0answers
161 views
bash vi key bindings: Can I map keys? Display mode (insert vs command)?
I am a long time vi(m) user and recently made the switch to using vi key binding in bash. I can already tell that this will be an improvement, but I would like to customize a few things to really ...
1
vote
1answer
145 views
VIM: how to select a line, up to the cursor, including the char under the cursor?
From normal mode I select what's before the cursor with:
v<Home>
Is adding to the selection what's under the cursor possible?
Thanks!!
2
votes
0answers
66 views
Abort a vim paste
Sometimes I paste a lot of data into vim (>5000 rows) and forget to enable paste mode. In that case, vim is busy for several minutes, trying to correctly indent all the text (which gets REALLY bad ...
1
vote
2answers
167 views
How to get vim to retain cursor position when opening a split
When I open a vertical split in vim, it takes my current line and bumps it to the top of the buffer (scrolling the entire file up). How do I get vim to retain its current position?
0
votes
1answer
54 views
Using regular expressions in vi
When I write a blog entry in Google blogger then a lot of entries like shown as below are getting inserted in HTML (not sure why).
<span id="textmarked_8" name="textmarker_9" ...
2
votes
2answers
239 views
vi editor text is flashing and unusable
I'm using vi on linux - vi --version gives:
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Apr 16 2010 12:47:47)
A few weeks ago, for no apparent reason, every time I use vi the entire text is flashing, ...
1
vote
4answers
521 views
Always use :set paste, Is it a good idea?
In a terminal vim, pasting clipboard data often messes up the code indent.
I just knew if I uses :set paste the indent is not broken.
Though, after pasting data, should I do :set nopaste again? What ...
0
votes
3answers
71 views
Insert text with vi editor
I was using nano before.
I'm a bit confused on how to start inserting text, sometimes I just start typing and on the bottom I see -- insert -- and I can edit and save fine. But sometimes I just skip ...
0
votes
1answer
267 views
Replace text with text from another file in a script?
I want to replace 5 rows of text in a file with the text of another file in my script, I know that running vim I can do
:45,50d
:r replacement.txt
to delete 5 rows and then insert the entire file, ...
0
votes
1answer
142 views
How do I type numbers in vi?
Sometimes when I have to do basic editing of a file or write a basic script when I'm working in Terminal, I use vi. The problem is that when I type numbers, it goes to that line. Is there a way to ...
1
vote
2answers
229 views
Exclude dash (-) from word separators in vi
vi uses dash and space as word separators. is there any way to exclude dash from word separators ?
This is required to work with the symbols generated by ctags exe. when symbol contain a "-" ,vi tags ...
0
votes
1answer
299 views
Remap shift-tab to tab in bash/screen/putty in Linux?
Well I use vi-mode in bash via the set -o vi command. What's annoying is when I'm typing words in capital then try to complete using tab but don't release the shift-key fast enough, it brings me out ...
