All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
8 views

How to search & replace the word under cursor without changing position

This question is related to Do a forward slash search but don't have vim immediately jump to the string? but is not a dup. I recently updated my Linux box (clicked on the "install updates" button ...
0
votes
0answers
6 views

Scrolling with trackpad not working Macvim

I have just installed MacVim on my new Macbook. But I encounter a problem, on Linux I was able to scroll through my code - vertically moving my cursor - by using my trackpad. But on Macvim this doesn'...
0
votes
0answers
9 views

Why does my line indent?

Please see line 20 and 21: My question is about how vim decides to auto-indent line 21, and how to adjust that behaviour. When I took this screenshot I had formatoptions=qrn1a set, however I believe ...
4
votes
1answer
171 views

Why is a pipe interpreted as a command termination in :cexpr system('shell cmd')?

If I type: :echo system('grep -IRn foobar ~/.vim | grep -v backup') Vim displays the output of the shell command: $ grep -IRn foobar ~/.vim | grep -v backup Which is the list of files containing ...
7
votes
4answers
2k views

Markdown in Neovim: which plugin sets conceallevel=2?

I'm experiecing the most annoying thing ever: when I edit a markdown file, asterisk characters are hidden by default. If I set on an open buffer :set conceallevel=0, asterisks shows up as they should,...
2
votes
2answers
34 views

Why is my locale replaced when I run an external command?

Why is my locale setting replaced when I run an external command with :!cmd ? And which configurations should I check to find the cause of this problem? I've checked configs for my shell (zsh): ....
3
votes
1answer
60 views

Autocompletion filenames with prefix in variable

In Vim I make auto-completion of the filesystem paths just by the shortcut Ctrl + x, Ctrl + f, in insert mode. In a Makefile I sometimes put a path's prefix in a variable. For instance STYLEDIR=/home/...
1
vote
1answer
72 views

Dynamically toggle formatoptions based on input

Question: Is there a way to control the indentation + comment leader input, when adding a new line? Details: I am trying to set formatoptions-=cro when inserting a new line (in specific syntax region)...
0
votes
0answers
17 views

Catalina - Fonts

I have a non-retina MacBook Air. I upgraded to Catalina (10.15.1) and I now face thin & washed-out fonts. I had the same problem with Mojave, but there was a certain code that made the fonts on ...
0
votes
1answer
97 views

How can I make F9 with vim-latex work with “\cite{”?

I have installed vim-latex v1.10.0 on Fedora 28, using vim-plug as follows: Plug 'vim-latex/vim-latex' F9 does not work with \cite{. It works with \ref{, but n and p cycle through the results of ...
1
vote
2answers
56 views

vim highlighting doesn't set the right type for a new filetype

This is what I have in my /usr/share/vim/vim80/filetype.vim (the only mention of messages in the file) : " Messages (logs mostly) au BufNewFile,BufRead */logs/couchdb/{,.log}{,.[0-9]*,-[0-9]*} setf ...
4
votes
1answer
16 views

Cursor Movement in y8k vs y8j [duplicate]

Why does y8j not move the cursor but y8k does move it up? What .vimrc entry would prevent yanking upwards moving the cursor?
0
votes
1answer
132 views

How to save the source code of a PDF file after opening it in Vim?

I am detecting malwares in PDF files for which I need their source codes too. I want to save the source code in some text file so that I can write a code to scan through all of them to detect patterns....
2
votes
1answer
66 views

Running a command Async in Neovim

As far as I know, neovim enables running a command async, without blocking the user. This is also enabled in vim8 I was told. But I couldn't find examples of how to run a command asyncly. Suppose ...
2
votes
1answer
34 views

Map <C-J> to <Space> in all possible modes

My space bar no longer works unless I lean my weight on it. The chances of getting the laptop replaced in a timely manner is close no nil. I mostly use vim or vi, even from the bash command line. ...
1
vote
2answers
23 views

Auto Command fails with file plugin command

I have following line in my .nvimrc au! BufWritePost *.elm ElmMake Each time I save an elm file vim tells me that this command does not exist. However I am able to run this command in command more ...
1
vote
1answer
16 views

Completion pop-ups hijack arrow keys. Any way to disable that?

Regardless of which code completion plugin I use (I tried asyncomplete and YouCompleteMe), when there's a completion pop-up, up and down arrow keys select completion options in it instead of moving ...
2
votes
2answers
49 views

Jump to a specific line without moving the cursor horizontally

Consider you are editing the left table in Vim. Your cursor (■) is at Line 14, Column 12. Where you are now Move the cursor 11 +-------+-----+ 11 +-------+-----+ 12 | Name | Age | ...
1
vote
0answers
12 views

Why does :! open -a terminal or :! start cmd create totally new “applications”?

Edit: on Windows, looks like it's opening in sysWOW64 instead of system32. Any ideas why? Title. Basically, both of these commands are supposed to open a new console, the former on my mac and the ...
1
vote
0answers
15 views

How do I unconditionally disable all the “smart” terminal actions in vim

I have already set mouse= and set ttymouse= but I still get it intercepting paste when I'm trying to paste vim commands, like I want it to do some kind of complex :map! .... so I copy that from ...
3
votes
2answers
23 views

What does <SID>some_function() . '_' mean? in particular, . '_' part

While I was studying Tpope's vim-commentary, I was struck by a line that contains the topic of this question. I am referring to one of the lines in Tpope's vim-commentary: https://github.com/tpope/vim-...
3
votes
1answer
662 views

Toggle fzf.vim if already open

I am trying to write a vim function to toggle the fzf window if it is already open using fzf.vim. The use case is if I am in the :Buffers view and I want to change to the :Files view if I try to ...
1
vote
1answer
17 views

Expression register and fractions

I tried to use the arithmetic register with a fraction (7/8) and it returned 0! How do I exert better control over the register so that it gives me what I want? The literal sequence I used, while in ...
292
votes
10answers
244k views

How can I copy text to the system clipboard from Vim?

Is there a way to copy a block of text to the system clipboard, so I can paste it in another program?
1
vote
1answer
25 views

Is there a way to list recent buffer history?

I just started using buffers in Vim and I couldn't figure out how to list recent closed buffers. Is there a simple way (like :ls) to list those? Are they actually stored by Vim? Maybe I'm misusing ...
7
votes
1answer
574 views

When exactly does <afile> differ from <amatch>?

The documentation says: <afile> When executing autocommands, is replaced with the file name for a file read or write. <abuf> When executing autocommands, is replaced ...
1
vote
3answers
47 views

Prevent VIM from folding a large file

For editing XML files I have the following in my init.vim " Automatically enable folding of XML-files augroup XML autocmd! autocmd FileType xml let g:xml_syntax_folding=1 autocmd FileType xml ...
5
votes
1answer
249 views

Highlighting after a line limit

I'd like to highlight sections of a document which are too long (measured in lines) so they will all print on a physical page. Sections are separated with ===. I tried to do it with this code: ...
0
votes
1answer
34 views

Search a term and replace with line numbers

I want to search and replace occurrences of $this->close_db(); with $this->stmt->close(); $this->database->close(); which occurs on lines 73-74 (with indentations). What is a ...
2
votes
2answers
378 views

Grabbing values between quotation marks

I want to create a regex that matches strings within single or double quotes in vim and that considers the fact that some strings might have escaped single quotes or double quotes. So far, I've found ...
0
votes
0answers
19 views

Autocomplete hidden files

This same question has already been posted by a user who asked why this happened with the autocompletion of the :e[dit] command here. However, the accepted answer doesn't fully answer the question ...
1
vote
1answer
16 views

Showing external command output only if not empty

Is it possible to silently run an external command, but show the output on the prompt only if there was any?
1
vote
1answer
17 views

How to close file/buffer/tab after cerain time of inactivity?

Is there a way to close file after certain amount of time of user inactivity? Lets say I have a encrypted file and I want to close it after 10 min. Is it possible in Vim?
1
vote
0answers
35 views

Hierarchical auto-populated menu

I'm aware of vim menu and plugins such as vim-venu and quickmenu, but they need to be manually configured. Is there a way to populate vim menus with all commands available organized in a ...
0
votes
1answer
59 views

Python Language Server Protocol with virtual environment

Can anyone help me get things like "Go to definition" working with Neovim and Python virtual environments? My setup currently uses a specific virtual environment for Neovim (as recommended by :...
0
votes
1answer
41 views

How to navigate long lines like separate lines?

When I have a very long line in vim it will be shown on the screen as multiple lines, like this: line no. | content | 100 | this is a very ...
0
votes
1answer
33 views

After undoing changes, Neovim still requires saving file or ! before exit [closed]

If I open a file, add a line (o), and then delete that line (dd) making the file exactly the same as when it was opened, upon exiting (:q), Neovim states: E37: No write since last change (add ! to ...
0
votes
1answer
54 views

(coc.nvim) error: Warning: The 'x' rule requires type information

I'm using coc.nvim for react (typescript) development. I have installed following coc plugins. coc-tslint-plugin coc-tsserver coc-prettier tslint integration is enabled for prettier in coc-settings....
0
votes
1answer
26 views

Repeat/copy a character sequence using commands

I tried the following in my .vimrc using the hints I found here: map <Tab> i4<Space><Esc> map <F2> /79*<CR>79*/<CR>PROGRAM<Space>NAME<Space><Space&...
25
votes
4answers
16k views

What is the difference between the vim snippets plugins?

There is a great number of snippets plugins for vim: ultisnips, snipmate, xptemplate, neosnippet and a lot more. They all have pros and cons and more or less dependencies. So far I've been using ...
3
votes
1answer
1k views

How to have forward search using Zathura PDF viewer and LaTeX-Box plugin?

I just started using Zathura to view pdfs while editing tex files. I am trying to have forward searching capability in Zathura. Using the LaTeX-Box plugin in Vim, I have added the following in my ...
2
votes
3answers
28 views

How to map Ctrl-(? [duplicate]

I am trying to map Ctrl( in insert mode. However, Vim does not recognize the key binding. This is what I currently have: " Insert a pair of brackets using Ctrl-( inoremap <C-(> ()<left> ...
5
votes
1answer
163 views

Which keys are free / unmapped by default?

Is there a list of keys which aren't mapped by default in vim?
1
vote
0answers
16 views

Why colorscheme is re-loaded if vimrc is located in $VIM?

I ran into a problem with cursor color being reset when using gruvbox color scheme on both Linux and Windows. During debugging I discovered that the color scheme is reloaded if vimrc is located in $...
0
votes
1answer
27 views

Toggle a setting using shortcut

I have set up Vim to trigger reformatting on save using ALE, but sometimes that doesn't fly very well, and would like to disable it manually. But remembering what the right incantations are is always ...
0
votes
0answers
23 views

Vim showing a python2 error when writing in python3

Vim shows an error on line 4 of the picture below, which in python 2 is actually an error but not in python 3 which I have check by running it. How do I tell vim I am writing in python 3 to avoid it ...
5
votes
3answers
269 views

How to display in the statusline the number of matches from a search?

I've seen this question: Is there a way to count the number of occurrences of a word in a file? but most of the time I search using * or just /. It is possible to display automatically in the ...
2
votes
2answers
177 views

Is it possible to use the :put Ex command using column numbers?

The documentation for :put says that the command accepts a line. That is, it puts the content after the line specified. Is it possible to put the content at a particular mark? For example, say I am ...
1
vote
1answer
34 views

vimtex imap not working

I'm having a problem with using imaps with vimtex (i.e they don't work). To test the issue I went to .vim/plugged/vimtex/test/examples/minimal and started vim -u minivimrc. Typing `a (which is a ...
9
votes
2answers
205 views

Is there a way to edit secure data in vim without accessing the filesystem?

I am interested in using vim to edit a "secure" file, one that is stored encrypted elsewhere (say, somewhere in the cloud), and should not be written as plaintext to the local disk. So the sequence of ...

15 30 50 per page