All Questions

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

Autocompletion doesn't work when using ALE + deoplete

From my init.vim (I've checked that it doesn't work even with a minimal configuration): call plug#begin() Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'dense-analysis/ale' Plug '...
0
votes
1answer
20 views

vim: can non active tab being completely hidden, no headers show /c/e/n alike

When open multiple tabs, it will show in the topmost line something /c/e/n... alike. But I already has filename and &modified in status line, which just waste space then. Also I find that line ...
0
votes
1answer
29 views

Override longer mappings

Is there a way to trigger a certain short mapping i.e. \c without waiting to see if there is a longer one that starts with the same characters (effectively disabling all other overlapping mappings)?
0
votes
0answers
14 views

cannot build with x on centos

I installed the x11 libs with: yum install ncurses-devel libX11-devel xorg-x11-server-Xorg xorg-x11-xauth xorg-x11-apps When I tried to build vim from source: ./configure --with-features=huge --...
1
vote
1answer
71 views

Operator Modifier

I have been using vim mode for atom for quite a while, recently I've been trying to switch to nvim, but I can't seem to find a way to replicate the operator modifiers behaviour, which I've come to ...
0
votes
0answers
27 views

What is the “stuck text” that happens on my screen as a byproduct of a plugin? How can I remove it?

When I'm using Vim in the terminal, I sometimes get stuff like this: The square bracket floating is what I'm talking about. When my autocompleter plugin stops completing, sometimes it "forgets" to ...
0
votes
1answer
26 views

Make autocmd fire in a macro

These are the two lines of code responsible for inserting matching characters in my matching plugin let s:cur_split = [s:cur_split[0], s:match[press] . s:cur_split[1]] cal setline(".", join(s:...
2
votes
3answers
183 views

Moving to the end of the last word on a line

There are commands to distinguish between the beginning of a line (0) and the beginning of the first word of the line (^), basically ignoring leading whitespace. But I can only find one way to move ...
3
votes
2answers
102 views

How to use 2- or 3-letter :substitute commands?

:help change.txt mentions 2- or 3- letter :substitute commands, such as :sg, :sgn and so on. I am guessing that these :s[xx] correspond to flags, but am not sure how to use them. For example, I ...
0
votes
1answer
43 views

How to break lines into a certain amount of characters?

I have a long text file (300 lines), and I would like to format it so each line is not longer than 50 characters. For example, we have: I have a really long text, I have a really long text, I have a ...
1
vote
1answer
45 views

Avoiding unwanted TextChanged events to avoid 'modified' (hex editing)

Huh? From this interesting post, I took the idea to incorporate xxd into vim a little more nicely than the usual %!xxd. So I started structuring the code and testing. (It's a first draft.) Link to ...
0
votes
0answers
40 views

Add character to iskeyword string, but only at the beginning of a word [duplicate]

I wondered if it is possible to add a character to iskeyword or similar, but such that it is only allowed at the start of the keyword. Use case: TeX macros start with \ Related question: Possible to ...
0
votes
2answers
34 views

Get number of commas in a line using Vimscript

This question may have an obvious answer that I'm missing, but how can I easily tell how many of a character, in this case " , " are in a line, or a specified string using vimscript?
1
vote
0answers
48 views

neovim hlsearch not working

I'm testing neovim and for many thing it is working way faster than vim (I use many plugins ~80, and I can really tell the difference with neovim). All the same config files worked out of the box, but ...
0
votes
0answers
34 views

Send keystrokes and string to gdb terminal

I started debugging a c program inside vim with: :packadd termdebug :Termdebug with vim 8 and and gdb > 8.3 installed. In order to set a breakpoint, I would like to send the following string while ...
0
votes
2answers
42 views

Search for a word and if occurs, delete it and move to the end of line

I need to search for a certain word, and if it occurs, move it to the end of the line where it occured. For instance, search for "bugs". Welcome! Meta Stack Exchange is intended for bugs, features, ...
0
votes
1answer
34 views

Search for lines that do not have certain characters in a row

I have a news article which I need to edit up a bit. Basically, I need to search for all lines that do not contain characters t and h 2 or more times in a row and replace 4 letter words with character ...
0
votes
0answers
31 views

Center current line to the center of screen when opening a file

I would like to execute 'zz' to center the current line to the center of the screen when opening a new file. I have tried the following, but it does not seem to be working for some reason: autocmd ...
0
votes
0answers
47 views

Find out last used text object

I'm trying to figure out a way to make a repeatable operator insert. To do so I'm trying to make use of tpope/repeat. My idea is to set a repeatable call that repeats the last operation, repeating the ...
2
votes
1answer
36 views

visit file from quickfix list without populating oldfiles

I like consulting my oldfiles to see what I've been working on recently and to make it easy to find files that are buried deep in various directories. Before I started using the grep and make commands,...
0
votes
0answers
36 views

Is there a SafeState equivalent in neovim?

I have the following function that I'm porting to neovim: " --------------- " Auto record visual mode " --------------- " Allows executing operators with a different syntax. " First we go to visual ...
0
votes
1answer
40 views

“Wait” key in :map

In my .vimrc i have :imap .. .<C-x><C-o> and it work as it should (double dot to open menu with fields). But I also want to be able type text like [1..MAX] as you can see here vim will ...
0
votes
0answers
14 views

buffer name of opened directory in netrw disappears sometimes

I usually open a directory in vim with command :e path-of-dir. Because the plugin Netrw is included by default, this will be taken over by it and a netrw window will open with the content of the dir. ...
0
votes
2answers
49 views

Making operator insert and append repeatable

Is there an insert and append operation that can be followed by a text-object? I've found this plugins: https://github.com/deris/vim-operator-insert https://github.com/mwgkgk/vim-operator-insert ...
0
votes
1answer
50 views

How can one use jk to escape universally without causing hang?

Recently I was reading http://learnvimscriptthehardway.stevelosh.com, and he said a very fast way to improve your speed in vim is to do inoremap jk <esc>. Sure, that made sense. Then when I ...
1
vote
0answers
72 views

What happens when error occurs during cdo?

:h :cdo says: When an error is detected execution stops. The last buffer (or where an error occurred) becomes the current buffer. Let's see what really happens: ...
0
votes
1answer
28 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
41 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
38 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
30 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
227 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
50 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
63 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 ...
1
vote
2answers
73 views

Where do I fix partial words incorrectly identified as errors 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
25 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
32 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
38 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
22 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 ...
8
votes
2answers
419 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
62 views

Behaviour of BufEnter

In neovim, open two different buffers as follows (using :vnew, for example): *--------------*--------------* | | | | 1 | 2 | | | ...
3
votes
2answers
83 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 ...
1
vote
1answer
23 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
47 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
266 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
39 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
56 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
26 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
21 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
16 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
27 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 ...

15 30 50 per page