6
votes
1answer
83 views

Can I specify the layout of a vsplit command?

When I do the :vsplit command, it always opens the new file on the left side of the screen. Is there a way I can specify I want the new file to open to the right?
1
vote
1answer
41 views

dot command in Vim, last change?

The dot command in Vim repeats the "last change", but I am not exactly sure what constitutes the "last change". For example, if I type the sequence: A;{ESC}j. Then a semi-colon is appended to ...
8
votes
3answers
381 views

Vim: pasting lines line by line

Let's suppose I have a file containing: xxx yyy zzz and another file: kkk qqq ppp I want to obtain: xxxkkk yyyqqq zzzppp Is that possible in Vim with some command? (I've tried using VISUAL ...
5
votes
2answers
459 views

Lowercase all but the first (Uppercase) letter from UPPERCASE in cyrillic

To make all letters a lower case except the first letter. The first letter would look like "Uppercase" after I changed (from UPPERCASE in cyrillic). The rest (not UPPERCASED) leave unchanged. I'm ...
17
votes
5answers
2k views

vim - better colors so comments aren't dark blue?

Mostly I edit ruby files, although shell script file comments are also # Currently my comments show as dark blue on black which is really hard to read. See screenshot. How can I change their color? ...
5
votes
2answers
687 views

How to re-run vim auto-indentation on a tex file?

I have a LaTeX source file with its indentation messed up. I am looking for a way to force vim (may be through one of vim-latex-suite commands) to re-run the automatic indentation commands over the ...
-1
votes
1answer
111 views

How to use colors/colorschemes/fonts in vim effectively so that the text is as readable as possible

I am trying to be more productive in vim and as part of this I am trying to make the text presentation i.e. colors etc as nice to the eyesight as possible. Although I managed to change the default ...
0
votes
3answers
236 views

Make VIM act as Notepad++ on mixed line endings

I've googled all around and found tons of weird solutions to ^M problem, but couldn't find one and simple: how could I just open any file, like in Notepad++ and work on it? I don't want to mess with ...
1
vote
1answer
310 views

Vim Visual Mode - is there a way to change the background color only when in visual mode?

I forgot which mode I am in using VIM so I set this up in my .vimrc so that I easily know I am in Insert mode as the background changes to Yellow :au InsertEnter * hi Normal term=reverse ...
0
votes
3answers
300 views

Text editor with indented word wrapping

I've been using Notepad++ in windows for a while and it has a cool feature for word wrapping so that the wrapped text is indented. That is the start of the sentence starts at column 1, but wrapped ...
5
votes
3answers
2k views

vi / vim - how to automatically strip trailing spaces on save?

Is there a .vimrc setting to automatically remove trailing whitespace when saving a file? Ideally (to be safe) I would like to only have this functionality for certain files, e.g. *.rb
0
votes
1answer
96 views

vi / vim - extra indents when pasting text? [duplicate]

I can copy characters in other apps such as browsers with ctrlc. I can then press i to enter insert mode in vim and press shiftctrlv to paste the text in. The problem is that each line gets indented ...
4
votes
2answers
392 views

vim shortcut to open a file under cursor in an already opened window

In vim you can open a file under the cursor by using the gf command. One can also easily open that file in a new split window by hitting <c-w> f. This is a really nice and time saving feature. ...
0
votes
1answer
54 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 ...
9
votes
1answer
1k 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> ...
3
votes
1answer
114 views

How to display the permissions of a new file in the status line of the Vim editor?

With the following piece of code I get the permissions for an existing file: augroup Get_file_perm autocmd! autocmd BufWinEnter,FileChangedShell * let w:file_perm=getfperm(expand('%:p')) augroup ...
4
votes
2answers
841 views

Modeless vs modal editors

I just started learning Linux and all my previous experience of programming has been using the Windows platform. I came across Vim editor and read that it is modal editor unlike notepad which is ...
1
vote
5answers
102 views

vim automatic substitution

I have the following lines: '0, '1, '2, '3, How to put quote before the comma? I've tried the following so far: %s/[0-9],/&/g so & here replaces the matched pattern...
2
votes
5answers
2k views

Comment all lines in a text file?

In a text file I need to comment out all lines by adding a ";" as first character of each line. What is a good way to do this? I thought of Vim's visual block mode, but I couldn't find a "select all" ...
9
votes
2answers
758 views

How to set on executable bit for a particular file automatically

I want that when i make create a particular file, suppose i create it in vim editor, the created file should get executable permission as well when it gets created . I want this as i am creating some ...
4
votes
3answers
3k views

vi/vim, how can I write out a number of lines to a new file

I have a bunch of lines that I want to write out to a different file. How can I do that?
2
votes
1answer
207 views

Beep when typing backslash in cvim normal mode

I installed the cvim plugin for vim. Almost all the cvim commands start with '\'. But I when enter this character in normal mode, all I hear is a beep. Nothing happens. What might be causing this ...
3
votes
4answers
4k views

Advantages (or downsides) of GVim over Vim to edit code

Should I install vim or GVim ? I develop mainly Ruby on Rails (I also use IDE's, but different topic). Are there any differences or advantage of using Gvim vs vim ?
2
votes
1answer
72 views

!fmt for current line only

When I want to format part of text with fmt in vim I usually select parts of interesting lines in Visual Mode, with: Ctrl+V Arrows, and than type !+f+m+t. When there are couple of lines they are ...
4
votes
2answers
1k views

How to install light-weight vim and to be able to efficiently load files into one instance vim?

On my laptop with Ubuntu I'm able to have just one instance of vim, launched with vim --servername VIM After this I'm able to open files from console with vim --remote-silent filename I use ...
2
votes
2answers
264 views

Specify an alias as preferred editor in rc files (like .cvsrc)?

I have in my .cvsrc: cvs -q -e vim I want to create an alias (like my-vim or something like that): alias my-vim="vim -S ~/myscript.vim" And do cvs -q -e my-vim Unfortunately, this doesn't ...
17
votes
3answers
6k views

Buffers or tabs in vim? What are advantages/disadvantages of each approach?

I'm used to modeless editors. Only the past year I've been using vim/gvim, which has a modal approach. I'm used to tabs in all editors, since before vim all of them are used to it. In gvim, you don't ...
2
votes
2answers
509 views

How to turn off permanent highlighting of all braces (not just pairs) in vim

I have no idea how I modified vim such that all braces are highlighted, not just matching ones, but I want to turn it off now. How do I do that? The usual highlighting of matching braces works fine.
10
votes
4answers
19k views

How do I quit from Vi?

I started Vi on my Ubuntu machine. However I don't know Vi, and now I can not quit. I see the editor and I can write text, at the bottom line there is a label "recording". How do I quit from Vi?