1
vote
2answers
35 views

Jump in vim on same line

I have log files of format 'date' 'filename' 'something 'return status' Often status goes beyond my screen. While I am reading 'something' I press End to see status and Home to see filename. But ...
0
votes
2answers
102 views

Is VIM adding the Windows newlines?

Notice the line endings from git diff: - IP_ADDR: 'http://1.2.3.4:143' + IP_ADDR: 'http://2.4.6.8:143'^M I edited this file by putting the cursor on 1 then pressing ct: and then entering the ...
2
votes
1answer
412 views

bash vi mode: What does # -*- mode: ruby -*- # vi: set ft=ruby : mean?

I'm looking through some random code, and at the top of it, it says this: # -*- mode: ruby -*- # vi: set ft=ruby : What does this mean? I know it's a simple question, but I couldn't find it out ...
0
votes
3answers
89 views

Cannot find where this colorscheme setting is being set for vim on OS X

A long time ago I was farting around with color schemes for vim and I remember setting a line somewhere colorscheme sonofobsidian. I did this before I knew what I was doing with vim, unix, OS X, etc. ...
8
votes
2answers
172 views

Maintain permissions bits when writing new file with VIM

In Vim, when I write a copy of the current buffer to a new file using :w [filename], it appears that Vim uses the default (i.e. set by umask or whatever) file permissions for the new file. If the ...
5
votes
1answer
152 views

Non-greedy regular expression to convert command tags

Background Consider the following text: There are three types of font families: serif, sans serif, and teletype. To switch between these families, use <cmd>rm</cmd> for serif, ...
1
vote
1answer
51 views

Check if Vim has more than one window open

I'd like to overload my tmux binding which cycles through panes to also cycle through Vim windows if the current pane happens to be running Vim. I can detect the presence of Vim by checking the pane ...
0
votes
2answers
152 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 ...
0
votes
4answers
202 views

Vim inserting characters before a comma on multiple lines

Say I have the following DRAFT, SAVED, ARCHIVED, DELETED; And I want the following: DRAFT("draft"), SAVED("saved"), ARCHIVED("archived"), DELETED("deleted"); How can I do this with vim? I'm ...
3
votes
2answers
940 views

What does a ~ mean after a file name in UNIX (bash)?

When I create a file using vim and save it, for eg. main.c, two copies are created: main.c and main.c~. They have the same contents. Why is this happening and what does the ~ mean?
0
votes
4answers
254 views

How do I move a line in a file to the top from the command line?

I would like to move a path in a file to the top of the file. Each path is listed 1 per line. How do I move /someplace/2nd/ to the top using only the command line? /someplace/1st/ /someplace/2nd/ ...
2
votes
3answers
2k 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.
0
votes
1answer
2k views

Why does VIM say there are trailing characters 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 ...
1
vote
2answers
294 views

vim command to run java

I'm trying to add a line to my .vimrc to run java. If I type, :! basename % .java | xargs java then all is good, but I cant get this into the vimrc without E492 Not an editor command. I'd initially ...
2
votes
3answers
2k views

Where are these non-default Vim settings stored if not in my .vimrc file?

So when I press :set I see a bunch of settings that are not on my ~/.vimrc file. (My guess is they're settings I've set years ago and don't remember). So I do :version and get a path $VIM/vimrc, ...
1
vote
1answer
582 views

Using overwrite in vim but I'd like different behaviour from carriage returns

So I'm putting text in a particular area in vim... I'm using REPLACE mode so that I don't mess up the 'far edge' of the 'rectangle' when I type. It would be great if when I pressed enter in this ...
0
votes
1answer
880 views

How do I uninstall ctags on MacOSX?

I was messing around with vim, and every now and again my CPU goes to 100% running ctags. It's getting annoying, I can't figure out how to uninstall it. I've tried 'sudo port uninstall ctags' but that ...
10
votes
2answers
109 views

vi / vim abrumpt buffer movements within window

When using :set wrap in vi/vim, the contents of an entire wrapped line are placed in the display buffer upon moving the cursor into a new line, even when navigating through a file by display line ...
0
votes
4answers
201 views

How to split a long hex string

I've a long hex string 00121eafc5800020 ... etc. Is there an easy way I can split these with a space per hex coded byte so I get 00 12 1e af c5 80 00 20 in vim (or another easily accessible tool)
2
votes
2answers
435 views

non-destructive piping in vim?

Is there a way to pipe selected text through an external command in vim, but not to replace the selected text with the output? Occasionally I want to copy something in a vim buffer to the X clipboard, ...
6
votes
2answers
4k views

How to run Unix commands from within Vim?

How can I run Unix commands while I'm inside vim?
14
votes
2answers
8k views

How does one switch between windows on VIM?

I'm using both Vim and MacVim (or well, trying to). I installed the Tagbar plugin but find it impossible to switch to the actual Tagbar window to make my selection. I've been reading loads about ...
4
votes
1answer
2k views

How to pass vim buffer contents through shell command and capture the output to a split window

I've read lots of threads about running shell commands from vim, lots of documentation on vim commands, .vimrc and all that, but I just can't seem to understand the "ex" language or vim mappings well ...
1
vote
3answers
4k views

In vim's visual mode (type “v”), how do I select multiple lines?

What are the shortcuts that I need to know, to make it snap snap? Right now, all I do it the up/down arrow...it's noobish.
0
votes
2answers
1k views

TMUX key bindings

I have a problem with TMUX key bindings. When I'm working on a terminal pane, if I press ctrl+pgup, it should scroll the screen one page up, as a normal terminal, but it doesn't. Also, while using ...
2
votes
1answer
1k views

How to create custom keyboard shortcuts in vim?

For example - when coding in Perl, I need to sometimes comment out a bunch of lines. What I do is something like :80,96 s/^\(.*\)$/#\1/ I want to create a custom shortcut for this so that I can do ...
7
votes
3answers
6k views

I just got a Mac! How do I do “end” , “home”, “page up” and “page down” in my terminal/VIM editor?

I write a lot of python in my VIM, on the terminal. What do I do?
0
votes
3answers
1k views

username/password for ftp

I tried to download the rpm for vim from ftp://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/vim/vim-minimal-6.3-1.aix5.1.ppc.rpm . I am using "ftp" command in AIX. when I use, open ...
2
votes
3answers
136 views

Open file without specifying exact location

Say I have a file in some obscure directory that I want to open and edit. I don't want to do something like this... vim ~/foo/bar/blah/doh/ugh.txt I'd rather be able to say find this file and open ...
4
votes
3answers
1k views

Vim: Use different ~/.vim/plugin/ directories for different versions of vim?

Like many of you, my custom Vim configuration is stored in my ~/.vimrc, with the plugins, colors, etc. stored under ~/.vim/plugins, ~/.vim/colors, etc. I want to share a single Vim configuration ...
2
votes
1answer
853 views

Unify colour settings across vim and gvim

My vim and gvim have different colour settings. I want to use the same colour settings in both. I checked I am not using any .vimrc or .gvimrc configuration file at the moment. How do I unify ...
34
votes
2answers
10k views

How to start vim without executing /etc/vimrc?

On my Linux server at work, the admins did not install cscope, and I installed it from source in my home directory and added it to the $PATH. The trouble is, the /etc/vimrc has a reference to ...
0
votes
2answers
274 views

Selected text gets automatically copied in Vim

Whenever I select something in visual mode in Vim it automatically gets copied. It causes a problem since I have alread something in clipboard to paste in that selected text. Is there any way to ...
0
votes
1answer
903 views

Vim: Custom Folding function done, custom highlighting required

I have defined a function in vim to properly indent folds. Ie so they look like this: Unfolded this is text also text indented text indented text not indented text folded with default ...
11
votes
4answers
8k views

Vim highlighting for specific file types (where to put syntax files, vim events, line to put into vimrc)

I have defined a file time jak.vim to offer custom highlighting when I take notes, however it is being applied to some files that do not have the .jak extension. Specifically a file named ...
1
vote
3answers
904 views

Custom Vim Highlighting (only works with specific file types)

I have this in my vimrc: "on will override defaults set. Enable will allow you to set defaults." syntax enable ... "attempting to highlight specific keywords so it is easy to see in code." "see ...
2
votes
1answer
375 views

Vim: When folding code allow tabs to remain

In vim I would like to change the folding behavior. Suppose I fold this block: === fileName === == summary == I think that this defines the class to use for the ...
5
votes
2answers
4k views

Vim open file at location that was last viewed

When I close a file in vim and reopen it, the file opens at the start of the file. Is there anyway to make the file open at the last place the I viewed?
7
votes
6answers
4k views

Custom vim highlighting

I am editing some xml right now and I have been leaving myself some comments of things to come back to. Like this <!-- Question: bla bla --> I am editing with vim right now and I would like ...
0
votes
2answers
190 views

How do you force vim to behave as a terminal app?

using vim via ssh on a machine with an x server running throws an X error. Specifically: >vim BadWindow (invalid Window parameter) Vim: Got X error Vim: Finished. This does not occur on my ...
14
votes
4answers
4k views

How to make Emacs read buffer from stdin on start?

With Vim I can easily do $ echo 123 | vim - Is it possible to do with Emacs? $ echo 123 | emacs23 ... Emacs starts with a Welcome message $ echo 123 | emacs23 - ... Emacs starts with an empty ...