vim

backward-kill-word in vim?

Hi, is the quickest way to go back and kill a word Esc or Ctrl-[ and db? I guess I mess up a lot :P and am used to using M-<backspace or Ctrl-<backspace> in other editors (or word processors). Still getting the hang of this (vim), but switching to normal-mode for short tasks like this one seems an odd way to go about it. Just wanted to i...

How to use only tab (not space) in vim

I prefer to use tab than white space(may be a little different from most of others) But I found, when I hit Enter at the end of line, it will add some white spaces, but not tab. So, I have to delete them and press tab. I want to know how to set vim as: use only tab to indent the lines a tab looks like 4-spaces, but actually is a tab ...

[vim] operations available in insert-mode

Hi, inspired by this answer, I wanted to inquire what other useful movement/editing commands are available in insert mode. For instance, are beginning-of-line, end-of-line, or other such commands accessible without switching to normal mode? Still new to vim so I'm used to jumping around after typing a few characters or so... vim makes me...

VIM special chars without shift key

I write a lot of code and tired of pressing shift each time I need a special character. And since I use special chars much often, then numbers, I want to reverse shift behavior on them. So, if I type <4> I'll get '$' and if I type <shift>+<4> I'll get '4' and so on for each number. This mapping should work only in insert mode. I've...

Vim case-insensitive filename completion

I recently noticed how to configure bash to do case-insensitive filename completion (in /etc/inputrc, add: set completion-ignore-case on), now how do I get this in vim? ...

Change enclosing quotes in Vim

In Vim, it's a quick 3-character command to change what's inside the current quoted string (e.g., ci"), but is there a simple way to change what type of quotes are currently surrounding the cursor? Sometimes I need to go from "blah" to """blah""" or "blah" to 'blah' (in Python source code) and I'd ideally like to do it quickly using d...

How do I make elinks dump the web-page at a URL under cursor in a new vim buffer/tab?

I am trying to make elinks dump the web-page at the URL which starts at the current buffer position in vim (and ends at EOL), by mapping this keyboard shortcut and putting it in my .vimrc: nmap owp :norm yE \| new \| .!elinks -dump @"<CR> This yanks the rest of the line into the " register. Then it's supposed to open a new buffer and ...

Mapping :nohlsearch to escape key

I like to use hlsearch but I hate to keep everything highlighted after searching, to solve this problem I could simply use :nohlsearch or an abbreviation of it but that is still to much effort so I decided to try to do that on pressing escape. What I came up with is: nnoremap <ESC> :nohlsearch<CR> This works exactly as I want it to in...

Running R inside a buffer in Vim

I have used Stata and gVim on Windows for a while now. Recently I have switched to Linux, and I am planning to also change from Stata to R. A friend of mine is using R and Emacs ESS which seems to work perfect, however i'd rather like to keep using vim. I have installed the vim-r-plugin2, however, i can only send code to a seperate term...

Is there any way of compressing the tagfile in vim

Hi, I was following the guide at teuton.blogspot.com to set up autocompletion, when I ran the command: `ctags –R --c++-kinds=+p --fields=+iaS --extra=+q \ -f ~/.vim/commontags /usr/include` to generate a tagfile, only to realise that the command would generate a 'commontags'-file of 1.5GB a bit larger, than I'd have liked it to b...

easy shortcut for <%= in vim (for rails apps)

I type <%= often enough in rails that I want to find a shortcut for it. I am looking for a VIM solution (I specifically use macVim) I know I can map it to keys or create my own snippetMate.vim snippet but I'm wondering if there's a generally accepted way of doing this. ...

How VIM Autocomplete Work

I was going over VIM shortcuts & found the CTRL+p which acts as an autocomplete in UNIX (you know what I am saying, a dropdown list of the possible words to use, sorted by frequency of usage). It seems to detect even the most immediately typed words. How does this work in VIM? I am specifically interested in the data structures that are ...

Vim start with cursor where last went off

Is it possible to have Vim always start at whatever line i was in last time i was working in that given file? And if so, how do i do that? ...

How do I indent a single line multiple times in vi or vim?

I've found several answers on how to indent multiple lines in vim, I want to know how to take a single line and indent it more than once. In effect, I want a shorter version of the following command: ">>>>>>>>>>" (That is 10 right bracket "greater-than" signs.) ...

Is there a way to make vi and vim behave differently on OSX?

Is there a way to have two separate config files or somehow disassociate vi and vim on Mac OSX? Simply, I want vi and vim to open up in 2 different window sizes. Thanks! ...

Vim: Navigating to Previous and Next Buffers in Edit History

When I edit multiple files I oftentimes want to go back and forth between the last edited files. I know about :bn(ext) and :bp(revious) to switch between buffers but they don't keep the history of the last used files. Instead they use the order in which the files were opened. E.g., if I opened the files in this order A, B, C an my nav...

Can I change vim completion preview window height?

I'm using Eclimd for completion, it generates a lot of helpful info about function, but in 1-line preview window it looks messy. (same window uses by omni-completion) So: 1. Is there any way to change default preview window height? 2. Make preview-popup instead of preview-window? ...

Vim errorformat and jslint.

I am trying to get makeprg and errorformat working with VIM and jslint, and can't seem to get the error format right for the life of me... I am using the nodejs version of jslint which produces results like: 1 116,9: The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype. for (var...

How to install Vim scripts / plugins using viper-mode in emacs

I'm using viper-mode in emacs, and I'd like to use the Vim-LaTeX plugin with it (http://vim-latex.sourceforge.net/index.php). How do I install the plugin to use in viper-mode? ...

Viewing all `git diffs` with vimdiff

I have setup git diff to wrap into vimdiff (using this guide) and it's working as expected unless there are many files with changes. When there are multiple files with changes and I run git diff, it opens the first file and after quitting the first instance of vimdiff I'm presented with the following message: "external diff died, stoppi...