January 21st, 2011 § § permalink
Make Vim more IDE-like by assigning
F5 to save and run your current script. Just add this to your
map <F5> <Esc>:w<CR>:!%:p<CR>
This maps the F5 key to run two things:
:w, which saves your file, and
:!%:p, which will run your current script (
! runs a shell command and
%:p expands to the path of your current file).
A test example
echo "#!/bin/bash" > test.sh
echo "echo hello world" >> test.sh
chmod +x test.sh
F5 while in Vim will save test.sh and run the file in Vim’s internal shell. Just press enter when the script is done to return to Vim.
code based on discussion at stackoverflow
August 20th, 2008 § § permalink
<strong>\c</strong>” anywhere in a search to ignore case (overriding your ignorecase or smartcase settings).
<strong>/\cfoo</strong>” or “
<strong>/foo\c</strong>” will match foo, Foo, fOO, FOO, etc.
<strong>\C</strong>” anywhere in a search to force case matching.
<strong>/\Cfoo</strong>” or “
<strong>/foo\C</strong>” will only match foo.
You can set vim to ignore case on all your searches by running “
<strong>ignorecase</strong>” is on, you can vim to ignore case on searches of only lowercase letters by running “
<strong>:set smartcase</strong>”. (Searches with any capitalization or with “
<strong>\C</strong>” will run a case-sensitive search.)
<strong>:help ignorecase</strong> and