All Questions

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

Change Neovim cursor in insert mode under st (simple terminal) and tmux

My Neovim cursor normally switches to a pipe symbol (|) when I'm in st, but it doesn't when tmux is open in st. Is there something special to do? Version: Neovim: v0.5.0-dev Tmux: 2.9a My ...
2
votes
0answers
19 views

Archive files opened with Vim are unreadable, even with zip plugins installed

I am trying to open archive files in Vim (zip files, jar files), but they are unreadable when opened. For example, I created a zip file with one file in it: $ touch testfile.txt $ zip test.zip ...
1
vote
1answer
14 views

How to make spell check work for text inside a XML file?

Editing a Qt localization file, which actually is a XML. I'd like to check spelling for a text inside tags, so executed a command setlocal spell spelllang=fr After that only attribute value become ...
9
votes
3answers
696 views

Is there a plugin to preview the line where the corresponding open bracket is for a close bracket?

If I am using IntelliJ and I hover over a close bracket for a scope that starts somewhere that is not currently visible, it shows a popup at the top of the window previewing the line where with the ...
2
votes
2answers
62 views

map <leader>b<number> :b<number><cr>

I am using a convenient macro to list my buffers: map <leader>bb :buffers<cr> I am trying to come up with a way to then switch to the buffer of interest with <leader>b<number> ...
0
votes
0answers
29 views

How to work with multiple project folders in Vim?

I am often working with multiple projects at the same time. For example one main project and 5 related librairies. I have some issue to properly search in one project or multiple. I would like to: Be ...
1
vote
1answer
44 views

vim-plug: install plugins on startup not working properly on Ubuntu

per the recommendation in the vim-plug wiki: https://github.com/junegunn/vim-plug/wiki/extra, I've added the following snippet to my vimrc: " Install missing plugins on Vim startup autocmd VimEnter * ...
6
votes
2answers
440 views

Difference between “* and ”+ registers in +clipboard VIM?

"*p and "+p seem to behave the same. I tried :help "*, but it's talking about mouse selection, and :help "+ tells me There are three documented X selections: PRIMARY (which is expected to ...
1
vote
1answer
37 views

MatchIt not matching anymore if parenthesis, brackets, etc. are between quotes or in comments?

I upgraded to Ubuntu 18.04 and this has Vim version 8.0. This newer version has MatchIt setup to ignore parenthesis, brackets, etc. found inside comments and strings. Although it is at times useful, ...
2
votes
2answers
55 views

Move rest of line inside a closed pair?

This is what I'm trying to achieve: input (|)foo then pressing some key combination to get output (foo)| or (foo|) I know this can be done with the autopairs plugin. In the docs they write ...
3
votes
1answer
26 views

Open command-line-mode from VimScript function

How to reproduce this mapping: nnoremap <Leader>a :DoSomething <C-r>=do_something_arguments()<CR> ..in a function? The desired effect is to open command-line mode with some text ...
1
vote
1answer
38 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
1answer
19 views

Scrolling with trackpad not working Macvim

I have just installed MacVim on my new Macbook. But I have 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't work ...
1
vote
0answers
29 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
19 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?
2
votes
1answer
38 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
0answers
16 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
1answer
19 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 ...
1
vote
0answers
19 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 ...
2
votes
2answers
51 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 | ...
3
votes
2answers
25 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-...
1
vote
1answer
20 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 ...
1
vote
2answers
25 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
28 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 ...
2
votes
2answers
384 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
1answer
35 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 ...
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
19 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
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
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&...
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> ...
0
votes
0answers
33 views

Vim showing a python2 error when writing in python3 [closed]

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 ...
0
votes
1answer
44 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
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 ...
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 ...
1
vote
3answers
48 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 ...
6
votes
1answer
216 views

Which keys are free / unmapped by default?

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

How not to let text in selection mode go to registers

I am using nvim-qt on Windows and I have set up the clipboard option: set clipboard=unnamedplus I found that text in Select mode will go to the +, * and " register after I start to type the ...
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 ...
1
vote
1answer
67 views

Making terminal buffer unlisted

I'm configuring my scripts to work with terminal in VIM and have a question regarding :h special-buffers. Among mentioned kinds there were the following: unlisted The buffer is not in the buffer ...
0
votes
3answers
41 views

“Hard-include” in vim script

I want to: let s:asciiart = ["", "", s:hardinclude(system("command params")), "", ""] where command returns one string with: "art-line-1", "art-line-2", "art-line-3" so I end up with: s:asciiart =...
0
votes
0answers
41 views

How to undo all changes in current session when undofile is on? [duplicate]

Without 'undofile', one can hold u or execute undo 0. With 'undofile', everything changed, hold u will undo changes made in older sessions, undo 0 will undo the entire undo history, they became ...
0
votes
0answers
26 views

Vim 8 plugin management [closed]

I am a beginner with Vim and I am trying to install Ultisnips in Vim 8.1 on Windows 10. How is supposed to be used the plugin manager that comes with Vim8?
1
vote
1answer
31 views

NERDTree is not displayed in buffer list

I'm currently exploring ways to iterate through all buffers in vim, and confused by behavior of NERDTree. I displayed NERDTree directory tree and expected that the viewport is bound to some buffer. By ...
0
votes
0answers
20 views

Some of unicode characters doesn't work in vim

I am using vim8 on windows 7. The problem is what whenever I try to paste a unicode character from somewhere else it doesn't work instead it shows. For example when I try to enter ⇛ It shows a ...
1
vote
1answer
25 views

How to figure out which syntax rule is determining a character's color?

I want to design my own vim color scheme, so I'm starting with an existing color scheme that I think is pretty good, and fixing the parts I don't like. The color scheme definition contains many ...
0
votes
2answers
51 views

persistent_undo works for vimrc file, but not for other files

Are there any permission settings that need set on a file to get persistent undo to work? I close and open my vimrc file and I can keep hitting the u key to see my previous edits. But it does not work ...
0
votes
1answer
31 views

How to add a certain word before the names of methods in Javascript?

I am working with react. First I had a component with state I created methods and all that. Now I want to convert it into stateless component. I have add the word function before each method name. ...
3
votes
1answer
41 views

How to set ruler with decimals in .vimrc file?

I have this line in .vimrc file set ruler which shows the percentage of current line. But for very large text files, it would just show 0% for first couple hundreds of lines, which is not quite ...

15 30 50 per page