gvim

With vim, how can I use autocmd's for files in subdirectories of a specific path?

I am trying to figure out how I can define an autocmd that influences all files under a specific path. The autocmd I have tried is something like autocmd BufNewFile,BufRead /specificPath/** imap <buffer> .... Now, I'd expect this autocmd to be used if I edited, say, /foo/bar/specificPath/baz/something/bla.txt, but not if I edited /fo...

Unable to define a mapping including the '.' key

I am trying to define a mapping for Ctrl+. as follows: map <C-.> :bn<CR> This does not work. Typing Ctrl+. just results in repeating the last action just as you would get when typing .. Note that I do not want to change the behaviour of .. Any idea how to get this to work? ...

gVim doesn't recognize the Meta (Alt) Key in an imap after changing the encoding

In order to edit html files, I have the following three imaps in a file that I source for filetype html: imap <buffer> <M-[> &uuml; imap <buffer> <M-;> &ouml; imap <buffer> <M-'> &auml; This works fine until I change the encoding of the html file with set enc=utf-8. Now, pressing Alt-[ for example gives me a Û. Interestingly, after s...

Becoming better at Vim

I've been using Vim for quite a long time, but I'm at a level where I use insert mode most of the time, and I still use the arrow keys to move around(!). I feel like I'm not getting the best out of my lovely editor, particularly regarding navigating (especially code), copy & pasting, and doing other manipulations of existing code. (thou...

Defining a color variable in vim

When, for example, making a colorscheme, how can one define #40ffff as "UglyColor" (i.e. as a variable) ? Possible / not possible ? ...

Do we have any asp vbs complete for vim?

I see a lot of complete for gvim such as php, c , css, but I can't find any complete form aspvbs ...

How to get list of files which are currently being diffed in vim

I am writing a vim plugin in which i need to determine all those files which are currently being diffed. That is the ones for which diff is set. I have been going through the manual but could not find much. Is it possible to do this. This question is actually related to question how-to-detect-the-position-of-window-in-vim. In that ques...

VIM: created syntax not showing up?

HI people I recently changed to VIM for coding in C. I'd like to hightlight the operators +-<=& ... etc I searched in google how should i do it, and i found the answer in this website: I was suppose to do something like: syntax match Operadores /[][><()&!|+*={}-]/ hi Operadores guifg=#000000 gui=BOLD Those characters were supposed ...

GVim theme italics cuts off character

The italics cause the last character to cut off, making it hard to see. Is this something that can be fixed without removing the italics style from the theme? Using GVim with wombat theme on Windows. EDIT: thanks kemp, it was indeed a font bug. ...

How can I tell [G]vim where to look for python26.dll?

I have a version of Vim compiled with python 2.6 support enabled (from here). however vim cannot find the python26.dll. :version confirms +python/dyn :version and gvim.exe confirms DYNAMIC_PYTHON_DLL="python26.dll" echo PATH confirms python26.dll is in the search path. (both c:\windows\system32, and C:\python26) What could I be mi...

Preserving equal sized split view

Hello, I start GVIM in not-maximized window mode and split its window horizontally making sure the windows are equally sized. How can I preserve this equal-sized split view when I maximize the main GVIM window? Whenever I maximize GVIM forgets that the windows have been equally split. Thanks. ...

Append one range of lines to the end of another range of lines

Here is an example buffer in vim: fooooo bar pippy one two three And here is what I would like to produce: foooooone bartwo pippythree Ideally by specifying the two ranges of line numbers, but a sequence of commands would also be great. ...

Very unusual and weird problem with gVim 7.2

After installing gVim and running gvim from the run window, if I were to type :cd followed by a tab, I will get \AppData, \Application Data, etc. Which basically means I'm at my $HOME directory (C:\Users\Fabian). The weird thing is I do not have a \Application Data folder there. But if I were to run gvim.exe from its installation folder...

How to restrict operations to certain lines?

I have to work on some relatively huge code files in vim. How do I restrict some operations like find-next normal-n and others to a certain function / block? How would I visually know if I'm within that block or outside it? Looking and line numbers seems awkward, specially that the line numbers I need to work with are generally 5 digi...

GVim highlighting with matchadd eventually slows down?

I have the following in ~/.vim/ftplugin/python.vim to highlight long lines, accidental tabs and extra whitespace in Python files: hi CustomPythonErrors ctermbg=red ctermfg=white guibg=#592929 au BufWinEnter *.py call matchadd('CustomPythonErrors', '\%>80v.\+', -1) au BufWinEnter *.py call matchadd('CustomPythonErrors', '/^\t\+/', -1) au...

How can I swap positions of two open files (in splits) in vim?

Assume I've got some arbitrary layout of splits in vim. ____________________ | one | two | | | | | |______| | | three| | | | |___________|______| Is there a way to swap one and two and maintain the same layout? It's simple in this example, but I'm looking for a solution that ...

What's the most efficient way to repeatedly remove leading text using Vim?

What's the most efficient way to remove the text 2010-04-07 14:25:50,773 DEBUG This is a debug log statement - from a log file like the extract below using Vim? 2010-04-07 14:25:50,772 DEBUG This is a debug log statement - 9,8 2010-04-07 14:25:50,772 DEBUG This is a debug log statement - 1,11 2010-04-07 14:25:50,772 DEBUG This is a deb...

How do you edit tab labels per tab in GVim?

How do you edit a tab label, per tab, in GVim? You can do this: set guitablabel=foo But that will set every tab's label to "foo". The documentation seems to suggest using a t:var, like this: let t:guitablabel="foo" But it doesn't do anything. Is there any way to give each different tab a different name? ...

Print problems in GVIM

I have set linebreak and wrap. The document looks great on my screen but when I print it the words are broken p.e. this is the text of my printed docume nt How can I resolve this problem? ps: I don't want to reformat the text, I would like to keep the text as it is on the screen. I would like to have also a bit more right margin spa...

Multiple file types in vim

When I am working on a PHP file for example the default filetype is php. This makes sense, however when that PHP file has HTML as well the filetype is still only php. For some plugins that means that I get the PHP functionality for that plugin, but miss out on the HTML functionality. A more specific situation where this happens is with m...