All Questions

Filter by
Sorted by
Tagged with
1
vote
0answers
17 views

How to convert register contents to something readable similar to :register command?

Let's assume there is a macro stored in register 'r' I can obtain the contents of this register by executing getreg('r'), but if I print this then it can often be unreadable. I noticed though that ...
1
vote
1answer
14 views

Deleting folds over a range

Working in an index with mucked up manual folds. Would like to delete folds from current line to end of file. Have tried: :.,$zd and :.,$df So far I've just done a visual selection from current ...
2
votes
2answers
22 views

mutually exclusive Autocommands for similar file extensions

I have a couple of autocmds in my vim config along the lines of this (the actual commands are quite long): au BufWritePost *.latex.md silent! ... au BufWritePost *.md silent! ... where ...
2
votes
1answer
25 views

Syntax highlighting for objdump output

Currently I am working a lot with objdump output (arm / thumb instructions): The command (arm-none-eabi-objdump -h -S main.elf > main.lst) creates a mixture of assembly (with addresses and hex ...
0
votes
0answers
19 views

Run a process whenever I save any of the open buffers [duplicate]

would it be possible to run an arbitrary command in a terminal (like node tests.js or cucumber -p @wip) whenever any of the open buffers in vim are saved? I guess I'm thinking of a save hook or ...
1
vote
1answer
45 views

Yank then Paste without moving cursor

I want to be able to: :42y then something like: :13p having it to paste the yanked line in a new line after 13, without taking my cursor away. So far, all solutions I have found involves going to ...
1
vote
1answer
48 views

Vim-Surround but not shift+S in visual mode

How do I disable vim-surround in visual (selection) mode? IE. If I hit shift+S I want to replace all the lines I have currently selected ( the normal vim functionality )
2
votes
0answers
26 views

How to profile save time

Sometimes it takes a really long time to save a file out. Saving the same file after various changes takes various amounts of time. It does not seem to be related to file size. I've disabled any ...
1
vote
0answers
19 views

How to correctly add syntax highlighting to all c typedef

I saw that it's possible to manually add types to highlight, according to this post: https://stackoverflow.com/questions/20149478/how-can-i-teach-vim-about-additional-c-language-types-for-syntax-...
1
vote
1answer
42 views

Why can't I remap q [closed]

I have many key mappings in my vimrc but for some reason no matter what I do q remains mapped to recording macros. I will post my full vimrc below, but the relevant part is that even if the last line ...
1
vote
2answers
55 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 ...
3
votes
1answer
33 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 ...
2
votes
1answer
27 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 ...
10
votes
3answers
740 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
86 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> ...
1
vote
0answers
37 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 ...
2
votes
1answer
51 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 * ...
7
votes
2answers
453 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
40 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, ...
3
votes
2answers
59 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
28 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 ...
2
votes
1answer
40 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
21 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
1answer
42 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
21 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
41 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
21 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
52 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 | ...
4
votes
2answers
27 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
21 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
26 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
391 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
20 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
19 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 $...
1
vote
1answer
29 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&...
3
votes
3answers
31 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
34 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
45 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
35 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
49 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 ...
7
votes
1answer
230 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
101 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
35 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 ...

15 30 50 per page