Hi,
is it possible to use something like an "vim-close/exit"-Event to execute some last commands before vim quits?
I use this lines in my config, to let vim set my screen-title:
if $TERM=='xterm-color'
exe "set title titlestring=vim:%t"
exe "set title t_ts=\<ESC>k t_fs=\<ESC>\\"
endif
but when i close vim, the title is s...
I can't find a way to make Vim show all white spaces as a character.
All I found was about tabs, trailing spaces etc.
...
I have this Ruby code, where some lines are commented out...
class Search < ActiveRecord::Migration
def self.up
# create_table :searches do |t|
# t.integer :user_id
# t.string :name
# t.string :all_of
# t.string :any_of
# t.string :none_of
# t.string :exact_phrase
#
# t.timestamps
...
I want to be able to write \bit and have it expand to something in vim. How do I encode a backslash in the left-hand side of an abbreviation, though?
I tried all of these:
:iab \bit replacement_text
:iab <Bslash>bit replacement_text
:iab <bs>bit replacement_text
but got E474: Invalid argument for all of these.
The map_backslash help...
I want to run command like this:
vim -c "%g/blablabla/norm /str<ESC>cwSTR" file
How I write escape character in the command?
...
How can I reverse a word in Vim? Preferably with a regex or normal-mode commands, but other methods are welcome too:
word => drow
Thanks for your help!
PS: I'm in windows XP
Python is built in supported in my vim, but not Perl.
...
Imagine, we have to construct a regexp in vi/vim. Which special characters we have to escape with backslash?
By special characters I mean the following chars: {}|()-[]+*.^$?
Seems like we have to escape: {|()+?
And leave as is: }^$*.[]-
Thanks.
p.s. AFAIK, we have no '?' character in vi/vim but '=' instead which should be also esc...
Hi,
i use vim in screen for development and if i quit vim, the current screen-content stays there...
outside the screen (xterm), exiting vim will restore the previous buffer
(like:
[ server1 ]~$ cmd
some stuff, some stuff
[ server1 ]~$ cmd
[ server1 ]~$ cmd
)
But not inside screen.
I tried to use xterm as terminal inside scr...
I'm using Perforce with Vim on Windows.
I currently have an auto command set up to open a read-only file for edit when changing it:
au FileChangedRO * !p4 edit <afile>
Is there any way to set up a similar auto command to execute p4 edit when attempting to write a read-only file rather than edit it?
...
How do you make Vim take you back where you were when you last edited a file?
My work computer has this feature, but not my home computer! How do you set Vim to remember in which part of a file you were when you last edited it?
EDIT: just to be more precise, I want this behavior when opening a new file, or on startup.
...
Can standard mouse input be customized in vim (in my case gvim)? Plugins are acceptable options too.
I'm specifically interested in "overriding" a double-click on a word, so that instead of just highlighting the word, gvim does a search and thus highlights all instances of this word in the file. I've seen this functionality in other edi...
in vi, search and replace, how do you escape a '/' (forward slash) so that it is correct. Say in a path.
like: /Users/tom/documents/pdfs/
:%s//Users/tom/documents/pdfs//<new text>/g --FAILS (obviously)
:%s/\/Users/tom/documents/pdfs\//<new text>/g -- FAILS with a trailing error
:%s/'/Users/tom/documents/pdfs/'/<new text>/g -- FAILS ...
I'd like to run indent on each .c and .h file I open in vim. I've looked at setting equalprg, but I'd rather have it done for me when I open the buffer, so I tried:
autocmd BufReadPost *.[ch] '[,']!indent
This works fine if the file has no syntax errors, but spews error messages from indent into the file if I'm missing a closing brace...
I am trying to use snipMate and pydiction in vim together - however, both use the <tab> key to perform their genius-auto-completion-snippet-rendering-goodness-that-I-so-desire.
When pydiction is installed, snipMate stops working. I assume its because they can't both own the <tab> key. How can I get them to work together?
I wouldn't m...
I've got alot of plugins enabled when using vim which I've collected over the years. I'm a bit fed up with how long vim takes to start now so I'd like to profile it's startup and see which of the many plugins I have are responsible. Is there anyway to profile vim startup or script running? Ideally I'd like to know how long vim spent i...
I would like my tcsh script to launch an editor (e.g., vi, emacs):
#!/bin/tcsh
vi my_file
This starts up vi with my_file but first displays a warning "Vim: Warning: Output is not to a terminal" and my keystrokes don't appear on the screen. After I kill vi, my terminal window is messed up (no newlines), requiring a "reset". I tried "...
I want to "set spell" automatically when i am editing the commit text in git. From the % I see that it is writing to a filename called .git/COMMIT_EDITMSG. How do I update my .vimrc to automatically set spell on when editing that file.
something on the lines
if ( filename has a word COMMIT)
set spell
fi
...
Assuming the following text file, which is actually a data dump of funds and price statistics:
PBCPDF
05/01/2006
0.0000
0.0000
PBCPDF
0.0000
06/01/2006
0.0000
0.0000
PBCPDF
0.0082
[… lines repeat …]
What I wanted to achieve is to delete all instances of PBCPDF except for the first one, which I could write the substitution comman...
I'm trying NERDtree which is pretty cool, but what I'd like to do is execute special commands, or scripts, on the selected file.
For example, I'd like to highlight an image file in the tree, hit some key and have the appropriate XHTML tag inserted in the original file (I have a small script to do the formatting, I just need to run it on...
Is it possible to run an external command and store its output in a register?
:redir works for ex commands, not for external commands (afaik)
:r ! runs the external command but directly inserts output into the
current buffer
...