Potentially 2 questions in one. I would like to know how to reference a register in Ex mode.
For instance, I'm editing a file and I want to save the file with a timestamp (or just datestamp really) appended to it.
I know I can set register to the value of a shell commands output using:
:let @a = system("date +\"%Y-%m-%d\"")
Is ther...
Is it possible to fold C preprocessor in VIM. For example:
#if defined(DEBUG)
//some block of code
myfunction();
#endif
I want to fold it so that it becomes:
+-- 4 lines: #if defined(DEBUG)---
...
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...
I want to use gvim to launch make and do the build for my code. Since the build process takes some time i want it to be silently executed and then in the end errors/build log be showed to me.
i have added this to my .vimrc
:command -nargs=* Make silent make <args> | cwindow 10
map <c-b> <c-o>:Make<cr>
So when i press Ctrl-b it start...
Hi,
I've just started using the NERDTree vim plugin for my project.
I can't find the documentation for switching between opened tabs. Can anyone tell me the shortcut key[s] ?
Thanks...
...
Hi Everyone,
I am using FuzzyFinder with vim to open files and switch between buffers. It works like a charm except when the current file I am working on has some changes. Vim wouldn't let me switch the buffer till I save it:
"E37: No write since last change (add ! to override)".
Is there a way of suppressing this warning unless I am ...
I love VI and I'm looking for a plugin of some sort that would allow me to input text in my browser (preferably Firefox or Chrome) using VI commands. It would save me an immense amount of time and at the same time when writing long emails. Can anyone think of any plugins that would allow me to do this? I was hopeful with Vimperator (h...
Note: marked as community wiki
I code in vim.
I use git; and love git grep.
Does anyone have a particularly nice set of techniques / scripts for using git grep in side of vim?
Readers: please upvote answers involving vim + git grep; please downvote answers involving non-vim editors, and editors referring to external tools besides git...
Is there any utility or plugin which provides cscope like functionality for C++. I am looking for
all references to a symbol
global definitions
functions called by a function
functions calling a function
files including a file
...
I am using vim 7.x
I am using alternate file.
I have a mapping of *.hpp <--> *.cpp
Suppose I'm in
class Foo {
void some_me#mber_func(); // # = my cursor
}
in Foo.hpp
is there a way to tell vim to do the following:
Grab word under # (easy, expand("")
Look up the class I'm inside of ("Foo") <-- I have no idea how to do this
Ap...
You can set the Vim color scheme by issuing
:colorscheme SCHEME_NAME
but, oddly enough, you can't get the currently used scheme by issuing
:colorscheme
as this results in "E471: Argument required". I also don't see the color scheme listed in the output of :set.
So how do you go about figuring out the current color scheme in use (o...
I would like to jump to a tag (function) in the current active buffer with completion search like FuzzyFinder's functionality. The FufTag function from FuzzyFinder lists all the tags in the project and I only want the tags from the current active buffer. Is there a way to set up FuzzyFinder to do both or is there another plugin that doe...
I'm having trouble reading dark blue on black when I turn on syntax colours in vim.
How do I change some of the default colours or the colours of schemas like:
http://www.vim.org/scripts/script.php?script_id=1571
...
I want to add a shortcut like I type :open_my_document, it become :e /var/book/document.txt.
how to?
...
I have installed Vim and MinGW on my machine, so I try to create Hello World then compile in in Vim and everything work fine. However when I type :make it show error 'make' not recognized as an internal or external command.
I already added variable path to C:\MinGW\bin. I want to know how to configure Vim or my machine to allow make com...
I want to know how do you manage your vim plugins.
As it is,
One of the biggest fun of using is that one can easily try many interesing new plugins, just download it and unzip it in under ~/.vim. But if you try too often and try too much, you might get trouble as confilct of key mapping , in compatitble script version, dpendency betwee...
I have defined a function in vim to properly indent folds. Ie so they look like this:
Unfolded
this is text
also text
indented text
indented text
not indented text
folded with default function
this is text
also text
+-- 2 lines: indented text ----------------------------
not indented text
folded with my new function
th...
I'd like to be able to run a command that opens up a git diff in vim, with a tab for each file in the diff set.
So if for example I've changed files foo.txt and bar.txt in my working tree and I ran the command I would see vim open with two tabs. The first tab would contain a side-by-side diff between foo.txt in my working tree and foo....
I'm a recent vim convert (from fancy IDEs like eclipse.)
I love the :make command in vim and use it extensively; however I also like to edit multiple projects (with separate makefiles.)
So usually to edit more than one project I will do
pushd project1
vim project1.cpp
[suspend signal]
pushd ../project2
vim project2.cpp
and now I ca...
I added following line of code in .vimrc
let g:jslint_status = 'enabled'
if exists("jslint_status")
echo jstlint_status
else
echo 'not found'
endif
Error message
E121: Undefined variable: jstlint_status
E15: Invalid expression: jstlint_status
What am I doing wrong?
...