jamessan
  • Member for 6 years, 11 months
  • Last seen more than a month ago
How is the `dict` attribute processed internally?
Accepted answer
6 votes

This is described at :help Dictionary-function: *Dictionary-function* *self* *E725* *E862* When a function is defined with the "dict" attribute it can be used in a special way with a ...

View answer
Execute a command in the NeoVim terminal emulator on startup
Accepted answer
3 votes

As described in :help :terminal, you can specify a command that will run in the terminal buffer. nvim -c 'terminal ~/environments/env1/bin/python' When :terminal isn't given an explicit command to ...

View answer
Neovim setup on MS Windows
Accepted answer
9 votes

The user's runtime directory is $XDG_CONFIG_HOME/nvim. When $XDG_CONFIG_HOME isn't set (which is the typical case), then the default directory is ~/AppData/Local on Windows and ~/.config elsewhere. ...

View answer
Text manipulation by calling external binaries or scripts
4 votes

You can filter (part of) a buffer through an external command by using :{range}!{command}. The range of the buffer written to the external command is replaced by the output of the command. If you ...

View answer
Why is the version of Vim displayed by 'apt' different from the one displayed in Vim?
Accepted answer
3 votes

As described in /usr/share/doc/vim/NEWS.Debian.gz, the Debian packages have switched to building against Python3 for Stretch. If you upgraded a system to Stretch and didn't see this message, then I ...

View answer
How to "find" or "till" a bigram?
5 votes

The sneak plugin provides that functionality. By default, it's bound to the s key, so you would need to use sts for your example. The documentation also gives example mappings to put sneak's ...

View answer
How do I keep accidentally creating a no break space before opening curly brace?
15 votes

The 'listchars' option provides a means to make 'list' display non-breaking spaces. It's not set by default, so you probably want to add it. set listchars+=nbsp:‗

View answer
Why does vim use temporary file or pipe for shell commands?
Accepted answer
6 votes

How else do you expect Vim to retrieve the output of the commands? Your :%!ls writes the contents of the buffer to ls's stdin, reads the stdout from ls, and replaces the contents of the buffer with ...

View answer
Erratic spell checking
1 votes

Most likely, the problem is that the files in which spell checking isn't working are being detected as filetype=plaintex, but the file where it works is detected as filetype=tex. If that's the case, ...

View answer
Add vi: ft without breaking the code
Accepted answer
3 votes

# isn't how you write a comment in Groovy, so you've created a file with incorrect syntax. Change it to a proper Groovy comment and you should be fine. // vi: ft=groovy

View answer
Passing a # character to the shell in vimscript?
6 votes

shellescape({string}[, {special}]) has an extra, optional argument {special} which exists exactly for this purpose. When the {special} argument is present and it's a non-zero Number or a non-empty ...

View answer
NeoVim: how to build luarocks (and it's modules) without internet access?
Accepted answer
1 votes

If you build with make USE_BUNDLED_DEPS=OFF (or cmake -DUSE_BUNDLED=OFF if you're directly running cmake), then none of the 3rd-party dependencies will be built. It will use whatever is available on ...

View answer
Quickfix support for Python tracebacks
Accepted answer
8 votes

Vim comes with a set of "compiler" scripts, one of which is called "pyunit". If you run :compiler pyunit and then :make (with your suggested value for 'makeprg'), quickfix is ...

View answer
Set &viminfo differently in neovim and vim
Accepted answer
5 votes

I would suggest appending your specific additions to the viminfo option rather than duplicating default information. That is, set viminfo+=!. Additionally, it seems like setting the n option isn't ...

View answer
What is the rationale for \r and \n meaning different things in s command?
Accepted answer
13 votes

At the most basic level, there's already an asymmetry between the search and replace portions of :substitute because the former is a regular expression and the latter is text, with specific additional ...

View answer
How to copy from current line to the `n`-th line?
6 votes

The :[range]y[ank] [x] command allows specifying the range through the normal cmdline range syntax. In your example, you could use :.,20y to yank from the current line through line 20 into the ...

View answer
How to change buffer name for NeoVim Terminal special buffer
5 votes

You can change the name of any buffer by using the :file {name} command. However, doing so changes that alternate-file to the previous name, which you may not want in this case. The :keepalt command ...

View answer
How do I turn off the "feature" where the pound sign "#" is forced to 0 position?
Accepted answer
8 votes

As documented in :help 'smartindent' When typing '#' as the first character in a new line, the indent for that line is removed, the '#' is put in the first column. The indent is restored for the ...

View answer
How do I get Vim to be able to run both python and python3 on a Linux system in the same session?
17 votes

I'm the current Vim maintainer for Debian and the person quoted in the referenced mailing list discussion. As you stated, this isn't a question about Vim. It's about building the software that Vim ...

View answer
Move to non-existing Nth column
Accepted answer
10 votes

You can use 'virtualedit' to allow moving to columns that don't contain text. If you set virtualedit=all, then 80| will place the cursor on column 80. No spaces will be inserted until you actually ...

View answer
How to repeat the last command in Ex?
Accepted answer
5 votes

:help E30 states The command-line is only stored in this register when at least one character of it was typed. Thus it remains unchanged if the command was completed from a mapping. It seems like ...

View answer
Why double negative regex matches when positive one doesn't?
5 votes

\W isn't understood as a character class inside a collection, so [^\Wub] is specifying Match any character other than \, W, u, and b. See :help /[ for the specifics about what can be used inside a ...

View answer
What does z stand for in vim?
Accepted answer
33 votes

z doesn't stand for anything. g and z were two letters that went unused as standalone commands (z<CR>, z., z+, z-, and z^ existed) in vi, so they have been repurposed in Vim as a prefix for a ...

View answer
Why did p paste a copied line after the current line, instead of after the current word?
Accepted answer
22 votes

When you deleted the line using dd, you performed a linewise delete. The p command pastes after the cursor position. Since the default register was populated with linewise content, that means it ...

View answer
How to change Vim's :hardcopy printfont?
7 votes

Instead of printing from Vim, you could instead generate an HTML file using :TOhtml. Then you can use CSS to set the font used for the HTML and print that.

View answer
How can I open a buffer in a new tab leaving the current window and buffer intact?
11 votes

:tab split will create a new tab displaying the current buffer, since :tab modifies any command that would normally create a split to instead create a tab page. If you want to override <C-w>T ...

View answer
Can Vim add to the X11 clipboard or primary buffers without an external utility?
13 votes

TL;DR: This isn't really possible without a clipboard manager (e.g. clipit, diodon, glipper, parcellite). It's an explicit design choice of X to not store the data for the X selections, whether that'...

View answer
How to match a word ending with uppercase letter and a specific letter?
5 votes

It looks like you may have changed Vim's 'magic' option from its default to 'nomagic'. You can check this with the command :verbose set magic? As documented at :help /magic, 'nomagic' causes the . ...

View answer
ubuntu & haskell : problem with haskell-vim-now
2 votes

Have you enabled syntax highlighting and filetype plugins/indentation in your vimrc? syntax on filetype plugin indent on

View answer
Can I show the git diff status on a per-line basis?
4 votes

gitgutter and signify are two plugins I know of which provide this sort of functionality. When a buffer is saved, the sign column is updated to show where lines have been added/modified/deleted. ...

View answer