I'm trying to make GUI specific settings in my .gvimrc.
How can I detect the GUI (gtk3, gnome, macvim, etc.) that vim is using?
Call has() to test if one of the GUI exists: if has("gui_gnome"), if has("gui_win32"), etc.
Related
I'm starting to develop a fairly large app and am beginning to want some of the IDE features I've used in the past, such as 'right-click->go to definition' of a function. Does any kind of parallel in developing on the command line exist? This is on an Ubuntu Desktop VM. Is recommended to move to using Sublime?
It depends on your preferred editor, but options definitely exist.
I've used c-tags for vim.
Similar options must exist for emacs; a quick search turned this up.
In my experience though, nothing beats a full-fledged IDE (more full-fledged than Sublime, even) for these kinds of introspective utilities.
If you're using VIM, check VIM Taglist plugin. It has a command that takes you to a ctag definition.
You can create a VIM keymap to go to the word/function under the cursor which would solve your problem.
I've been using pyclewn for debugging in vim. It works quite well on gvim with ballooneval to show the values of variables but the problem is I'm mostly using vim in a terminal so that I can't use the balloon feature.
I have found this but it looks abondoned already and I couldn't make it work as there's no installation instructions. Does anyone know a way to use ballooneval in terminal vim?
From documentation:
m +balloon_eval balloon-eval support. Included when compiling with
supported GUI (Motif, GTK, GUI) and either
Netbeans/Sun Workshop integration or +eval feature.
It's not quite clear though, whether this imply that terminal mode does not support ballooneval at all (or it's available in terminal mode when GUI is compiled in), but there's no clues to do that in the documentation.
So: it's highly unlikely that you can use ballooneval in the terminal mode without messing with the Vim sources.
Starting from Vim version 8.0.1309 there is support for balloon in terminal. Seems to be work in progress though.
You can find a usage example in the following issue:
https://github.com/vim/vim/issues/2481
When I use MacVim, all the color schemes work and looks very rich in the window.
But when I fire up my Terminal and use Vi inside it, the color schemes look very very bad. Is there any setting/config I should set to let Terminal Vi use all the colors available by a color scheme.
Update: I use
MacOSX Lion
Terminal v2.2 with xterm-color
Vim 7.3
Thanks
You probably can't do this. It's not Vim's fault, it's your terminal's fault. The GUI has access to millions of colours and terminals generally have access to 256 (or much less, depending on your terminal). It just doesn't have the guts to show the same colours as the GUI version. That's also why all of the colour schemes for Vim have values for the GUI (e.g. guibg) and values for the terminal (e.g ctermbg). There's a GUI value for the powerful side, and a terminal value for the weak side.
This is one of the reasons why I only use the GUI version. You can easily marry the command line with Vim so that using a single GUI version is much easier. You can check out a video on how to do this at vimeo and I recently created a plugin for ZSH that makes it even easier, which you can get from Github
If configure your .vimrc with the command
set t_Co=256
you are configuring vim to allow colorschemes that use 256 colors. Maybe MacVim uses this configuration by default.
I'd advise trying CSApprox
On OS X especially you can get very good results for console Vim.
I use it on OS X, Debian & Fedora with good results for console Vim & Matt who wrote the plugin, is a very helpful guy & will do his best to get the best results possible for you if you run into problems.
I have a gVIM script that parses current buffer and offers user to select one of multiple choices. It is implemented as console input, but since i'm using graphical version of gVIM, maybe it's possible to use graphical version of multiple choice dialog? I have tried to use python + Tkinter but it's very unstable and is not working on some NIX boxes :(. Any ideas?
GVim has, in its functions and settings, nothing that would enable showing GUI elements (with a few noble exceptions, like closing dialog and such.).
That being said, GVim is open source, and nothing stops you from downloading the source and messing with it.
After some research i have found a solution. VIM supports so-called "clientserver" mode and external application can send a command to it. So this task (and many others) can be solved with following technique (tested on Windows, OSX and Ubuntu):
VIMscript that handles a command launches standalone GUI script in
separate process and returns.
Standalone GUI script (python/ruby/.exe/whatever) displays GUI and
waits for user interaction.
After user interaction, standalone GUI script closes it's window,
communicates back to VIM via "clientserver" interface (call another
script, open file, move cursor etc) and exits.
Is there any good linux terminal emulator that supports plugins?
What I am after:
Open source
Being able to highlight and color text fragments
Being able to tweak the GUI (create popup windows, present menus and buttons integrated with the text display -- for instance to open the man page in a floating window when clicking on a command name)
Being able to write plugins in a number of languages (Ruby preferred)
Cheers!
All that I found:
termit - extensible via lua
rxvt-unicode - extensible via perl