vi

In gVim, is there a way to display a macro list similar to displaying your mappings?

I know there is a way to list mappings via :map (or :imap, :cmap etc.), but I can't find a way to list macros I have stored in my vimrc file (as in let @a = 'blahblah'). Is there a way to do this without having to manually looking inside it (via :split [myvimrcfile] or whatever way)? Also, if it is possible, is there a way to attach so...

What is the most useable VI/VIM plugin for eclipse?

I used to be a huge fan of Intelli-J and there is a fantastic VI plugin for Idea. Now I'm shifting to the Spring Source Tool Suite for my primary IDE and need to find a VI plugin that will allow me to work just as effectively. What plugin are people using? ...

vi editor query

I use vi quite often to edit files. Usually I need the file to appear on screen with line numbers. For this I do set nu in edit mode. What a drag! Can I automate this? Is there any way where vi will directly open the file with line numbers visible immediately? If so, are there any other tips that will make my experience with vi more eff...

Using the Python shell in Vi mode on WIndows

I know that you can use the Python shell in Vi mode on Unix-like operating systems. For example, I have this line in my ~/.inputrc: set editing-mode vi This lets me use Vi-style editing inside the Python shell. But can this be made to work when using Python on a Windows XP box? I'm using the pre-built Python for Windows downloaded di...

how to move a word to the beginning of the sentence in vim

say I have this line = function (x, y, word); and I want to convert it to word = function (x,y); Thus far, I have been manually selecting the word, then 'x', and then paste it at the beginning. And then I would remove unnecessary comma. Is there a more efficient way to accomplish the same thing? ...

How do I join two lines in vi?

This might be a small one! I have a two lines in a text file like below: S<Switch_ID>_F<File type> _ID<ID number>_T<date+time>_O<Original File name>.DAT I want to append the two lines in vi like below S<Switch_ID>_F<File type>_ID<ID number>_T<date+time>_O<Original File name>.DAT What happened here is that the second line got delet...

vi and ASCII extended characters?

Hi, I would like to know how can I set vi to show and work with ASCII extended characters without problem. Thanks! ...

When to use :abbr vs. :map in vi/vim.

The abbreviation and map commands both appear to give the user redundant functionality. :imap teh the seems to get the same job done as :iabbr teh the. I tend to make all my settings in :map commands of various types- everything from typo fixes to script-like one-liners. Is there a real difference between maps and abbreviations? Which ...

vi command line equivalent to CTRL-] ?

Hi all ! I'm trying to map my own shortcuts in vi. I want to be able to open a splitted window containing the declaration of the function I'm calling the shortcut on. something like this in my vimrc: nmap <unique> <silent> <Leader>tg :exe 'vsplit'\| equivalent of <C-]> but what's the equivalent of C-] in command mode ? ...

Vim yanking range of lines

Hello Everyone! This is my first post on stack, so please bear with me. I'm a C# developer who has just recently decided to expand my knowledge of the tools available to me. The first tool I've decided to learn is Vi/Vim. Everything has been going well so far, but there are a couple of questions I can't seem to find the answer to: 1...

Weird characters in GVim's visual mode

When I enter visual mode (from normal mode), and when then I press : there are these characters: <,'> after the : They are a feature or a bug? Windows XP SP2 ...

open last modified file in the directory using vi

I want a quick way to open the last modified file in the directory, perhaps in a form of alias. Currently, I do ls -ltr. Then copy-and-paste the filename Assume that I am using tcsh ...

Replacing quote marks around strings in Vim?

I have something akin to <Foobar Name='Hello There'/> and need to change the single quotation marks to double quotation marks. I tried :s/\'.*\'/\"\0\" but it ended up producing <Foobar Name="'Hello There'"/>. Replacing the \0 with \1 only produced a blank string inside the double quotes - is there some special syntax I'm missing that I ...

What unix text editor should I learn?

Maybe this should be a community wiki page... What unix text editor should I learn? My co-workers mostly use vi. I am thinking about vim because the syntax highlighting seems appealing. Is there any advantage to vi over vim? I know that there are a lot of emacs fans out there too? Is there any reason to learn a specific editor? ...

Prevent vim :make from changing the current working directory?

Synopsis: When calling vim's make command, it changes the current working directory (cwd) to the directory of the current file. It then runs the makeprg from there. I want to prevent the make command from changing the cwd, and instead call the makeprg from the directory of the parent vim instance Example: I have the following standa...

How to Limit the Search Scope in VI/VIM?

Find and replace scope can be limited like this: :16,256s/search_term/replacement/gc I don't want to replace my search term with any other text, I just want to find them. I tried the following, but it didn't help: :16,256/search_term # Notice that there is no 's' here Thanks for your time! ...

Tab autocompletion in bash vi shell mode

When using MSYS on a windows platform, I "set -o vi" to use the vi shell mode. Tab autocompletion for files and directories stops working. How to I renable this while remaining in vi shell mode? ...

Change File Encoding to utf-8 via vim in a script

Hi, i just got knocked down after our server has been updated from Debian 4 to 5. We switched to UTF-8 environment and now we have problems getting the text printed correctly on the browser, because all files are in non-utf8 encodings like iso-8859-1, ascii, etc. I tried many different scripts. The first one i tried is "iconv". That o...

Vim - yank into search register

Is there any easy/quick way to "yank" into vim's "last search" register ("/)? From the vim documentation, it appears that the answer is no, but that it can be assigned via a "let" command: It is writable with ":let", you can change it to have 'hlsearch' highlight other matches without actually searching. You can't yank or delete into ...

How can I execute a bunch of editor commands stored in a file in VIM?

I have read the other posts, e.g., http://stackoverflow.com/questions/1830886/vim-executing-a-list-of-editor-commands and others. The answer isn't clear to me for my case. I have some editor commands that I generated from an SQL query. It uses :s/foo/bar to change country codes (from FIPS to a non-standard code set). Here's a sample of t...