When for example an edited file is changed outside of Vim, Vim issues a warning and offers to reload the file. In command line Vim a green text on the bottom appears, but in gVim there is a GTK+ popup window instead. I like Vim behaviour more, and I'd like to have it in gVim as well, how can I change that?
There is an option to enable that behavior in the GUI version of Vim. If c
is set in guioptions, console-like dialogs are used instead of graphical
popup ones.
:set guioptions+=c
Related
Sometimes I need to edit a small config file and return to my terminal workflow.
Opening VIM by default will cover the entire screen, just for a small change.
Is there any option to open vim, not in fullscreen?
If not, is there any terminal text editor that can do that?
Unfortunately Vim doesn't provide any way to modify your terminal window. But you can use terminal emulators like Tmux for multi-window support. And don't forget that you can do :vert term in Vim to split your window, but with some limited possibilities
I'm somewhat new to vim and wanted to add some custom fonts.
This is the one I wanted to add: https://github.com/belluzj/fantasque-sans.
How would I tell vim to use this font since it's not part of the default font set.
Do I add this to the .vimrc?
I'm on Mac Catalina by the way.
If you're using vim in the command line: Vim uses the font of your terminal emulator so if you set up your terminal emulator (iTerm2, Terminal.app etc) to use that font it should pick it up automatically.
If you want that font to be used exclusively in vim and you're using gvim you can change the guifont option which is documented on the Vim FAQ:
"You can change the 'guifont' option to change the font used by GUI Vim. To
display the current value of this option, you can use
:set guifont?
You can add the displayed font name to the .vimrc file to use the font
across Vim sessions. For example, add the following line to the .vimrc file
to use Andale Mono font.
set guifont=Andale_Mono:h10:cANSI
For Win32, GTK and Photon version of Vim, you can use the following command
to bringup a dialog which will help you in changing the guifont:
:set guifont=*
You can also use the -font Vim command line option to specify the font used
for normal text."
I installed Vintageous in sublime text 3 so i can use some of vim commands and interactions. But I am using it for a long time, and there is a lot of features missing, like the 'ctrl+x' and 'ctrl+a" to decrease and increase a number, the 'ctrl+r' to redo, the 'ctrl+v' to select vertical blocks, 'ctrl+c' to quit insertion mode ... etc.
I really like sublime text 3, but in the other hand, i'm really missing this commands, it's all of theses commands which makes vim so powerful.
So how can I get a complete vim mode in sublime text 3. It would be just perfect if i can do that (because I really miss vim complete features).
PS : I'm using Ubuntu 15.10 with Linux version > 4.
Vintageous has the setting vintageous_use_ctrl_keys, which should solve most of your issues.In contrast to other packages Vintageous uses the User preferences. Hence you can just add the entry "vintageous_use_ctrl_keys": false to "Preferences >> Settings - User". However for this settings there is an entry in the control palette. Press ctrl+shift+p and write Vintageous: Toggle Vim Ctrl Keys. You can see the other settings here and just change them in the user preferences.
If you are still missing some keys I would recommend to look at the default keymap and search for other packages, which provide this behavior and change the keybinding as you want them.
Now there is a new player, ActualVim plugin.
Everything you like about using Sublime Text 3, and everything you
like about typing in vim.
Actual uses an embedded Neovim instance to accurately manipulate each
Sublime Text buffer as though you were editing the text directly in
vim, without breaking any Sublime Text features (aside from multiple
selection for now).
It’s way better than Vintage mode or Vintageous. You can use your own .vimrc, plugins, real vim motions and commands.
To get vim shortcuts in Sublime Text
Install neovim (the actual program which is unrelated to sublime text - it's necessary for this approach to work). Example brew install neovim.
In sublime, press command + shift + p, type "install package" and click on the top result.
Now search for 'ActualVim', and click on it, it should install.
Close and reopen sublime.
Vim shortcuts now work!
<F11> makes it full screen in ubuntu (I changed the settings and chose show the menus for a window In the window's title bar rather than in the menu bar) and hides the global menu panel (at the top with the battery and wifi symbols). I didn't want to press <F11> every single time I opened gvim so what do I have to write in .vimrc for this?
The mappings and Vimscript commands that you can put into your ~/.vimrc are only for scripting Vim itself; you cannot directly control your environment with it. The only way is through launching an external command (via :! or :call system(...), for example wmctrl with the right arguments. Alternatively, you could modify the shortcut / command that launches GVIM to include this maximization, so you don't need to "break out" from inside Vim.
I'm using the :Fullscreen command of the shell.vim - Improved integration between Vim and its environment plugin; it works well on Windows and Gnome. You can launch that automatically by putting Fullscreen into your ~/.gvimrc.
i use vim to edit different filetypes.
it seems vim can load the filetype plugin correctly, for different filetypes the highlight, indent and comment are all working well.
but the menubar seems not working.
eg. i installed vim-latex, therefore after i open a .tex file, the menu-bar has all the menus Tex-suite, Tex-enviroment, Tex-Math, etc.
but when i switch back to a .py file, these menus are still there... and even the keymap for .tex file compling is still there. when i type <leader>ll, vim still compiles the .tex file in previous buffer...
How should i reset vim menus (and the keymaps) when a different filetype is loaded?
thanks!
I didn't know vim-latex before, but it looks like a powerful suite that totally takes over Vim, and currently does not support undoing its massive customizations once it's been loaded.
You can get rid of the menu via
:aunmenu TeX-Suite
and likewise remove the mapping via
:nunmap <buffer> <Leader>ll
But I guess simply quitting Vim and re-launching it is the easiest, pragmatic solution.
Of course, you can file enhancement requests against the project, but I guess this is not high on their agenda, and some people may find the toggling of the menu when switching buffers more annoying than the lingering menu.