The information contained within this article is not necessarily wrong, but please note that I wrote an update to this article in September While Tim Pope is still probably the most prolific and well-known author of widely used vim plugins, Shougo is way up there along with him.

Why am I talking about Shougo? Pair it up with Tern for Vim and you get some really nifty functionality along with classic autocompletion, asynchronous-style. Take the screenshot above as a very simple example. Talk about really hard stuff? It might save you some time and give me some exposure - everybody wins! Some of you may be wondering what tern-for-vim is about though. You should use one of the many plugin managers to install the plugins.

Note the npm install line there. The reason is that Tern actually spins up a NodeJS server to analyze your code on the fly.

By the way, to install plugins using vim-plug, source your config files and simply run :PlugInstall. Later on, run :PlugClean to get rid of deleted plugins, :PlugUpdate to update your installed ones and :PlugUpgrade to update vim-plug itself.

Run :help deoplete to get the manual for the plugin in case you want to look up how to do things differently.

Also, I recommend splitting up your. Lines enable deoplete at startup and make sure the autocompletion will actually trigger using the omnifuncs set later on. The commented line 5 would actually disable auto completion, forcing me to press the trigger to see the autocomplete possibilities.

Line 6 is for automatically closing the scratch window at the top of the vim window on finishing a complete or leaving insert. Now for setting some local omnifunc settings.

Of course this depends on what you have installed if anything. The last lines under " tern set the omnifunc for JavaScript to tern Completewhich enables tern and makes it fall back to whatever you have set otherwise in my case set on line 6 here. As for the settings on line 13 and 14, check the tern manual :help tern for more information. There are actually many more things you can do and I have not spent a lot of time there myself, so I may end up writing another post later about other features of this plugin.

Also note that I wrapped the tern settings in an if-statement. This way I can just copy the config over without it breaking my setup. But either way, if you followed this, you should have deoplete and tern-for-vim working quite nicely and speedily together.

Why Deoplete and tern-for-vim? Initializing Deoplete and tern-for-vim You should use one of the many plugin managers to install the plugins. Installing is a breeze with a manager like vim-plug: init. I have been to the mountain top: making code beautiful. Please enable JavaScript to view the comments powered by Disqus.It's been a while since I wrote about my Neovim setup. Since my last post, my nvim config has grown to be a little more sophisticated, and I finally worked out autocompletion and linting for all of the languages I work with.

I have posted my full neovim configuration on Github. I had a horribly long init. It gets clunky to manage and long files are ugly.

Set up for C++/C Development in Neovim

It's highly recommended that you split up your init. The way you can do this is by sourcing each chunk in your main init. Suppose we have a file for our deoplete settings, and another file for our language client settings. Our init. I personally have my config files split up in the following manner:. Credit: Thanks to Igor Epstein for pointing out I can use a regex to grab multiple files in a directory and clean up my init. Note that I had to put the plugins.

The order that you put these scripts in does matter, as they effectively will be set up in order. Everything in plugins. People have different preferences, I have no strong feelings one way or the other. I personally use deinwhich has served me pretty well. My plugins. Note that it doesn't automatically update plugins by default. I manually update my plugins.

You can just call :call dein update in Neovim, and dein will upgrade all of your plugins for you. I used to use deoplete for my autocompletion needs. I ended up switching to ncm2 because I wanted to try out something new. So far, I've had an identical experience with both engines, so I think you will be fine regardless of which language client you use.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.

Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. I've been trying to get autocomplete working for GoLang in NeoVim. When searching, I got brought to deoplete. I'm using dein. I've done a lot of searching around the various github issues and haven't had any luck yet. To recap, the issue is that I can't seem to get the deoplete NeoVim plugin to autocomplete. Maybe I have a misunderstanding of how this is suppose to work. Anzel provided a good answer here.

For example pip3 install neovim. To try to clear the question up, I was attempting to get neovim to use autocomplete via the deoplete plugin.

Configuring the deoplete asynchronous keyword completion plugin with tern-for-vim

This wasn't working auto complete wasn't being recommended in real time even though the option was specified because the Python interface that was required, wasn't installed. After the python interface was installed, a simple. Learn more. Can't get deoplete to start in NeoVim Ask Question. Asked 4 years, 5 months ago. Active 4 years, 5 months ago.

Viewed 2k times. You'll have higher chance of getting an answer if you describe what you're doing, what results you're expecting and what the actual result is. Neovim, a neovim-only autocompletion plugin, an unknown plugin manager, a fuzzy question asked on a generic site instead of the proper issue tracker… You will need a lot of luck.

Have you got :echo has "python3" returning 1? Active Oldest Votes.GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together. Work fast with our official CLI. Learn more. If nothing happens, download GitHub Desktop and try again. If nothing happens, download Xcode and try again. If nothing happens, download the GitHub extension for Visual Studio and try again. Note: If you need to understand what's different between deoplete and other similar plugins, please read "deoplete-faq" section in the documentation.

Deoplete is the abbreviation of "dark powered neo-completion". Here are some completion sources specifically made for deoplete. Note: deoplete requires Neovim 0. See requirements if you aren't sure whether you have this.

vim deoplete

Note: deoplete requires msgpack package 1. Extract the files and put them in your Neovim or. If :echo has "python3" returns 1then you have python 3 support; otherwise, see below. If Deoplete was installed prior to Python support being added to Neovim, :UpdateRemotePlugins should be executed manually in order to enable auto-completion. We use optional third-party analytics cookies to understand how you use GitHub. You can always update your selection by clicking Cookie Preferences at the bottom of the page.

For more information, see our Privacy Statement. We use essential cookies to perform essential website functions, e.

We use analytics cookies to understand how you use our websites so we can make them better, e. Skip to content. Dismiss Join GitHub today GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.

Sign up.Now that I am familiar with Neovim, I want to do everything related to text editing inside Neovim. Before we begin, you should make sure that you have installed the following softwares and plugins. Then we need to install the LaTeX plugin for Neovim.

vim deoplete

Vimtex is a great choice. To install it, we can use vim-plug :.

vim deoplete

In writing LaTeX source code, auto-completion is crucial for fast editing and improves our efficiency dramatically. Vimtex supports completion for citations, labels for figure, equation, table, section, etc.

For more documentation on completion, see :h vimtex-completion.

A Complete Guide on Writing LaTeX with Vimtex in Neovim

Vimtex can work with several completion engines such as deopleteYouCompleteMencm2. Since I use deoplete for completion, I will just introduce how to configure it for deoplete 1. To make vimtex work with deoplete, add the following setting to your init. Vimtex supports autocompletion through autocompletion engines such as deoplete. After configuring vimtex to use deoplete, you should be able to use the snippet provided by Ultisnips 2.

Ultisnips is a snippet engine, which uses vim-snippets to provide the actual snippet for various file types. To insert an figure environment, type fig in insert mode and press Tab. To insert an enumerate environment, type enum in insert mode and press Tab. The complete list of snippets provided by vim-snippets can be found here.

With vimtex, you can press ]] in insert mode to auto-close an environment. Vimtex provides the e text object to facilitate vim-surround like features for manipulating an environment quickly:. You can also use the standard Vim motion with this object. For example, vie will select the inside an environment, and vae will select the entire environment including the begin and end commands.

vim deoplete

It would be nice if we can jump to the definition of a label with the native Vim shortcut Ctrl-]. You have to do several things. First, you need to install a ctags executable. See here on how to install ctags. Second, you need to install a plugin to manage tags file for you.

It will update the tags file automatically once the source file has been changed. To make gutentags work, you need to tell it where your project root is. The easiest way is to make your project a git repository.

Subscribe to RSS

Open the TeX source file again, the tags file should be created automatically. BTW, to jump back, you can use Ctrl-T. Vimtex supports several PDF viewer based on the platform. My current settings for previewing PDF on Mac is:. I use neomake for syntax checking. For LaTeX source file, neomake provides several makers :. Among the makers, lacheck and chktex are installed if you have installed Tex Live.This post assumes that deoplete has been installed and set up properly on your system.

If that is not the case, you may refer to this post on how to do it. The build process will take about half of an hour on our core server, and the time may vary depending on your hardware. After that, we need to add the clang binary path to the PATH variable, and add the directory containing libclang.

For macOS, clang is shipped with it so we do not need to install clang. We need to install clang-format though since clang-format is not shipped with clang by default source here. On Mac, the name of the clang share library is libclang. For code linting, we can use ale. Add the following setting to Neovim config:.

We can use the command line tool clang-format shipped with clang for code formatting, with the help of pluign Neoformat to format our code. Make sure that clang-format is on your PATH. Add the following settings to Neovim config:. Notice that the linter name for clang-format is clangformatnot clang-format.

I have wasted ten minutes trying to find why clang-format does not with Neoformat until I found here that we should use clangformat as the linter name. LastMod Pre-requisite This post assumes that deoplete has been installed and set up properly on your system. Reward wechat alipay.It can interact with external programs, external scripts can interact with Vim, and Vim is of course scriptable.

Yes, you did see non-Vim tools in my list of previously used tools for notes… It should be noted that I was using Vim as my main editor long before I switched to using Vim to take notes.

The reason why is that for a time I knew I wanted to create and edit notes using Vim, but I wanted to be able to read those notes in other ways, such as rich text from rendered markdown Simplenoteor a wiki that was navigable in a browser Vimwiki. The times I used Vim to edit was frustrating, because I needed to fit with a workflow that required rebuilding a wiki after editing, or opening one file at a time for something like Simplenote.

I could create and consume in Vim! One more thing to discuss before we dive in - what is Zettelkasten?. The idea is that it forms a huge interconnected network of notes one can traverse and interact with. I came across this methodology a little while back and love the idea. There are many good resources. What I described above is only a simplification. What do we do now?

So we want:. There are two main places from where I want to be able to create a note: the shell and Vim itself. It must be as frictionless as possible to create new notes; any friction will dissuade me from taking a note at once, and thoughts are fleeting. So, from inside Vim, I have a command and function to create a timestamped file in my notes directory:.

It would be just as easy to develop entry points to creating notes from elsewhere in the environment, but since I spend a lot of time either in Vim or have multiple shell sessions open, most of the time a neat new note is only a few keystrokes away. Here, I stray from vanilla Vim, and lean on a couple of popular plugins: Ultisnips to shortcut inserting custom syntax and Deoplete to auto-complete paths to other notes.

Now the code! I use a syntax similar to Vimwiki to denote internal links, which are simply paths to other note files in the notes directory, with the extension removed for readability.

Vim as a Go (Golang) IDE using LSP and vim-go

Two key strokes is my definition of low friction. Now the third and final point: searching. This is one of my favourite points as there are so many possibilities!

Search is core to being able to effectively consume notes as opposed to creating notes, as the previous points have been mainly about.

For me, there are 3 entry points to search and 3 types of search. Note that wherever these searches begin, and whatever methods are used, they always end up in Vim and a way to navigate between search results in Vim. And the corresponding script that launches a graphical fuzzy finder which is used to select a wiki file to open in a new terminal window:.

Fuzzy find from inside Vim is done using fzf and a mapping:. A proper search engine-esque search with stemming, ranking by relevance, etc.

This article is licensed under the Creative Common Attribution 4. You are free to share and adapt this article provided you give appropriate credits. It pays you not to blink sometimes. It gives you a heck of a fright. Zettelkasten One more thing to discuss before we dive in - what is Zettelkasten?. So we want: Easy creation of new notes. It should be frictionless to create and start editing a new note at any time.

More friction equals less motivation to write up a note. Powerful options for search. Zettelkasten eschews hierarchy and taxonomy in favour of flexible search and… Linking between notes.

We need to be able to create a network of small notes, where we can search to find an entry point, and then traverse notes to discover related ideas.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *