Hot answers tagged

79

Just like the neovim homepage describes, neovim's objective is to pave the way for a better & more openly community driven open source project. The architectural changes not only will bring more stability & improve performance to vim but make the code a lot more maintainable and bring the entry barrier slightly down for anyone who is interested to ...


56

You are supposed to press <C-\><C-n>. See :help terminal-emulator for a mapping suggestion.


39

The answer by @romainl is correct but I wanted to add a bit more info for anyone that may have stumbled on this from google like I did. Directly from the docs we get this note: Terminal mode has its own namespace for mappings, which is accessed with the "t" prefix. It's possible to use terminal mappings to customize interaction with the terminal. For ...


35

I'm specifically addressing: Why should I care? As a user, what's the difference for me? The thing I am most excited about as a Vim user are the new kinds of plugins, integrations, and interfaces that will be enabled by the changes under Neovim's hood. As time goes by you will begin to see really impressive plugins and programs that work with Neovim ...


26

TL;DR You can use your existing ~/.vimrc, files, and plugins located within ~/.vim without having to symlink the files. And this is now documented in NeoVim manual, see Transitioning from Vim. The below lines will add the existing paths and ~/.vimrc file to your nvim setup. set runtimepath^=~/.vim runtimepath+=~/.vim/after let &packpath=&...


18

You can do this with Vim-Plug. See the README: " On-demand loading Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } Plug 'tpope/vim-fireplace', { 'for': 'clojure' } I think you'll have to use :set filetype whatever instead of set syntax whatever to enable the plugin. (Some other plugin manager might allow you to do that, see What is the difference ...


17

A terminal buffer name always starts with term://: autocmd BufWinEnter,WinEnter term://* startinsert Note that this will always put you in insert mode when you move to the terminal window, regardless of the mode you were using when leaving the window. You can also use a similar autocommand to always get back in normal mode when you leave the terminal ...


17

Neovim terminal buffers always have an associated job id, so one way is to use the job control API to send the text. Add this to your vimrc: augroup Terminal au! au TermOpen * let g:last_terminal_job_id = b:terminal_job_id augroup END Which will save the the job id of the last created terminal into the g:last_terminal_job_id variable. Then you can ...


15

My own favorite addition Neovim brings to the table is terminal mode. You can now split your Neovim window and have a terminal emulator running on one side and be editing a file on the other side! I suppose you could even run Neovim inside of itself now, just in case you really wanted to do that. Having asynchronous plugins is also going to be extremely ...


15

Basically when you have text selected, you want to remap a key sequence to copy, switch to terminal, paste, and then possibly switch windows back and reselect the text. If you have two splits open, this would look something like: vnoremap <F5> y<c-w>wp<c-w>pgv "explanation: xnoremap <F5> Remap F5 in visual/select ...


15

I compared the output of running env in a standard terminal to the output when running it within Neovim, and it looks like these variables are new: VIMRUNTIME=/usr/local/Cellar/neovim/HEAD/share/nvim/runtime VIM=/usr/local/Cellar/neovim/HEAD/share/nvim NVIM_LISTEN_ADDRESS=/var/folders/_8/sy7jjpw55mbgn2prml0fbsgc0000gn/T/nvimaLHjPR/0 (The vim I have also ...


14

To help answer your original question, you can check where a setting was last set with the :verbose command. :verbose set conceallevel This will display a message similar to: conceallevel=2 Last set from ~/.vim/plugged/indentLine/after/plugin/indentLine.vim Note that :verbose simply runs a command with a specified verbosity, so if you wish to check ...


13

Those chars are hidden because the conceal feature as you can see on the vim-markdown source. You can adjust how to this feature is applied to text using the option conceallevel. Setting it to 0 will always show the text. :set conceallevel=0


12

As Christian Brabandt suggested in a comment, this can be caused by the 'cursorbind' setting. From :help 'cursorbind': When this option is set, as the cursor in the current window moves other cursorbound windows (windows that also have this option set) move their cursors to the corresponding line and column. You can use :verbose set cursorbind? to ...


11

:bd will do that. From the documentation: :[N]bd[elete][!] *:bd* *:bdel* *:bdelete* *E516* :bd[elete][!] [N] Unload buffer [N] (default: current buffer) and delete it from the buffer list. If the buffer was changed, this fails, unless when [!] is specified, in which case changes are lost. The file remains ...


11

The directory is ~/.config/nvim/colors.


10

Main Issue The main problem you are experiencing is caused by the ordering of the commands in your .vimrc. You set the g:impact_transbg variable after you load the colorscheme, and so the variable does not exist when checked by the colorscheme's if statement, and the second version of the colorscheme (in the else block) is used. To fix, you simply need to ...


10

Running a terminal inside Vim allows you to use Vim commands on the input and output to the programs that you run in that terminal. You get search, copy-paste, macros, syntax coloring, etc. Using :read !{command} and :write !{command} gives you that for one-shot commands, but asynchronous input/output becomes useful when you want to submit input to an ...


10

Aside from alxndr's example, you can set one yourself with: :let $IN_NEOVIM = "yes" :terminal $ env | grep NEOVIM IN_NEOVIM=yes This is especially useful as a simple way to pass information to the shell; for example: :let $NEOVIM_FILETYPE = &filetype :terminal $ env | grep NEOVIM NEOVIM_FILETYPE=python


10

As stated on neovim wiki: Windows support is (currently) experimental. To try it out, you need nvim.exe and a front-end such as Neovim-Qt. However there isn't a list of all features that are missing or unstable. The best way to discover is actually installing and trying.


10

You can use :help :verbose to inspect the value of an option (they are "options", not "variables") and see where it was last defined: :verbose set conceallevel? Note that you must use the question mark to inspect boolean options while it doesn't change anything for other types so… stay safe, always use the question mark.


10

Use if has('nvim') to detect if you're running Neovim. Note that, unlike Vim, Neovim doesn't have the language bindings built in. They're provided by external plugins. You would need to install the Python3 version of the neovim module, as described in :help provider-python.


10

If you were looking for the last point where an option was set (instead of a variable), you could use the :verbose command: :4verbose set is? incsearch Last set from ~/.vim/vimrc But currently there is no equivalent command for variables. You could inspect the code, or use search in the source, possibly using :vimgrep, :vim netrw_list_hide **/* (...


10

You can capture a full log of a Vim session with vim -V20vimlog. After quitting Vim, examine (search, grep) the vimlog log file for :let g:netrw_list_hide.


9

Should have looked a bit harder before asking, I found my answer: :help +cmd *+cmd* *[+cmd]* The [+cmd] argument can be used to position the cursor in the newly opened file, or execute any other command: + Start at the last line. +{num} Start at line {num}. +/{pat} Start at first line containing {pat}. ...


9

You're looking at this all wrong. Read :h 'runtimepath'. 'runtimepath' or 'rtp' is analogous to $PATH in the shell. The files you see in /usr/local/Cellar/neovim/0.1.7/share/nvim/runtime is the pristine runtime files that come with Neovim. You should not add files to it. If you want to see where scripts will be loaded from by default, run: nvim -u NONE ...


8

As far as I know vim has this feature because the GUI vim (gvim) uses the graphical X server. I am aware that non GUI Vim can also use the --servername argument but only when X11 is running and also by accessing to it. On the other hand, neovim has no graphical support; for that reason, I don't think that the --servername option can work (unless the option ...


8

Instead of calling execute pathogen#infect() to load all plugins, call pathogen#interpose for every plugin, i.e.: execute pathogen#interpose('bundle/unicode.vim') execute pathogen#interpose('bundle/AnsiEsc.vim') The pathogen API isn't documented outside of the source, but it's simple enough (even though the function names are obscure and non-descriptive). ...


8

I'm not sure, but I think that when you hit <leader>l to call :REPLSendLine, Vim automatically inserts the visual range '<,'>, and since your command is not defined with the attribute -range, it raises an error. In your visual mapping, you should probably add the keycode <C-U> to remove the visual range (it won't affect the marks '< and ...


8

set shada="NONE" will prevent shada files from being generated or read in Neovim. For vim, set viminfo="NONE" will disable viminfo files.


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