Questions tagged [vim]

Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor.

Filter by
Sorted by
Tagged with
26 votes
2 answers
15k views

Fuzzy find within file in Vim

I love using the Command-T plugin in Vim to do fuzzy searches for filenames. I like it so much that I've started to want to do the same fuzzy searches for arbitrary strings within an open buffer. For ...
adamesque's user avatar
  • 389
5 votes
1 answer
2k views

why do my vim macros stop working sometimes?

This happens to me sometimes, and I haven't been able to figure out why. Lets say I start recording in vim (press q) then I finish and use the macros a few times. Then I do something else, like ...
Buzu's user avatar
  • 65
4 votes
1 answer
955 views

Is there any tutor like the 'vimtutor'? [closed]

I find that the vimtutor is very great, is there more command to teach you other things too? Thanks.
Ted Wong's user avatar
  • 933
5 votes
2 answers
605 views

An esay way to empty a config file in Linux?

Is there a way to empty a configuration file in Linux without deleting it so that it won't lose the permissions? Thanks.
superuser's user avatar
  • 4,067
0 votes
1 answer
415 views

How do I map the <compose> key to <esc> in vim?

I currently have my capslock key bound to [compose] using xmodmap. Compose is good when typing scientific stuff, as I can quickly write things like 275°K. But it's not useful when programming. When I ...
naught101's user avatar
  • 1,403
3 votes
1 answer
496 views

Can I view gvim tabs in separate windows?

I'd like different tabs to be visible at once, managed as separate windows (window manager windows, not Vim windows). This is impossible, right? Just checking.
Jean Jordaan's user avatar
0 votes
1 answer
558 views

vim mksession colorsheme issue

I can sees that when I use mksession it writes file to save session. The file looks ok and session is loading ok. But It change my colorsheme when I load the session whith so. After session is opened ...
itun's user avatar
  • 149
24 votes
4 answers
30k views

Can I use the `<cmd>` key in terminal Vim at all?

Following on from my other recent question: How do I map <cmd>-<shift>-f to run Ack plugin in Vim? Is is possible to use the <cmd> key in Vim at all? If Vim doesn't recognise the ...
jordelver's user avatar
  • 2,271
0 votes
3 answers
603 views

Oneliner for multiline regex s/,\n]/]/g?

Can someone provide a simple one-liner to remove certain line breaks? In vim I use %s/,\n]/]/g This should be possible with a very simple one-liner IMHO, but how?
Bastl's user avatar
  • 213
0 votes
2 answers
1k views

Nano-like editor that support Ctrl+Backspace and Ctrl+Arrow keys

Does anybody know of a nano-like editor that supports Ctrl+Backspace and Ctrl+Arrow keys? Like in Windows, where you can delete and navigate words. I have been trying to learn the basics of Vim for ...
Markus Hedlund's user avatar
13 votes
7 answers
21k views

What could cause strange characters in Vim?

I'm have this really strange problem in Vim using the NERD tree plugin, where, as you can see in the picture, the characters are showing up very strange. Where there is the ahat, ~V 3/4 it should be |-...
Tanner's user avatar
  • 361
3 votes
3 answers
5k views

Select all in vim through PuTTY

I'm PuTTYing into a Linux machine from a Windows computer. I'm opening up a large log file in vim and am having enormous difficulty trying to figure out how to select all the text and copy it into a ...
pnongrata's user avatar
  • 2,822
0 votes
1 answer
621 views

vim missing bottom toolbar on Linux Mint

I've been trying Vim/Gvim, in both Windows and Linux (Mint), but something seems to be missing. I'm missing the bottom "status" bar on the Linux version, the one that indicates the key pressed. Here'...
tehplaceholder's user avatar
11 votes
2 answers
6k views

How do I map <cmd>-<shift>-f to run Ack plugin in Vim?

I'm new to vim and I'm trying to map a key combo for running the Ack plugin found here: https://github.com/mileszs/ack.vim I want to map cmd-shift-f to run the Ack command :Ack. I've added the ...
jordelver's user avatar
  • 2,271
0 votes
1 answer
95 views

How can I check whether Vim has the -p (tabs) option or not?

I would like to figure out in my .bashrc (or one of the files it sources) whether Vim has the -p option available and if so create an alias. Now, that same .bashrc is used on numerous systems ...
0xC0000022L's user avatar
  • 7,073
2 votes
1 answer
704 views

MacVim - keyboard shortcut to change tab left

What is the command for changing to the tab to the left? gt is changing to the right, but I can't find the command for going the other way. Thanks
Stianhn's user avatar
  • 141
0 votes
1 answer
153 views

This line in .vimrc causes vim to open in "c" mode?

I cannot understand why having this line: nmap <C-[> :tabprevious<cr> ... causes vim to open up immediately in "c" (change?) mode. This is one half of a pair of mappings that I like to ...
neezer's user avatar
  • 723
32 votes
7 answers
19k views

Making the active window in vim more obvious

My workspace is normally one very big xterm with vim, split into six or more buffers. It would be really helpful if it were more obvious which one was the active buffer. Right now I'm using the ...
DrHyde's user avatar
  • 420
2 votes
1 answer
522 views

Redirecting output into existing (g)vim instance

Is it possible to redirect the output of a process (in bash) into an existing instance of (g)vim? Something like: cat myfile1.txt | awk 'print $1' | gvim - Then I might start a new window inside my ...
Andrew Wood's user avatar
  • 1,289
10 votes
2 answers
5k views

How to reclaim ^S in zsh?

I've found ^S mapped to be the fwd-search key for zsh (ohmyzsh) but I would like to use it in vim for various mappings as well - it seems like the zsh mapping is preventing me from using it now. Any ...
liamgriffiths's user avatar
5 votes
2 answers
748 views

Auto-insert left bracket in Vim

I'm trying to code some Objective-C in Vim and one thing I'm missing from Xcode is the ability to auto insert the left matching bracket. Say if I have the following text: NSString *string = [...
Ciryon's user avatar
  • 153
23 votes
4 answers
34k views

Save vim settings across launches?

My professor assigned an ssh account to every student in my programming class and mandated that we use VIM for text editing. I discovered :set nu and :set auto indent via Google. I noticed that those ...
Moshe's user avatar
  • 5,828
1 vote
1 answer
3k 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 ...
Eddy's user avatar
  • 3,387
2 votes
3 answers
1k views

Should I learn Vim without mapping keys?

I have been using vim for a few months its been a love/hate relationship. I love the concept of modal editing and never having the need to move you hands from the keyboard. The problem is that a lot ...
apokaliptis's user avatar
  • 1,962
6 votes
4 answers
284 views

How to explain VIM's modes to people?

I'm trying to explain VIM's NORMAL and INSERT modes. Is there a canonical metaphor that the Vi community has to explain the modes?
Moshe's user avatar
  • 5,828
26 votes
4 answers
20k views

How to do an inverse search in Vim? (i.e., get lines not containing pattern)

With grep I can do a grep -v "my search" to get all the lines without "my search". With sed I can sed '/baz/!s/foo/bar/g' to find replace text on lines with out "baz". Is ...
nelaaro's user avatar
  • 13.5k
1 vote
1 answer
1k views

nnoremap with vnoremap

with vim, I use object indent. and frequently I use this vii:!sort for sort a block with same indent. I try set this nnoremap nn <leader>ss vii:!sort<cr> but don't work, any ...
juanpablo's user avatar
  • 7,134
5 votes
1 answer
1k views

How to select the currently indented lines in VIM

How I can selected the lines with the same indent? For example: if true: line 1 line 2 ... line n If the cursor is over line 2, how I can selected from line 1 to line n?
juanpablo's user avatar
  • 7,134
4 votes
2 answers
2k views

How to fix vim textwidth during editing?

When editing files that I limit in my .vimrc to tw=80, when I come back to edit them later, the line-lengths end up all over the place. e.g. lets say for the sake of argument that this line hits 80 ...
Andrew Bolster's user avatar
12 votes
3 answers
9k views

Turning on XML syntax highlighting in vim for a non-XML file

I'm using vim to browse through some log files (the file extension is .log) which contain a lot of XML. How can I turn on XML syntax highlighting after opening the file? Of course, I don't actually ...
Mansoor Siddiqui's user avatar
4 votes
1 answer
6k views

mac iTerm2 unbind command + / Find Cursor shortkey [duplicate]

Possible Duplicate: Is it possible to remove a built-in shortcut from an application in Mac OS X? I'm looking for some way to unbind command + / key by default binded to the View -> Find Cursor ...
A B's user avatar
  • 560
15 votes
1 answer
2k views

How to select the last inserted text in vim

How to select the last inserted text in vim? For example I want to be able to type a text, exit the insert mode, select what I have just inserted, and change it to uppercase. Note: I do not consider ...
crenate's user avatar
  • 295
1 vote
2 answers
2k views

Building VIM with python support in Cygwin?

I'm trying to build VIM with Python/Perl support under Cygwin. Has anyone done this and can shed some light how this is achieved?
svanur's user avatar
  • 11
1 vote
2 answers
859 views

vim : <c-a> occupied from tmux/screen

I use screen/tmux and vim. In vim, I can't use <c-a> for increment a number, <c-a> is occupied from screen/tmux. any suggestion for a simple map for increment a number ? I try with ...
juanpablo's user avatar
  • 7,134
2 votes
2 answers
754 views

VIM: Don't pause after `make`

How can I make it so that I don't have to press the RETURN key every time I run :make in VIM?
jhasse's user avatar
  • 170
15 votes
1 answer
753 views

colors and vim with css

I started to use vim on Ubuntu for web development. Now, I have a visual issue when I use media query CSS when I put resolutions As you can see the first media screen is working properly but not the ...
hanna's user avatar
  • 153
3 votes
4 answers
4k views

Don't let vim scroll below bottom line

How can I disable that vim lets me scroll past the end of a file?
jhasse's user avatar
  • 170
2 votes
1 answer
1k views

Why is my tcp window size going to zero when using VIM over VPN

I use a mac os laptop over a typical (i.e. crappy) wireless home network and connect to work over a VPN. I ssh into the linux (ubuntu) desktop I have in my office at work. (When I say, "I ssh": I ...
Chuck Simmons's user avatar
1 vote
1 answer
235 views

How can I get the PHP linter output right in vim on Windows?

I'm using PHP linter to check syntax errors in PHP , right from vim with that command : :!PHP -l "%" when I do that, ( I'm on Windows ) , Windows open another CMD and the result of the parsing is ...
camus's user avatar
  • 111
8 votes
3 answers
3k views

Is it possible to page up/down in Vim without moving the cursor?

Is it possible to move to another page in gVim without moving the cursor from its present location? Splits don't count :)
Rook's user avatar
  • 23.9k
6 votes
3 answers
6k views

Alternate page-up in vim?

I just stumbled on shift+enter to page-down in vim. I'm wondering if there is something as useful (i.e. easier to reach than ctrl+B) for paging up. I'm looking for something that is already there, ...
digitaljoel's user avatar
  • 2,723
1 vote
1 answer
439 views

Getting man path through Vim

So, I've set up Vim as my default man viewer. I also have NERDTree starting up automatically - but I could really do without NERDTree showing the location the man pages every time I check man. I've ...
Andrey's user avatar
  • 167
5 votes
3 answers
7k views

Display characters on a square grid?

How can I display characters as if they are square in vim? The characters themselves don't need to be square, but if you were to draw a grid through all centre points of the characters it should make ...
AnnanFay's user avatar
  • 915
3 votes
1 answer
707 views

Replace hyphens with HTML entity for em dash in Vim

In Vim, I'm trying to run a substitution on this text: lorem ipsum -- dolor sit ...to get it to look like this: lorem ipsum&#8212;dolor sit I'm trying to do :%s/ -- /&#8212;/g, but it ...
Joe Mornin's user avatar
  • 1,627
12 votes
1 answer
2k views

Looking for non-conflicting cross-platform keybinding consistency

I use Mac OS X and Arch Linux and occasionally log into FreeBSD and Debian servers by ssh. My favoured tools are zsh, ssh, tmux, git, vim and irssi. I use iTerm2 on Mac OS X and unicode-rxvt on Arch ...
totte's user avatar
  • 191
0 votes
1 answer
311 views

VimScripting NERDTree

Trying to force cursor to leave NERDTree window on MacVim startup (mvim .) so I could continue make new split-ups and open certain files in them. But it feels like cursor is stuck in the NERDTree and ...
jibiel's user avatar
  • 233
7 votes
1 answer
2k views

How to open many tabs for many files in vim? [duplicate]

I can open one file in a new tab with: :tabnew file Let's say I have many files, for example: util.h and util.cpp. How I can open those files all in separate, new tabs? I'm looking for ...
juanpablo's user avatar
  • 7,134
0 votes
1 answer
314 views

No colors in Terminal.app

Somehow my colors in Terminal.app are completely borked. If I load up Vim with syntax on, there are no colors, but line numbers are underlined (and so are some other parts). It looks really really ...
Matthew's user avatar
  • 191
1 vote
1 answer
397 views

Opening files from Eclipse in gvim skips vimrc and gvimrc

When I try to open a file in an Eclipse project in gvim (using Eclipse's "open with -> other"), gvim seems to skip loading the global gvimrc and vimrc files and opens a bare white window with the ...
Andrew Scagnelli's user avatar
12 votes
2 answers
4k views

Keep cursor in Netrw window when browsing files in VIM

I have a vertical split in VIM. On one side I open netrw (:E) to browse through some files/folders. Although as soon as I press 'Return' to enter a folder, folder opens and cursor is moved into other ...
Art's user avatar
  • 1,251

1
52 53
54
55 56
75