All Questions

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

cannot find the viminfo file to fix the E575 error windows 10 wsl

I only have a limited experience with coding and mostly chop together python scripts for doing simple tasks. I have been using VIM/VI for a while but my computer ran out of space while writing a file ...
2
votes
2answers
26 views

Fix indentation in a file while keeping cursor on the same line

I'd like to use vim's builtin indent fix feature on an entire file. I have looked up answers, but all I found were suggestions to type gg=G, the only problem being that it brings your cursor to the ...
1
vote
1answer
20 views

Detect that user pressed ESC in getchar()

It looks like quite a simple question, but I cannot find an answer. Is there a way to detect that the user pressed ESC key while waiting for user input in vimscript? I would like an intuitive way to ...
1
vote
0answers
19 views

How to make code-folding more efficient

I have a ruby file while is about 5K+ lines long. My current setup uses the vim-ruby plugin. With this, I enable code folding with let ruby_fold = 1 This opens my ruby files pre-folded. I can open ...
2
votes
3answers
117 views

How to apply a macro for every single matching pattern

Macros can be repeated for every line matching a pattern with the global command as explained in this answer. This applies to every single line, but is it possible to do it for every single match? so ...
0
votes
3answers
34 views

How do i open Vi after I installed Vim?

I discovered vi/vim only yesterday on my ubuntu I didn't have vim installed, only vi I enjoyed its simplicity and minimalism then I decided to try vim too, ran sudo apt install vim, played with it ...
0
votes
3answers
36 views

Redirect output of vim command to external program

I would like to filter the output of vim commands with fzf. The idea is for example, if I use vim unimpaired plugin and I don't exactly remember which map was to navigate to the next git conflict but ...
0
votes
0answers
16 views

Where do I fix “false positives” with spell?

I upgraded MacVim to 8.1.2168 (159) tonight and now the vimwiki files in Markdown format do not highlight correctly when I enable spell check. I run set spell spelllang=en_ca as I have before. It ...
0
votes
1answer
21 views

don't capture stderr for git grep as grepprg

I'm trying to use git grep as my grepprg, but I keep getting spurious files such as ~/fatal: Not a git repository (or any of the parent directories): .git. Is there a way to configure vim to correctly ...
2
votes
1answer
26 views

Is it possible to disable the column on the left that is created by ALE?

I installed the ALE plugin, and I really like the highlighting, though the sign column shown in the far left of this image is distracting to me and seems unnecessary given that errors and warnings are ...
1
vote
1answer
31 views

Vim changing the text objects of " in a single line with less number of keystrokes?

Consider this situation, which I often follow in python and consider that my cursor is on the letter a of args: args = ap.add_argument("-i", "--texture", type = str, required=True, help="path of the ...
1
vote
0answers
20 views

Can you use Syntastic in Vim over a subset of code in a file?

I use Vim as my main text editor and use Syntastic to assist with linting. I am editing large legacy python files (some upwards of 50,000 lines) and would like to run SyntasticCheck over a range or a ...
7
votes
2answers
378 views

How to move a paragraph and paste it without an initial newline first

If I have a pair of quotes on a line by themselves: '' ...and a short paragraph of text, say three lines of text: some text that I'd like to move Now if I want to move the text into the quotes, I ...
2
votes
1answer
55 views

Behaviour of BufEnter

In neovim, open two different buffers as follows (using :vnew, for example): *--------------*--------------* | | | | 1 | 2 | | | ...
2
votes
1answer
40 views

Could someone explain “rolling one's finger” when used in a Vim context?

From a recent reddit post I saw: https://old.reddit.com/r/vim/comments/bm0ihb/evolution_of_a_vim_user/emt4p4a/ I keep seeing jk, am I the only one who does kj? It feels more natural to roll from ...
0
votes
1answer
19 views

Closing the “list of files in a directory” when having Vim to open the directory

In the following screenshot, I demonstrate the following operations that shall yield a "buffer" that cannot be closed. My guess is that the list of files/directories is actually not a buffer. My ...
0
votes
2answers
37 views

Is it possible to reverse an existing highlighting group?

Is it possible to automatically create a highlight which is the reverse of an existing highlight? Example highlight Search guifg=Black guibg=Yellow, becomes highlight CustomHighlight guifg=Yellow ...
3
votes
2answers
248 views

What is the proper way to allow the user of a plugin to modify settings?

So I have a plugin that I am writing which should allow the user to set whether they want to enable a feature. I want the feature to be disabled by default, and allow the user to change it by adding ...
1
vote
1answer
28 views

Underscore suddenly a word boundary

I now have Vim version 8.1.2102 from Sep 30 2019 15:45:59 on Fedora 30. For some reason the word boundary in C++ code now also includes the underscore somehow, so I see this: When I have the cursor ...
1
vote
1answer
49 views

How to paste text after each line matching a pattern?

I have a file like this: int var; int f() { // Use of var } int g() { // Use of var } int h() { // Use of var } // ... I want to move my global var into each function to get this ...
0
votes
1answer
21 views

How can I keep the cursor position when piping the buffer through an external command?

I sometimes make shortcuts for myself, which run some external command on the current buffer, such as nnoremap <C-f> :%!clang-format -style=file<C-m> which formats the buffer with clang'...
0
votes
0answers
19 views

navigating dictionary completion

In my vimrc I have the following mappings: set completeopt=longest,menuone,preview inoremap <C-h> <C-n> inoremap <C-k> <C-p> inoremap <Leader>k <C-x><C-k&...
1
vote
0answers
12 views

Wrap matches shown by You Complete Me

Is it possible to wrap the matches shown by YCM ? My current workaround is to decrease font size till I am able to see it and then increase font size. This is tedious and painful. Is there any other ...
0
votes
1answer
26 views

Vim session swaps files around

I create a session using :mks, which has tabs and split views inside tabs. When I open the session using vi -S Session.vim, some of the files are swapped around. I have tried deleting and creating new ...
1
vote
1answer
20 views

Vim different colorchemes for different file, but same backgroung color

I'd like to have a colorscheme but keeping my terminal color as a background color. This code achieved that colorscheme MyFavoriteOne autocmd ColorScheme * highlight Normal ctermbg=NONE guibg=NONE I'...
1
vote
0answers
30 views

How to make “view” read vimrc?

view is the readonly mode of vim. I would like view to read the exact same .vimrc file for its initialization as vim already does. view does not seem to read ~/.vimrc by default (I checked by adding ...
1
vote
1answer
27 views

How to remap escape in *vi* (not vim)?

I've used the information in this answer previously, but recently encountered a minimal installation with only vi. I edited the .vimrc in the user's home folder (~/.vimrc), but when typing jj, the ...
0
votes
1answer
19 views

Why doesn't i<Ctrl-R>=expandcmd('se shm') work?

I'm trying to do i<Ctrl-R>=expandcmd('se shm') and more generally i<Ctrl-R>=expandcmd({expr}) but I'm just getting the literal {expr} inserted. When I type :se shm<CR> I get the ...
2
votes
0answers
22 views

Cannot :Explore public ftp service (I see empty listing with ../ and ./)

The address is ftp://ftp.yandex.ru/ I tried from bash: vim ftp://ftp.yandex.ru/ After that I was asked for username and password (but this is public anonymous server), ok I entered anonymous for ...
4
votes
1answer
71 views

Cursor Column in Visual Selection

What is the correct way get the column of the cursor after a visual selection was made? As a simple example, consider the following command. It takes a range and I am trying to obtain the column to ...
-1
votes
0answers
23 views

gvim enter, space bar and escape key - <9b> [on hold]

In vim 7.4.160 version , when i use Enter, Space Bar and escape keys, im getting <9b> character on my screen. kindly let me know the solution to revert it back. Thanks Suresh
0
votes
1answer
24 views

Permit closing window with unsaved changes using vim setting

I wrote a plugin that executes a slow shell script and asynchronously shows the stdout in a popup (split) window. When I try to close my session while the popup is open, I get the message Save ...
0
votes
0answers
18 views

Getting conflict when setting ft=txtfmt

I installed The Vim Highlighter plugin by Brett Stahlman. The plugin requires setting filetype=txtfmt. I set the option using :set ft=txtfmt but got conflicts like Level 1 map ambiguity:[bf already ...
2
votes
1answer
23 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
1answer
51 views

How to match a word not following a defined pattern?

I have the following text file: 1: This is 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 occurrences of book not ...
1
vote
1answer
51 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
49 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
1answer
28 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 ...
2
votes
1answer
175 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[/]...
1
vote
2answers
68 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 ...
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
25 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
76 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
0answers
21 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 ...
0
votes
1answer
28 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 ...
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 ...
1
vote
1answer
62 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
0answers
13 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
0
votes
1answer
38 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
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 ...

15 30 50 per page