gvim

gvim :make command does not work

Hi all, I am under a Unix environment, working in C++. I'm opening gvim from a directory in which a makefile called "Makefile" exists. When I try to use ":make" from within vim, I get: shell returned 2 (1 of 1): make: *** No targets specified and no makefile found. Stop. ...

Swap text around equal sign

Is there an easy way to flip code around an equal sign in vi/vim? Eg: I want to turn this: value._1 = return_val.delta_clear_flags; value._2._1 = return_val.delta_inactive_time_ts.tv_sec; value._2._2 = return_val.delta_inactive_time_ts.tv_nsec; value._3 = return_val.delta_inactive_distance_km; (...) into this: return_val.delta_c...

In Vim: How do I delete a word and go into insert mode?

In normal mode, I can hit "ce", which deletes the rest of the current word and goes to insert mode. I want to delete the entire word, regardless of the cursor position (within the word of course) Follow up question: How can I replace the current word with whatever's in the default register? ...

Perfoming Vim substitue on a partial line

Hi, we can perform vim substitute on a set of lines by selecting them in visual mode and entering command mode. it auto populates the selected range :'<,'> and we can perform substitute like :'<,'>s/TestSubstitute//gc I would like to know is it possible in vim to perform substitute command on a partial line selected in visual mode, so...

VIM Restore last search pattern

I remapped [[ and ]] to find the previous and next pattern in the file. The mappings are as follows: nmap [[ ?^.section <CR> nmap ]] /?section /<CR> The issue is that when I use any of them, I "loose" the current search pattern, so when doing n for the next match, I search for the next "section". Is there a way to restore the search...

Vim LocateFile Plugin with fastfind

I built a fastfind database as mentioned in the following link as mentioned in the Unix Power Tools book. FastFind db is nothing but a file which contains a list of files in my project and I wrote a script to search the list for faster lookup. Now, I would like to integrate this script with lookupfile plugin. From the lookupfile plugin...

vim copy command to clipboard / buffer

How to copy the ex command to the clipboard or paste it to the buffer? Using gvim on Windows. ...

Can I rectrict vim/gvim to use only tabs as line start character?

I want to use only tabs without space \t\t...\tdef not \t \tdef or \t\t def ...

GVIM and multiple programming languages

My day job involves coding with Perl. At home I play around with Python and Erlang. For Perl I want to indent my code with two spaces. Where as for Python the standard is 4. Also I have some key bindings to open function declarations which I would like to use with all programming languages. How can this be achieved in GVIM? As in, is the...

Opening "save as..." dialog from :ex command

When I "save as..." a file from the menu, I get the usual windows "save as..." dialog, but when I save using the :sav command, I can only use vim file name completion. Is there a way to open the "save as..." dialog using an ex command? Thanks. ...

Using vim to get filename into files

Hi folks, I have a number of text files (700+) and I need to get each file's name into the start of every line in the file. Example, for filename myfile0072.txt mike 160 jane 174 to myfile0072.txt mike 160 myfile0072.txt jane 174 I don't have access to bash or c or perl or anything at work. Is there something I can do in vi...

In VIM, is it possible to use the selected text in the substitute clause without retyping it?

Let's say I have a word selected in visual mode. I would like to perform a substitution on that word and all other instances of that word in a file by using s//. Is there a way to use the highlighted text in the s/<here>/stuff/ part without having to retype it? ...

Automatically center vim search results

When I do a search with vim or gvim, the resulting positioning of the cursor within the window is somewhat random, all too frequently landing on the last (or first) line in the window. Search highlighting helps, but it's still cumbersome to have to look all around on the screen to find the cursor ... and a bit ironic, that after vim loc...

Printing source-level scope variables at vim debugger prompt

Hi, I am using vim debugger for debugging vim scripts [BreakPts]. :BreakPts //will create a new window and populates it with the list of vim functions available/loaded. We can click Enter on any function name to get the function definition and hit to set a break point on any line. Now, the question is how to print the source file sc...

Paste multi-line string into GVIM at cursor position

When I copy a two-line text from (e.g.) a PDF opened in Acrobat Reader into gvim using CTRL-V, the text is inserted above the line in gvim where I was positioned, instead of at the position where my cursor is. (scenario: I want to copy a document title that is spread over two lines and paste it in between a html tag in gvim). If I do th...

Cannot start gvim with photon-gui (can't find a valid font)

I'm having a problem trying to get gvim 7.2 working under QNX6.4.1 and Photon. Every time I try to start it I get the following error: E665: Cannot start GUI, no valid font found and I get the console vim instead. I think I've problem with my Photon configuration, or gvim configuration. As I already wrote, I've been using Photon, no ...

(G)Vim and scrolling of spelling suggections

When getting spelling suggestions in gvim (z= on a word) the list of suggestions is created rather slowly, I can actually see it scroll up one line at time. When using vim in a terminal the full list seems to be generated instantly and there is no visible scrolling like in gvim. I've tried setting ttyfast, but it has no visible effect ...

Toggle Cursorline on/off with one key press

At the moment I use: map <C-F2> :set cursorcolumn<Bar>set cursorline<CR> map <C-F3> :set nocursorcolumn<Bar>set nocursorline<CR> How to modify the mapping to toggle on/off only by using C-F2? ...

Associate .Rnw with vim latex suite

This I am sure is really basic stuff. I am just beginning using gvim and latex-suite. However I would like latex-suite to load when I edit a sweavefile with.Rnw extension. my .vimrc looks like this " These settings are needed for latex-suite filetype indent on filetype plugin on filetype on let g:tex_flavor='latex' set grepprg=grep\ -n...

in Vim how do I hide the eol doc chars ^M

in gvim on windows if I have text with CRLF eol then the text will display ^M at the end of each line. How do I 'hide' that special char from display? the :set nolist command """ does not dismiss it. I am stumped. UPDATE I did :set fileformats=unix,dos as a list but it didn't work at first. I closed the file and reopened it agai...