Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor.
1
vote
2answers
9 views
Relative paths in .vimrc
I'd like to add something like
let coffee_compiler = '~/repos/coffee-script/bin/coffee'
to my .vimrc, but vim won't expand the ~ (obviously since it's not my shell).
How can I make this work ...
0
votes
1answer
24 views
why python vim module gives different result on ms windows and ubuntu?
On windows xp and vim 7.3.1105 (Yongwei's build):
:tabnew
:py import vim
:py print(type(vim.current.buffer.name))
<type 'str'> -- THIS
on ubuntu and vim 7.3.1020 (my own build):
:tabnew
:py ...
0
votes
1answer
23 views
Change keyboard layout for Vim's command mode to English
Alright, this drives me crazy. I'm using gvim and it defaults to using a Swedish keyboard layout. Is there some way of changing that to an English one? I don't have access to setxkbmap on this system, ...
0
votes
0answers
18 views
How to disable alternate buffer in GNU screen itself but not for vim, less inside it?
What I would like to accomplish is mouse wheel scrolling behavior that I'm used to in a regular ssh session. In bash prompt mouse wheel should scroll my terminal output, and inside less/vim - the ...
1
vote
2answers
34 views
vim : delete from cursor to _
in some case I have name of variables with a _ like hello_world.
in vim, in normal mode, with dw, I can delete from cursor position to end of word.
How I can delete from current cursor position to - ...
1
vote
1answer
64 views
How to load plugins on the fly?
A partner and I are maintaining Vimified, a Vim configuration project, using Vundle.
With the time going, the configuration file is growing as we try to propose best configurations for more and more ...
0
votes
1answer
35 views
Select vimenter autocmd's to run based on args
I'm trying to reduce the number of things I need to do when I open VIM. I have the three following scenarios that I'd like to account for:
1. Open vim with a directory specified
vim .
For this ...
1
vote
1answer
40 views
VIM: Yank multiple non-continous chunks of text into a registers
I have some lines of text that follow a pattern and some that don't. I'd like to copy the lines that follow this pattern and then copy/yank them into a register so that I can paste them as is ...
-5
votes
0answers
40 views
Command line based softwares [closed]
What are some of the most extinsively used Shell/Command-Line based software, that are still used a lot today.
Few examples would be FFMPEG and VIM.
Can anyone list out a few others?
2
votes
0answers
30 views
gvim in windows, need to preserve or correct path casing (e.g., c:\windows vs. C:\Windows)
I use gvim in a windows environment and have ClearCase for source control.
My problem is that windows paths aren't case-sensitive, however, ClearCase enforces case sensitivity. So, when editing a ...
0
votes
0answers
18 views
Vim running with a python interface error: can't load library libpython
Error when :py print 1: Could not load library libpython2.7.a
I tried to compile vim on ubuntu 12.04 with both python2 and python3 supports. (I also compiled and installed python by myself.). I ...
0
votes
0answers
27 views
Vim format python using formatexpr/prg (gq) gives incorrect result
I am having trouble with Python's interaction with comments. These can be divided into two issues. I expect they're related, so I'll post them both here.
Issue 1.
When using gq to automatically wrap ...
13
votes
4answers
310 views
Inserting a blank line in vim?
I quite often find I have a need to insert a blank line either below or above the current line when editing in vim. o and O will do this, but they subsequently switch into insert mode, which is ...
1
vote
2answers
40 views
vim submatch - trying to put quotes around a string
I'm trying to use the vim submatch command to put quotes around all strings of characters in a line of text, and it doesnt work. Here's what I'm doing
:s:\a*\a:\(submatch(0)\):g
All it does is ...
0
votes
1answer
29 views
Page up/down without moving cursor (looking for opposite of ^e)
Randomly while working I found the command ^e which allowed me to page down without the cursor moving off its current line. I'm wondering what the opposite is for paging up.
Its really helpful when ...
1
vote
1answer
28 views
How to make vim recover files from command line?
If it were linux, I'd do it like this:
echo "w DST_FILE | q" | vim -Esu NONE -r SWP_FILE
I'm trying to do the same under windows with git's bash, but with no result. It hangs and doesn't create ...
1
vote
1answer
27 views
gvim view script output in realtime in quickfix window
I'm using gvim in a windows environment and have some custom scripts that I use to build with. Currently, all of my build output redirected to a new tab, but I have to wait for my build to finish ...
1
vote
1answer
47 views
Diff the undo command
Is there any simple way to see a diff between the current state of the file and the state that it would be if I were to u once? Sometimes I would like to see what the last change was (especially when ...
0
votes
1answer
23 views
unclear as to what submatch does in vim
Im unclear as to what the submatch({nr}) expression in vim does. The manual says the following:
submatch({nr}) *submatch()*
Only for an expression in a |:substitute| command. ...
0
votes
2answers
31 views
Vim (non-gui) background will not go White
I am trying to set-up a simple vim colorscheme, which is black text on white background.
How do I make the background go White?
Based on bw.vim, however I am having a problem getting the background ...
2
votes
1answer
35 views
Vim filename autocomplete exclude files
When opening another file in my project using :e path/to/filTAB, vim will auto-complete the filename with all matching files, in alphabetical order. However, my project is full of .coffee, .litcoffee, ...
0
votes
2answers
25 views
Vim file name completion relative to current file
In Vim, when I am in insert mode, and I want to use file-name completion, I want the search path to be relative to the current file, not the current working directory. For instance, if in insert mode ...
0
votes
2answers
42 views
vim - open files containing a specific string in new tabs
I am looking for a way to open all files that contain a specific string in new vim tabs.
The files are not in a specific directory, but scattered across a directory tree.
Ideally I want to jump to ...
1
vote
2answers
31 views
How do I run Windows vim from a function within my .bashrc?
I have installed windows vim and added the following function to my .bashrc:
function winvim() {
local win_vim_path='/cygdrive/c/Program\ Files\ \(x86\)/Vim/vim73/vim.exe'
#local ...
0
votes
0answers
56 views
How do I get correct arrow key behaviour for cygwin vim in Console2?
I've set the shell variable in Console2 to:
C:\cygwin\bin\bash.exe --login -i
I then launch vim. When I do so two problems happen
While in normal mode if I press an arrow key once nothing happens. ...
0
votes
0answers
21 views
Home and End keys don't work work in Cygwin Vim editor when $TERM=linux
I have the latest Cygwin installed on a Windows 7 PC. When using the Vim editor, my Home and End keys don't work when $TERM=linux. If I change to $TERM=xterm, these keys work OK.
When $TERM=linux ...
2
votes
1answer
29 views
Set imap depending on filetype
I'm using the xml and omnicppcompl plugins for Vim, and making use of two insert mappings these plugins define for the '>' key. My problem is that while the omnicppcompl plugin will happily imap the ...
0
votes
0answers
38 views
Vim: Custom Shortcut for Select all and Copy
I want to map a vim keyboard shortcut in .vimrc that copies all lines in a file to a shortcut key. I've tried various forms of let and map, but they don't recognize the actual copy command. I've ...
0
votes
1answer
46 views
Remapping all OSX shortcuts from cmd to ctrl
I am new to OSX, and since I have mapped CTRL to CapsLock, and use alt a lot, I dont need CMD,
how to remap all shortcuts globally not to use CMD?
3
votes
1answer
156 views
how do I go from typing `/foo` to `:%s/foo/bar` efficiently
In vim, I typed /foo Enter and found some matches.
Now I want to replace all instances of foo with bar (i.e. :%s/foo/bar).
Can this be done without retyping the foo? (e.g. into the command line ...
0
votes
3answers
54 views
Vim Search and Replace
I have a file that contains a SQL statement that looks like this that I paste in from some code. Can someone tell me the search/replace command for changing the + " values to blank or null?
I've ...
0
votes
0answers
26 views
vim not finding the end of the sql statement
In gvim if I put the cursor (normal mode) in the word SELECT and then hit \se then it runs ok:
SELECT GETDATE();
If I do exactly the same but for a query over two lines then it errors.
SELECT
...
1
vote
2answers
39 views
Set paste on git commit
When performing git commit, VIM opens to edit the commit message. I would like VIM to already be in paste mode when this happens. What environment checks might I be able to perform in Autocommands to ...
-3
votes
1answer
63 views
How do you avoid mouse use entirely? [closed]
Avoiding the use of the mouse entirely is hard today, as most OSes, browsers and software in general are very GUI-oriented. What system, software and general tricks are you using to completely avoid ...
0
votes
1answer
26 views
vim search for strings in bracket
I have bunch of strings like this:
[some_strings_in_square_bracket]$ some_strings_not_in ..
[some_strings_in_square_bracket]$ some_strings_not_in ..
[some_strings_in_square_bracket]$ ...
1
vote
2answers
30 views
Vim indentation mapping: how to insert a line break that indents up the column I was at?
In Vim, I want to bind a key which will insert a newline and indent that newline up to the column where the cursor used to be. It's a little strange, so let me illustrate:
Example: before and after, ...
1
vote
1answer
36 views
horizontal mouse scrolling in vim
According to the vim help, e.g. :h <ScrollWheelLeft>, vim recognizes mouse wheel left and mouse wheel right "keys", for scrolling unwrapped buffers left and right. This is good as I have a mouse ...
1
vote
2answers
38 views
Increase the space between lines in vim
I think the title says it all. I've done my homework and the only command that I found was:
:set linespace=3
but it doesn't seem to work, neither on the Mac nor in Linux.
Edit: In Mac OSX you can ...
0
votes
1answer
49 views
Call function in .vimrc from abbreviation in .vim/after/ftplugin/php.vim
I have a VIM function in .vimrc that is called by a few abbreviations. I would like to move those abbreviations to PHP-specific, C-specific, and a few other file-type specific files, but they no ...
0
votes
1answer
34 views
Vim-CtrlP Is it possible to set ctrlp_cache_dir to project root?
In the docs there is this example:
Set the directory to store the cache files:
let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp'
but part of the plugin's power is that it can detect a .git folder in ...
0
votes
1answer
36 views
vim set default to save buffer when TERM signal received
I use multiple instances of vim. Currently I use a bash function
kv(){ a=($(pgrep vim)); kill ${a[@]}; }
to terminate all running instances of vim. This has the drawback of leaving unsettled ...
0
votes
0answers
35 views
Can FIGNORE be limited to specific applications?
I know that you can use FIGNORE to remove filename completion from suffixes.
For example, to avoid a lot of garbage files produced by LaTeX, I've been using:
...
-3
votes
1answer
72 views
Do vim users type vim to start the command? [closed]
What is the standard practice?
Typing vim to start the command or its common alias vi?
1
vote
1answer
38 views
How to edit UTF-8 files in vim on windows
I'm trying to edit UTF-8 text files using vim (7.3) on windows (prompt/powershell).
My _vimrc file is pretty simple:
set encoding=latin-1
set fileencoding=utf-8
The problem is, when editing a ...
1
vote
1answer
33 views
Adjust the other end of a visual selection
I think this would allow for the visual selection feature of vim to surpass the efficiency even of the mouse by providing an ability to "switch" the current terminus of the selection:
Illustrated ...
0
votes
2answers
40 views
emacs mimics for some of the most usable vim command
i've found emacs extremely powerful and vim very convenient in navigation
but i am not so adapted to vim's model editing idea.
so i sticked to emacs
but i still want to mimic some of the navigation ...
1
vote
2answers
32 views
How to adjust the command prompt window size in Vim?
Recently I've run into this problem: the bottom buffer that normally used only for displaying command prompt has become larger than normal. It only happens when I'm using a combination of quickfix ...
0
votes
1answer
51 views
Does anyone know a good tiling window manager that uses vim bindings? [closed]
Like it says in the question, I'm looking for a window manager that uses Vim bindings, I've tried StumpWM but since it's based around EMACS bindings I find its learning curve to be a bit steep...
Any ...
56
votes
15answers
5k views
Why arrow keys are not recommended in Vim
"Never use arrow keys in Vim!"
I heard this from a random speaker, but didn't have the chance to ask him why. Also, if you don't use the arrow keys, how can you move the cursor in the Insert ...
1
vote
1answer
41 views
How can I prevent Supertab to try completion even if I just want to enter a tab?
Even when I have an empty buffer in vim, supertab tries to do a completion at the begining. How can I configure supertab to only try tab-completion if there's a character?



