vim

How can I filter the content of a register in vim?

I want to filter the content of a register (in my case, the clipboard register "+) through an external command before pasting it into the buffer. There should be a solution along the lines of http://stackoverflow.com/questions/1694392/, but I just don't seem to be able to figure it out. ...

How to Delete (desired text), delete (undesired text), and paste (desired text) in Vim

I don't know if its a retarded problem but its a funny dilemma. When I want to delete text that I want to place somewhere else, but that place has other bunch of text that I don't want, I would delete that text, but in the process I copy a new clipboard so the previously deleted text disappear. Any suggestions to solve this? ...

How to increase productivity with Vim and Eclipse for PHP5.3 projects (possibly using Eclim integration with Zend Studio)

I always strive to increase my productivity when developing applications and in the span of the last few years, I can say that I have made good steps towards increasing that productivity, but I still find I need more tools or methods. I need to edit faster and learn touch typing (currently in the process) and therefore I find a need to m...

Use last arguments from vim's :make command

I have a one key mapping to build my project. noremap <F5> :make<CR> This works great. However I sometimes am building a only a piece of the project. In this case I use the command :make smaller_part to build just that piece. I'd also like a one key mapping for this use case as well. noremap <S-F5> :make last_arguments()<CR> Is ...

Pressing enter after choosing a fuzzyfinder file doesn't load the file

I setup fuzzyfinder according to: http://codeulate.com/2010/02/installing-fuzzyfinder_textmate-textmates-cmdt-in-vim/ However my omnicomplete box is a bit foobared. I can scroll up and down but whenever I press enter to open a file, the omnicomplete box closes and I remain in the finder. I've spent a while trying to paw through my vim...

how to stop line breaking in vim

I'm editing some file with extreamly long line in it. My current vim settings will wrap thoes long lines but breaking them at the same time. It's good to see that a very long line is wrapped but it's not very apeal to me that a very long line is broken to more than one line .So what I need is : let vim wrap a long line but without line b...

Is there a way of synchronizing changes made in a html file only in some areas in Vim? (leaving the other elements intact.)

Is there a way of synchronizing changes made in a html file only in some areas? leaving the other elements intact. Lets say I have these 2 files: hello-world-english.html: <div> <p>Hello World</p> </div> hello-world-spanish.html: <div> <p>Hola Mundo</p> </div> And I make the following change to the first one (hello-world-english....

how to put the current line under edit on the top of the screen in vim

It is very inconvenient when the line I'm editing is at the bottom of the screen . Because you can't see any following lines and that prevent you from take any "eye refernce" to the content of the file following the current line . so my question is there a vim command can refresh the display and put the current line under edit to on the...

Autocommand FuncUndefined for script functions

How to match script functions (s:...) with FuncUndefined autocommand without asterisk (for exact match)? None of that does work: execute "autocmd AutoGroup FuncUndefined s:".funcname." ".cmd execute "autocmd AutoGroup FuncUndefined <SID>".funcname." ".cmd execute "autocmd AutoGroup FuncUndefined <SNR>".sid."_".funcname." ".cmd execute "...

vim and NERD Tree: Can NERD Tree persist across tabs in MacVim?

When using NERD Tree on MacVim, I can open a file in a new tab by using 't' (or 'T' to open it in the background) in the NERD Tree window, but when I switch to that tab, the NERD Tree window is no longer visible since it remains in the original tab. Is there a way to automatically open NERD Tree in new tabs when opening files from NERD ...

Re-render vim window in OpenGL

I'm trying to figure out the "right" way to do this.. Where by "right" I mean least amount of work at decent frame rate. Goal: I have an OpenGL app. It can render text. I want the full power of vim inside of it. I'm running on MacOSX. Possible solution: I can capture all keystrokes as GLFW events --> is there a way I can reroute this...

vi: is there a way to manipulate regex matches?

I have a file with the following line: img width="240" height="120" I want to scale the width and height by the same amount so :%s/width="\\(.*\\)" height="\\(.*\\)"/width="2*\\1" height="2*\\2"/g produces img width="2*240" height="2*120" is there anyway to make vi actually compute 2*240=480 and put 480 in the result. thanks fo...

How do I use variables in my .vimrc?

Hi I have a small problem with "tab size" and different project, some like 2 or 4 and the Linux kernel like 8 spaces per tab. And this is not a big problem since I can just change a couple of settings in my .vimrc set tabstop=4 set shiftwidth=4 set softtabstop=4 But that is 3 lines I need to change... It would be nice to have one...

how to change letters in a word from upper case to lower case or the other way around in vim

Instead of delete the word and retype all the letters once again with opposite case, I'd like to find some smart way in vim to solve the problem . Need your help, thanks in advance . ...

Is it possible to have Vim open a file in its default (non-vim) editor?

I have cTags set up to tag a bunch of custom stuff for simple internal scripting language I use at work. For various reasons, I'd like to have it set up so that if I <C-]> on certain tags vim opens them in their default editor rather than in another buffer. Is it possible to set this up? ...

How to paste something between html tags in Vim?

Pressing p pastes things bellow the current line, dit deletes things inside html tags. How do I paste something inside html tags? Nor here <p>I want to paste something here</p> Not here ...

how to do case insensitive search in vim

I'd like to search a upper case word, for example COPYRIGHT in a file . then I try to do the search like: /copyright/i but it doesn't work. I know in Perl if give the i flag into a regex it will turn the regex to a case-insensitive regex. Seems that Vim has its own way to indicate a case-insensitive regex. ...

vim indentation in C++ constructor initialization list

#include<iostream> using namespace std; class Example { public: Example(int a,int b,int c):m_a(a),m_b(b),m_c(c) { // Wrong indentation here due to the colon in above line, { should be under E printf("\nThe 3 argument constructor invoked\n"); } // Wrong indentation again private: int m_a; i...

How to set working/current directory in Vim?

So when I want to create a new file by using the :e command I don't want to specify the whole path, just the new filename. Can it be done? ...

edit many identical files in vim and save them all with one command

For reasons undisclosed, suppose I have many identical README.txt files in a few dozen sub-directories. In my fantasy world, I could run this: vim --magic-mindreading-flag */README.txt and rather than editing the files for me in sequence, vim will somehow recognize that they're identical and save my changes to all files simultaneousl...