All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
3 views

ALE Error and warning highlighting gets disabled when termguicolors is enabled

I have the ALE extension installed, and would like it to highlight errors and warnings, however when :set termguicolors is enabled, the Here's a screenshot of the problem: set termguicolors ...
1
vote
0answers
84 views

How to avoid screen corruption?

I'd been using Linux Mint MATE for years, and recently moved to Arch Linux with MATE Desktop Environment without any change of hardware. After that, when I open a file on vim and scroll up/down or, ...
0
votes
0answers
5 views

How to match A but not B

The text is 1: This ia a book. 2: Here is the book for you. 3: There are book. 4: You can read the book. 5: Is book good to read? I want to find all book without a or the, that is, the book in Line ...
0
votes
1answer
27 views

Is it possible to have vim run a command every time save `:w` is invoked?

I am editting typescript now, and I'd like to be able to have it so, whenever :w is invoked, the shell runs tsc compiling my new save. This beats having to !tsc every time. Does something like this ...
0
votes
1answer
37 views

insert new bullet point in autoindent mode

with autoindent mode on, when writing a short bullet point on restructuredtext file: - item one ~ Then I press Enter, and I get: - item one ~ but I whould like to quickly by here: - ...
0
votes
0answers
19 views

Keep indentation after multiple newlines

I've got a problem where in insert mode, if I type something like { that will cause indentation, then press enter twice, then match that bracket (such that there is a line in between the opening and ...
0
votes
0answers
16 views

netrw bug? cannot copy marked file to target

When I try to do the following on Windows 10: go to a directory, set it as the target directory using mt go to a different directory, mark a file in that directory using mf use mc to copy the file to ...
0
votes
1answer
16 views

Jump to nearest pair of brackets with %

I'm looking for a way to change the behaviour of the % key. I know by default it will move the cursor to the corresponding parenthesis or brace, but I'm wondering if I can have it jump to the nearest ...
0
votes
1answer
36 views

Bell ring on mapping <c-/>

This is the problem. I want to use in my mapping but it causes a bell to ring every time I press on it, no matter what I mapped it to. For example: nmap <c-/> y I am on nvim-qt. PS tried ...
0
votes
1answer
76 views

/usr/share/vim/vimrc taking precedence over ~/.vimrc for textwidth

Here is my ${HOME}/.vimrc : set textwidth=0 set history=100 (FWIW, inverting their order has no effect, as one would expect.) It is read by vim (:echo $MYVIMRC returns the correct path), and indeed ...
1
vote
2answers
65 views

What is the difference between loaded and unloaded buffers?

I was looking at the documentation for the 'complete' option, and I found it a bit confusing: . scan the current buffer ('wrapscan' is ignored) w scan buffers from other windows b scan other ...
2
votes
1answer
155 views

Efficient Syntax Highlighting

I am using VIM as a note taking application and have created syntax highlighting to assist with readability. See below or the repo for all the files. syntax match Timestamp /^\d\d:\d\d \d\d[/]\d\d[/]...
0
votes
0answers
19 views

Neovim highlight syntax region inside typescript tagged template literal

I am having trouble fixing a syntax plugin for Vim. I've found a bug in a plugin that has not been touched in a fair amount of time. I want to address it myself but I believe I am lacking in a lot of ...
3
votes
0answers
14 views

How to mark multiple files in netrw?

I tried using MF *.h for example to select all the files in the current directory that end with .h but this doesnt work. What are good ways to mark multiple files using netrw?
0
votes
0answers
16 views

Font on Mac Catalina

I just now upgraded to Catalina on Mac (10.15) and immediately ran into an odd font behavior: when I open a file with MacVim (8.1.1722 (157)), the letters with tails (g, y, p...) have their tails cut ...
0
votes
1answer
25 views

Enable spelling in code files outside of comments

I've got the following obviously misspelled file: bla blar blar When I open it as "bla.txt" and run :setlocal spell vim rightly points out all three words as misspellings. However, if I mv the file ...
72
votes
5answers
14k views

How to join lines without producing a space?

The standard J command for joining lines replaces the newline character(s) with a space. It's useful when editing 'literature' but can be troublesome if I, say, edit a hex dump by hand if I forget to ...
1
vote
1answer
60 views

Make mapping that accepts count independent of line count

I have a mapping that looks like this: nnoremap <expr> <c-x>b ":call MyFunction(" . v:count . ")\<cr>" I also tried to instead define function with range, but the effect is the ...
0
votes
1answer
18 views

How do I open ctrlp plugin file suggestions in Insert mode?

I'm using CtrlP plugin to switch to other files in Vim by pressing Ctrl-p. But this only works in normal mode. I want to trigger it by pressing the same set of keys in insert mode as well. How can I ...
2
votes
3answers
391 views

How to create a vimrc macro using :sort?

I tried creating the following macro: search an empty line above my location go down one line shift-v find an empty line down go up one line :sort This should sort the entire section I'm pointing at....
2
votes
1answer
41 views

How to get tpope/vim-rails gf command to work with SpaceVim

I am using SpaceVim as Ruby on Rails IDE and installed the tpope/vim-rails plugin. However, the other commands like :Econtroller, :Emodel, :find, commands are working just fine but the gf command ...
0
votes
0answers
12 views

How to find all .kl files in current directory with Flygrep (spacevim)

I tried with Flygrep *.kl but it didn't work, I searched how to use --include \*.kl as in a grep search but I didn't find anything
30
votes
5answers
2k views

Terminal borked after invoking Vim with xargs

I've sometimes tried invoking Vim using xargs, like this: find . -name '*.java' | xargs vim … which kind of works: As Vim launches, I see the following warning flash briefly: Vim: Warning: Input ...
9
votes
3answers
5k views

What is a scratch window?

Sometimes I see a window open with name scratch. I know it is some kind of temporary buffer/window. How can I crate one? :h scratch returns nothing.
0
votes
0answers
10 views

Deleting the temporary buffer created by Pymode

I'm using the python-mode plugin with automatic lint checking. I want an easier way to delete the temporary buffers used to show errors when I use :wa. Sometimes there are more than one. Now I'm ...
2
votes
1answer
42 views

Session - start with buffer 1

Note: Possible fixed bug. See comments. A somewhat minor nuisance, but as the pedantic for these things :P When saving and opening a Session file the Session.vim file does: badd +1 file1 badd +1 ...
5
votes
1answer
215 views

What is the difference between <C-V>x and \x?

Run the following commands, where <80> is a literal byte entered by typing Ctrl-Vx80: let literal = "<80>" let quoted = "\x80" echo(literal) and echo(quoted) will now both output <80&...
2
votes
1answer
25 views

Get neomake to recognize python and gcc location

I installed the latest versions of Python and GCC/G++ in alternative locations. I am using SpaceVim. I think SpaceVim is using neomake as the default. I want to know how you can configure neomake to ...
1
vote
1answer
27 views

How do I keep the spacevim search results window open after opening a file?

How can I keep the search results location list window open after opening a file in a new buffer?
0
votes
1answer
19 views

Calling a function when timeoutlen expires and retrieving the input command

This might be quite challenging, but I would like to achieve the following behavior. Imagine that I have two mappings that overlap: dcb := delete comment block := delete comment block (all adjacent ...
1
vote
2answers
48 views

Send keys to a terminal buffer

I want to map a keyboard shortcut to execute the last command in a terminal buffer that I have open. I've made some progress: I am storing the buffer's channel id correctly but when I try to send ...
0
votes
0answers
13 views

Spell check operator

Is there a way to run the spell checking for a single text object instead of the entire file? I would like to do something like: gsip (go spell in paragraph) I've found a gammar check operator: ...
0
votes
1answer
13 views

How to fix incorrect highlighting from 'matchpairs' caused by setline()

when using setline() to insert brackets, matchpairs does not do its job correctly. Using these commands fu Test() cal setline(".", "()") endf au TextChangedI * cal Test() set up the text ( ) ...
0
votes
1answer
66 views

How to automatically execute a command every time visual mode is entered and every time normal mode is entered

I would like to execute a command every single time I enter visual mode and another command every time I leave visual mode. Is there a way to achieve this? My objective is to automatically record ...
0
votes
2answers
32 views

How to remap Autocomplete on Control+N, to Control+Space?

I am trying to remap this functionality: to Ctrl+Space, by using this line in .vimrc inoremap <C-Space> <C-n> However, I can not seem to get it to work. If I press Ctrl+Space after ...
1
vote
2answers
232 views

Unexpected behavior from cb command

One of the most basic editing commands is c<motion> to change text, e.g. cw - change word, c$ - change to end of line, cc - change entire line, c3l - change 3 characters to the right. My ...
4
votes
2answers
132 views

Diffing two time stamps under selection

Is there a way to make a function in vim that takes the difference between two time stamps under highlight? For example: 1 20:37:00 2 20:42:30 Supposing you highlight lines 1 and 2 and run the ...
1
vote
0answers
42 views

Vim is highlights everything after EOL in yellow upon scrolling

My vimrc: http://ge0rges.com/vimrc My environment is: Ubuntu 18.04 in WSL on Windows 10. VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 06 2019 17:31:41) Included patches: 1-1453 Modified by pkg-...
1
vote
0answers
28 views

Is there a way to make a command running inside a vim terminal open files in buffers?

I often find myself operating in the vim terminal needing to edit a few files. In this case I might type vim *.h. This opens a new vim instance nested inside my vim terminal. Is there a way to make a ...
1
vote
1answer
24 views

Calling g@ from a a vimscript function

I want to call g@ from a function. Given an operation: " Taken from :help g@ function! CountSpaces(type, ...) let sel_save = &selection let &selection = "inclusive" let reg_save = @@ ...
0
votes
1answer
36 views

Where are the compile options documented with the actual switches?

If I look in the documentation for Vim, it lists the compilable features, but: this list shows the feature as the help output, not how the feature is actually configured during the build. For example, ...
0
votes
2answers
53 views

Cursor in middle of the screen at start and end of file

I'd like to keep the cursor at the middle of the screen wherever I am in the file, without scrolling. This mean to have blank space above the file when I'm at the start of the file, and have blank ...
0
votes
0answers
13 views

gvim window completely frozen

I have a problem with gvim on Fedora 30: when opening a file, the content is displayed, but then the window is never refreshed. Already tried a lot of different solutions, with no success: CTRL-L ...
1
vote
1answer
20 views

Error With Simple Function Using setline()

I'm trying to start writing some Vim Script, and I've come across this issue. fu Test() call setline(1, getline(".")) endf autocmd InsertCharPre * call Test() This is in my .vimrc. When I type ...
0
votes
1answer
23 views

I want to save my typescript file, and immediately run tsc myfile.ts from inside vim. What is the best way to accomplish this?

I am building a daemon, and nodemon currently monitors a file called server.js, which is compiled from the file I am working on, server.ts In order to compile server.ts, after saving with :w, I need ...
3
votes
0answers
55 views

Highlight tag matches for better visibility

When I search for occurrences of some frequent pattern (lets say finding a c symbol), I'll get a list of suggestions at the bottom of vim. Is there a way that the pattern is highlighted for easier ...
1
vote
2answers
31 views

How can I edit the contents of my clipboard in vim?

Often while editing (say, a post on this network), I find myself wanting to copy something, edit it, and paste it back. At other times, I have some text in my clipboard, but isn't perfect. I would ...
1
vote
1answer
16 views

detecting insert-normal mode

I notice that when in insert, pressing <C-o> will take me to normal mode, but once I finish pressing a sequence of keys, I get taken back to insert mode. I find this very useful, but I want a ...
0
votes
1answer
40 views

how to prevent resize of my split windows on every call of term_start() if I do need to use 'termwinsize' option

I have 2 files opened in a vertically split window. I call term_start() and get results in a split window below. I use something like this: :let foo=term_start("some_script", {'hidden':1, '...
0
votes
0answers
10 views

Refactoring Ruby imports

Is there any way in Vim reliably refactor (i.e. rename, move up or move down directory structure) Ruby’s require_relative statements? I’ve searched thoroughly and couldn’t find any plugin or CLI tool ...

15 30 50 per page