LaTeX editors with VIM like commands - vim

I have recently grown fond of VIM for simple scripts now that I know how to use it a little bit. (thanks VIM adventures!!!)
Is there a LaTeX editor out there with vim-like commands? Having the toolbar of Winedt with the VIM commands to move around the text and replace/substitute things would be great.

There is vim-latex which adds LaTeX support to Vim, if that is what you are looking for.
I recommend installing it using Vundle.

Related

Is there a Vim "training wheels" plugin for displaying available shortcuts similar to nano

I'm a long time user of GUI IDEs like PhpStorm but I see the value in learning a CLI editor like Vim for when tapping into remote servers. I'm learning commands on a need-to-know basis, but I'd like to see common possible keystrokes similar to how the Nano editor does it at the bottom. Is there a Vim plugin to display shortcuts at the bottom of the screen (or something similar)?
In absence of a plugin that does exactly what you want, you can still do:
:h index

MacVim and Latex: How to quickly compile and preview?

The latex package provides MacVim with menu items to compile and preview.
I'd like to execute these functions via keypress, perhaps with \ + something
How to do this?
try automatic latex plugin - http://atp-vim.sourceforge.net/
add to your .vimrc
set localleader = "\\"
then compilation is \l and you can view the result with <f3>, and read the documentation
:help atp
Light-weight alternative: TeX-PDF.
I really enjoy using LaTeX Box when writing LaTeX in vim. It includes many handy tools, like background compilation, a table of contents for navigation, and useful key-maps for autocompletion and navigation. I certainly think its worth the (short amount) of time to learn if you are going to be using vim for LaTeX.

Can you tell me the relationships and differences between Vi and Vim

I often see Vim in my lab, but I also know Vi, but I never have a chance to use it, I search for it by using google, but I can't get a website to download Vi. Can you show me the relationships and differences between Vi and Vim, if possible, give me a url to download the Vi. Thanks!
Despite what others have said, Vim is not an enhanced version of Vi, nor is it an extension. It might seem that way because Vim was designed to be, by default, as compatible with Vi as possible (even more so in Vi-compatible mode). Obtaining Vi source code used to required a Unix source code license, and since additional features were desired, Vim was developed independently of Vi. It is more properly called a clone, which has additional features.
Vim is the standard editor on many *nix systems. The "program" vi is often just a symlink to vim. Historical interests aside, I can't think of a compelling argument for using Vi. Vim is much more modern, and any features you don't want can be disabled, or support for them not compiled in.
You can download the source for vi here: http://ex-vi.sourceforge.net/
Vim is an enhanced version of Vi with extra features. If you know how to use Vi, you won't have trouble using Vim, since you know the basics. Sometimes people used to Vim have trouble with Vi as it doesn't have all the extra features as Vim.
Vim has an option called compatible that makes vim behave nearly exactly like vi. See :help 'compatible for more information.
VIM is Vi iMproved. VIM is basically an extension of Vi. I would learn VIM not Vi as it just gets too hard for many things. The advantage is if you can use Vim you can use Vi, just the extra snazzy stuff like syntax highlighting etc will be missing.
See wikipedia for more details on the history of the two: http://en.wikipedia.org/wiki/Vi & http://en.wikipedia.org/wiki/Vim_(text_editor)
Here is a good guide to Vi including how to install for your distro: http://www.yolinux.com/TUTORIALS/LinuxTutorialAdvanced_vi.html

Autocompletion in Vim

I'm having trouble with autocompletion. How can I get a code suggestion while I'm typing?
I usually develop in PHP, Ruby, HTML, C and CSS.
Use Ctrl-N to get a list of word suggestions while in insert mode. Type :help i_CTRL-N to see Vim's documentation on this functionality.
Here is an example of importing the Python dictionary into Vim.
You can use a plugin like AutoComplPop to get automatic code completion as you type.
2015 Edit: I personally use YouCompleteMe now.
If you are using VIM version 8+, just type Ctrl + n or Ctrl + p.
You can start from built-in omnifunc setting.
Just put:
filetype plugin on
au FileType php setl ofu=phpcomplete#CompletePHP
au FileType ruby,eruby setl ofu=rubycomplete#Complete
au FileType html,xhtml setl ofu=htmlcomplete#CompleteTags
au FileType c setl ofu=ccomplete#CompleteCpp
au FileType css setl ofu=csscomplete#CompleteCSS
on the bottom of your .vimrc, then type <Ctrl-X><Ctrl-O> in insert mode.
I always rely on this CSS completion.
There is also https://github.com/Valloric/YouCompleteMe and it includes things like Jedi and also has fuzzy match. So far I found YCM to be the fastest among what I have tried.
Edit: There also exists some new ones like https://github.com/maralla/completor.vim
Another option is coc.nvim.
It's really fast and the completion is great as it uses intellisense the same autocompletion as VScode has.
It also has linting capabilities. So it shows you were you might have a bug.
It supports a multitude of languages.
It might take a bit to set up and configure but I think it is the best autocompletion engine for vim out there.
I've used neocomplcache for about half a year. It is a plugin that collects a cache of words in all your buffers and then provides them for you to auto-complete with.
There is an array of screenshots on the project page in the previous link. Neocomplcache also has a ton of configuration options, of which there are basic examples on the project page as well.
If you need more depth, you can look at the relevant section in my vimrc - just search for the word neocomplcache.
Here is link! for PHP.
press the Ctrl + x followed by Ctrl + o keys while writing some PHP functions.
Thanks to Oseems Solutions for the tutorial
If you only wanna auto-completion from cache of your current buffers, supertab is easier to install than neocomplete, can work on Mac pre-installed vim out of box without the need of MacVim.
You can check other alternatives at vim awesome.
For PHP, Padawan with Deoplete are great solutions for having a robust PHP autocompletion in Neovim. I tried a lot of things and Padawan work like a charm!
For Vim you can use Neocomplete instead of Deoplete.
I wrote an article how to make a Vim PHP IDE if somebody is interested. Of course Padawan is part of it.
I recently discovered a project called OniVim, which is an electron-based front-end for NeoVim that comes with very nice autocomplete for several languages out of the box, and since it's basically just a wrapper around NeoVim, you have the full power of vim at your disposal if the GUI doesn't meet your needs. It's still in early development, but it is rapidly improving and there is a really active community around it. I have been using vim for over 10 years and started giving Oni a test drive a few weeks ago, and while it does have some bugs here and there it hasn't gotten in my way. I would strongly recommend it to new vim users who are still getting their vim-fingers!
OniVim: https://www.onivim.io/

How to make color settings look the same in vim as in gvim

When I put the following in .vimrc
colorscheme blue
It gives me a nice blue colorscheme in gvim. However, when I use vim, it is light blue instead. Is there a setting I can change so that gvim and vim look the same? If not, then is there a way I can set it up so that my gvim settings do not interfere with my vim settings?
As well as John's suggestion of using .gvimrc, there are a couple of other interesting alternatives:
If your command-line vim is compiled with +gui (:echo has("gui"))* and you have a 256 colour capable terminal, you can use the CSApprox plugin to convert the GUI colour scheme into a matching command line one.
If your command-line vim doesn't have +gui, you could try (I haven't used this one) the guicolorscheme plugin. The guicolorscheme plugin parses the colour scheme file, so it isn't as robust as the CSApprox one (it almost certainly won't work with my colour scheme for example.
There's a lot more information on both of those methods here and here.
* Regarding has("gui"):
If you're not interested in +gui, stop reading now!
Personally, I'd recommend this as it simplifies things a bit - you get the opportunity to type :gui if you want to change from terminal to GUI and as you inevitably have +X11 and +xterm_clipboard as well, you can copy to the X clipboards from console vim. If your vim doesn't have +gui, the easiest way to fix it is to create a link in your personal bin directory to the GUI executable:
ln `which gvim` ~/bin/vim
GVim will quite happily work as a console vim if the executable name is vim. A "default" build from the vim source with GUI enabled will create one executable (vim) and lots of links to that executable like gvim, gview, view, vimdiff etc. Most Linux distributions seem to compile them separately though, in order to minimise requirements of the basic Vim (so you can use vim without installing X). As such, I tend to recompile and install in /usr/local with the features I want as I always have X installed (it doesn't have to be running, just installed).
set your vim settings in the .vimrc file, and set the gvim settings in the .gvimrc settings file.
Just pick a different colorscheme in the .gvimrc...
If you are using a modern terminal which support 88 or 256 colors(most of them do like gnome-terminal or roxterm(on linux) not sure about Mac or Windows) , you should check out this vim script CSApprox(http://www.vim.org/scripts/script.php?script_id=2390). This scripts make the color schemes made for gvim, work with terminal vim.

Resources