Tag Info

Hot answers tagged

14

The first place to check is if there's a backport, but there isn't, which isn't surprising since maverick has vim 7.2 too. The next thing to try is if someone's put up a repository with vim 7.3 packages somewhere, preferably a PPA. There are many PPAs with vim, including several with 7.3 (not an exhaustive list). If you don't find a binary package anywhere ...


6

vim has an event you can bind to for this, FocusGained, combine this with the redraw! command (the ! causes the window to be cleared first) :au FocusGained * :redraw! The syntax here can be read as 'automatically run the command (au is short for autocmd) :redraw! when I get the event FocusGained for any file matching the pattern *'. to make this ...


5

First of all, quick naming correction - anything open in Vim is a "buffer". The terminology here is similar to emacs, if you are familiar with that editor. Buffers simply refer to open files in the memory of the current Vim process. To see a list of you buffers, use :ls which shows you a list of the current buffers, numbered in the order that they were ...


4

The colours of vim-powerline should be located in your .vim directory. If you use a plugin manager it may be .vim/bundle/ followed by the vim-powerline/autoload/Powerline/Colorschemes tree. The file you are looking for should be the default.vim. The colour setting you are looking for is : . \ Pl#Hi#Segments(['mode_indicator'], {¬ . . \ 'n': ...


3

The autoread option does not have a timer. A reload is triggered when a shell command is launched or checktime is executed. Furthermore, vim does not have built-in timer functionality, so there's no simple way (meaning without plugins or ugly hacks) to call checktime every n seconds. You can misuse updatetime and events like CursorHold to execute checktime ...


3

In gVim you can select the font, vim depends on the font the terminal provides. And it's the same for colour support. Gvim has full support, vim depends on the terminal. Gvim additionally has menus and a toolbar, which vim lacks. One big advantage of vim is that, since it's a terminal application, you have a full fledged terminal at your fingertips. gVim ...


3

I got all the pieces together to do the trick. The best way is to create a custom mapping for all the commands: map <F8> :let mycurf=expand("<cfile>")<cr><c-w> w :execute("e ".mycurf)<cr><c-w>p Explanation: map <F8> maps on "F8" the commands that follow let mycurf=expand("<cfile>") gets the filename ...


2

I took a vim function written by Jan Larres in the question " How to open or close NERDTree and Tagbar with < leader>\?" and modified it (I only added the wincmd commands)to make my vim look like this: +-----------+-------------+ | Tagbar | file | | contents | | +-----------+ | | NERDTree | | | contents ...


2

gvim returns almost immediately. When sudoedit notices that the editor has returned it will finish reporting no changes. To get sudoedit to work correctly you need to get it to wait until you are finished editing. I normally use -f switch to do this. I have not tried it but the manual seems to support the use of --remote-wait or --remote-wait-silent.


2

Sounds like your Vim is in vi-compatible mode; :set compatible? will print compatible then. You need to create a ~/.vimrc file (empty one will suffice) to switch Vim to nocompatible mode. In general, it's recommended to put your customizations there, and leave .gvimrc for the very few GUI-only settings.


2

Install both and try them both, they use the same configuration etc. so there's no risk. As far as differences are concerned: one is a graphical tool one is a command line tool. So the advantage of vim to gvim is that you can use it easily over an ssh connection. (You can do the same with gvim by tunneling X but that has quite some overhead.


1

There is no option in the gvim doc that allows to do exactly what you want when editing your vimrc file. FYI, options are available here: http://vimdoc.sourceforge.net/htmldoc/autocmd.html#CursorMoved However, you can add the following code to your vimrc file: augroup NO_CURSOR_MOVE_ON_SELECTION au! au MenuPopup * let g:oldmouse=&mouse | set mouse= ...


1

Take a look at this tutorial that shows how to install a custom font in your home directory, in a .fonts directory. The tutorial is titled: installing fonts in your home directory on Fedora 12. Once a custom font has been installed here you can use the pull downs in gvim to change the font or run the command: :set guifont=* Which will bring up the ...


1

It isn't very difficult to install vim in your home directory, and I see that you've found a way. However this is not necessarily the best solution. Running vim on the remote machine has the downsides of running a remote editor: it lags if the connection lags; it dies if the connection dies. You can use (g)vim locally to edit remote files. There are two ...


1

Thanks to this answer http://unix.stackexchange.com/a/61295/32647 it turns out to be simple, like: $ yumdownloader vim-X11 $ rpm2cpio vim-X11-7.2.411-1.8.el6.x86_64.rpm > vim-X11.cpio $ cpio -idv < vim-X11.cpio $ ./usr/bin/gvim It works! Explanation: the first command gets the RPM into the current directory without installing it. The second ...


1

That will be difficult. Both :NERDTreeToggle and :TagbarToggle use :vsplit internally, and there's no way to simply reconfigure or hook into it. You'd have to write wrappers for your \e and <F9> triggers that detect the current window layout, do the toggling, and then jiggle the windows around to fit your requirements. That last step alone is already ...


1

You cannot. However, you can trick pacman into thinking you have (there are two ways to do this). Simply pass the --dbonly option: pacman -S --dbonly ruby This will commit the transaction to the database (make a record of the install), but not actually download or install any packages. If you want, you could also pass --asdeps to mark it as a ...


1

I always set paste to enabled prior to doing this: :set paste Then paste the example code into vim. Paste is typically off by default. See :help paste for more on the implications. To undo the above: :set nopaste I'd check out this StackOverflow Q&A titled: How do you paste with vim without code being commented? for other alternatives to this as ...


1

:'x,.s/$/ / Would add 4 spaces at the end of the lines between mark x and the current line. In visual mode, you can press : which will bring :'<,'> and then add s/$/    / to add 4 spaces to the end of each line in that selection. If you want to add 4 spaces at the right edge of the currently selected visual block, just enter ...


1

You could use a substitute command :%s/m/& / you can add some flags at the end to apply things multiple times to one line (g), or confirm the substitution (c). The % before s will apply changes to the entire file. If you want a block you can do something like :.,+4s/m/& / This will search from the current line (.) down, for the next 4 ...


1

After doing these commands: cd ~/.vim/bundle git clone git://github.com/mattn/calendar-vim You need to add the following line to your $HOME/.vimrc file: Bundle 'calendar-vim' After doing this when I start up vim I get the command: :Calendar Which shows the following in vim. screenshot ...


1

Usually people want it the other way around, using (approximated) colors defined in a GVIM color scheme in the console, too. It all depends on your colorscheme; it provides the attributes (like bold / italic), foreground and background colors for terminals, color terminals, and the GUI. Good color schemes provide similar definitions for all three. You can ...


1

The command should be "gvim --remote-tab file1 [file2 ...]". If no instance of gvim is running, it produces an error message (which you won't see if you're not launching it from a terminal anyway) and does what you say. This command might not work as expected if you open two different gvim windows and then close the first one (instead of opening new tabes ...


1

gvim package shall have all vim coming along. Meaning, if you wish to fall back to vanilla vim you can. Anyway, the biggest difference IMO is that vim depends on the terminal to handle special characters and key-sequences. If you wish to map and exploit things like <c-space>, <m-ins>, ... just forget about it with vim. Of course gvim has menus, ...


1

Did you install the GTK2 '-dev' packages? They're the 'other half'. Most people usually just need the libraries, since the programs are already written and compiled, they just link to the libraries and life is good. But people compiling code need the 'descriptions and pointers' to the library routines, which is contained in the '-dev' packages. I write ...


1

You could look into the Teledactyl add-on for Thunderbird from 5digits.org. They produce a Pentadactyl add-on for firefox which works nicely for controls, although text boxes are admittedly un-vim-ish. Feature-list says it supports external editors, so gvim could be in your future.


1

This happens to me as well. The workaround that I use is to minimize gVim then maximize it again. After that the status bar is visible again. Bug is described here: https://bugs.launchpad.net/ubuntu/+source/vim/+bug/137854 Bug is reported fixed in debian, but the issue is still there with Ubuntu 11.04 (Natty)


1

See :tabnew and :tabedit in :help tabpage. (I'm not sure if you can (or want to) re-map :edit) (Edit There is a related and helpful SO discussion) (Edit to match your refined question) I doubt it will be less hassle than alias gvim=gvim -p, but using autocmd (and some Vimscript, everything in your .vimrc) this might be possible. (But I'm not knowledgeable ...


1

You might try vimoutliner, a vim plugin: http://www.vim.org/scripts/script.php?script_id=3515; I haven't used it myself (don't really use an outliner), but it's easy to install and seems to be to use.



Only top voted, non community-wiki answers of a minimum length are eligible