All Questions

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

Open netrw view of directory with Ctrl-P

Is it possible to use Ctrl-P to search for directories in addition to searching for files? I want to be able to search for directories in my project in whatever mode (CtrlP, CtrlPMRU, or other) and ...
0
votes
0answers
10 views

Two lines in command area how to make a single line

I have two lines in the command area. How to make a single line?
0
votes
0answers
3 views

How do I stop my cycles LSP (using coc.vim) from displaying wrong errors?

I installed coc.vim and I am using it along ccls.It works well ,except that I get weird warnings for some parts of my code. Here is my .ccls file: clang -isystem /usr/local/include -isystem /...
0
votes
0answers
5 views

TeX file, search outside math

Well, the question is clear. I want to search only on text that is not inside \[ \] or $ $ . Is there some readymade code to do so? Thanks.
0
votes
0answers
11 views

Appending file format while turning text into link (by pressing Enter) in Vimwiki

When using the vimwiki plugin, when you want to convert any text into a link you can press enter on the selection. Then you follow the link, create the file and work with it. The problem: When you ...
0
votes
1answer
16 views

Ignore some files when using viminfo+=%

I use in my vimrc the following option: set viminfo+=% This allows vim to open the last edited files if you don't pass any arguments to vim. Is there a way to ignore some files? I want to disable ...
2
votes
1answer
32 views

How to comment List item?

There are times I want to comment List items: let test_data = [ \ " description in comment \ complicated_data0 \ \ " description in comment \ complicated_data1 ... ...
0
votes
0answers
49 views

Move/copy range to start of current line

I just learned about the shortcuts that allow you to manipulate ranges, e.g. :+5,+10co. to copy after the current line. I wondered if there is a way to copy and move at the start of the current line? ...
2
votes
6answers
386 views

Running code in a different tmux pane

I am new to vim and tmux. TL;DR I want to have tmux set up so that I have a pane for my (python) code and a pane for the output of the code. What I know Now, from vim I can do a command like :!...
0
votes
1answer
30 views

Replay a vim macro until specified line number

Suppose caret is on the line 10 and I've recorded macros @d. I need to replay macros until line 25. If I know that macros move caret one line per execution, I can calculate that it should be executed ...
1
vote
2answers
41 views

Make a buffer active by its number

I'm configuring a terminal buffer and now I have the following problem. I have only one terminal buffer and I need to make it active by its number to avoid lots of CTRL-w j/k/l clicks. Here is what ...
1
vote
1answer
27 views

Namespace color scheme

Hi I'm a new vim user (1 week), I just switched my color scheme to monokai, however a point let me dissatisfied, c++ namespaces are not highlighted. I tried : hi namespace guifg=[my color] and hi ...
2
votes
2answers
23 views

Can the temp gzip decompression location for the integrated help documents be changed from /tmp?

Is it possible to configure vi to use a different location, say my home directory, for the uncompressed help files (or maybe to open them in RO if that's the problem)? When attempting to open a help ...
1
vote
0answers
33 views

search highlighting only in the current buffer

I know that I can run a search in vim using /. I prefer having search highlighting turned on, but if I have a two splits with different files open, and I search for a term in one, they get highlighted ...
0
votes
0answers
21 views

Is it possibile to get out of brackets automatically after just one word?

I'm currently using pear-tree as an automatic brackets closing plugin. So when I type, for example: print( I get print(|) The functionality I'm looking for is to get the cursor out of the brackets ...
1
vote
1answer
40 views

How can I hide and scroll popup window in coc.nvim in Vim?

How can I scroll and hide a floating window in Vim using the coc.nvim plugin? I added these mappings to my vim.rc file but I still cannot manage it. I would expect if I press ctrl+f once I have a ...
0
votes
1answer
35 views

function variable scoping and arg types problems

I'm trying to make a small extension/bug fix to a plugin I rely on (referenced as Plugin in the code snips), therefore I'm constrained by its existing API. I've got the functionality I want somewhat ...
1
vote
1answer
42 views

How to truncate all lines at a certain length?

Much like this question, I've failed to put this together successfully on my own. I want to truncate lines in my file so that no line is over 100 characters in length. I can go to position 100 on ...
2
votes
2answers
27 views

Map CTRL-& in vimrc

I'm trying to re-map tagbar toggling with <C-&> that I get used to when working with IDEs. But setting execute "nnoremap <C-&> :TagbarToggle<CR>" does not have the ...
1
vote
1answer
23 views

Show terminal buffer in airline's tabline

I use airline's tabline to show a list of my current buffers: Plug 'vim-airline/vim-airline' let g:airline#extensions#tabline#enabled = 1 " Use the airline tabline (replacement for buftabline) let g:...
2
votes
1answer
53 views

How to create command with -register and <reg>?

I have never used :h :command-register and :h <reg> , trying to find an example, but failed to grep \-register from my installed plugins, The built in :h :delete support a count and an optional ...
1
vote
1answer
18 views

Highlighting comments to EOL (terminal EOL, not buffer EOL)

One of my filetypes has a special comment format that has a background color, and it would be useful if I could extend the highlighting to extend that background to the terminal width, rather than ...
0
votes
2answers
28 views

Enable cursor blink in all modes for terminal Vim

I am relatively new to vim and tried to understand this article and also read :help guicursor and inserted this line in my .vimrc set guicursor+=a:-blinkwait175-blinkoff150-blinkon175 But it didn't ...
1
vote
1answer
31 views

How to set custom shortcut in vim?

I want to make use of Shift+Tab to left-shift (unindent) a block of text, instead of Ctrl+d. How to do it?
0
votes
2answers
67 views

vi/nvi (FreeBSD) How to make an abbreviation to a shell command?

I know how to make an abbreviation to a command in vim. For example to print the date, I have this in .vimrc: iabbrev mydate <C-R>=strftime("%a %d/%m/%Y") Now I'm running a VM with FreeBSD as ...
6
votes
2answers
471 views

How to Insert a console.log for word under cursor in new line

Disclaimer: I tried to find a generic title for this question but I was overcomplicating the whole thing... Use case: In a JS file, I have an expression like: if (someVar === 'someValue') { ...
2
votes
1answer
45 views

Syntax highlighting stopped working

I was just started with Vim. While experimenting with basic customization techniques, it began to behave differently. Somehow the default configurations changed to very basic for both GVim and ...
0
votes
0answers
7 views

Why does YCM clang emmit different error than gcc on overridden methods? [closed]

consider the simple code class HotDrink{ public: virtual ~HotDrink() = default; virtual void prepare(const int& vol) = 0; }; class Tea : public HotDrink{ public: Tea() = ...
2
votes
1answer
35 views

How to open internal MediaWiki links with their full URL from within Vim?

I have a file in Mediawiki format, containing internal links (in a Mediawiki installation) * [[Topic A]] * [[Topic B]] * [[Vim]] (The asterisks are how MediaWiki lists are formatted, they are not ...
0
votes
2answers
33 views

Save buffer before opening new file

When I'm in a modified buffer and try to open a file using :e otherFile I get E37: No write since last change (add ! to override) Since this happens fairly often, I'd like to automatically save ...
1
vote
1answer
33 views

Toggle terminal buffer vimscript function

I'm new to vimscript and writing a function to toggle a terminal buffer. Here is what I tried: let g:toggle_term = "<C-j>" let g:term_buf_nr = -1 function! ToggleTerminal() if g:...
3
votes
1answer
30 views

Sourcing vimrc duplicates statusline in nvim

I'm new to vim so I'm not sure if this is intended behavior or not, but it seems like a bug. Desired Behavior After sourcing vimrc from within nvim, don't duplicate the contents of my statusline. Or ...
1
vote
1answer
21 views

Change definition of “under the cursor” for ctags with C++ qualifiers

When jumping to a tag it seems that ":" are ignored for the purpose of "under the cursor" (I'm assuming it's "word" "under the cursor"). For example if I want to jump to myTree::Node something I ...
2
votes
1answer
34 views

Visual/Operator-pending autocommand?

Last week, I turned off 'number' and have been using only 'relativenumber', plus a line/column count in my status line. I don't really look at line numbers that much. But now I've had a radical idea. ...
0
votes
1answer
24 views

Is it possible to make a terminal frame to be appeared on the bottom, not on the top?

I'm using :term bash to show a terminal buffer as it is specified in :h terminal-use. But the problem is that it is appeared on the top of the currently active vim buffer. Is there a vimrc ...
0
votes
1answer
25 views

change fold sign character

I know per my question remove trailing dashes in foldtext that I can remove the trailing dashes from collapsed fold lines. When a fold is 'open', the sign column has pipe characters '|'. I looked at ...
1
vote
1answer
28 views

How to fold nested “if then else end if” statements

I try to write a vim syntax file for folding if-else statements with the syntax: if <condition> then <block to fold> [else <block to fold>] end if Current approach syn region Then ...
0
votes
0answers
18 views

How can I create a customized vim [in my own pc] and could install it on every server that I use in future?

I like my own plugin full vim that I use, but every time I ssh to a server I have to reinstall those plugins and customizations. Does anyone have an easy method to install my own customized vim on ...
0
votes
0answers
31 views

coc not working in latest vim

I've installed coc following the instruction, using Vim-Plug (before that I did it without installing yarn and with kite still (partially) installed. I got a 'javascript file not found' error So I ...
0
votes
1answer
36 views

Can I use feedkeys() inside of a keyloop implemented by getchar()

I implemented a fuzzy filter, which accept a list argument, open a window with a scratch buffer whose content set to the list, then waiting for use input and do filtering. Here is why I ask this ...
3
votes
1answer
29 views

remove trailing dashes in foldtext

When I set foldtext to a simple value like getline(v:foldstart), vim should show the current line, as opposed to the usual + and appropriate number of hyphens - for the foldlevel. However, vim fills ...
0
votes
1answer
18 views

Line position after quickfix jump

I'm using fzf's Rg command to populate QuickFix window with all search results. I also have my own mappings to :cn and :cp commands. Everything is fine except one thing when I press mapped key for :...
4
votes
2answers
111 views

Is it necessary to always add ! to function and command

I can't remember start from when and why, i always add ! to function and command: function! .. ... endfunction command! ... But :h E122 says: When a function by this name already ...
0
votes
0answers
32 views

“earlier 1f” broke if I save twice?

To reproduce it : make first change. save make second change. save save (I have a bad habit to save twice sometimes.) execute :earlier 1f , both changes lost. What's even weird is that you need to ...
2
votes
1answer
18 views

Interaction of object-select with double quotes

I'm trying to understand logic of text-object-selection in the presence of double qoutes. In the following lines * denotes cursor position, // denotes my comments. a"b(c*d)e"f //di) deletes ...
1
vote
1answer
48 views

Highlighting arbitrary text

When I'm writing, I often have 2-3 buffers open. My main body of text in the middle, and then supporting materials on the left and right. I often read a paragraph from one of the supporting buffers ...
-2
votes
0answers
21 views

Numbers transferred from beginning to the end of a string REGEX [closed]

tester.84tester:tester -> tester.84tester:tester84 this is what I need to be done, thank you for any help.
1
vote
1answer
25 views

Autoreload vimrc when writing to vimscript files

I wanted to have my vimrc automatically update when I write to a .vim file using this autocmd: autocmd BufWritePost *.vim,$MYVIMRC source $MYVIMRC But for some reason when I have this enabled and ...
0
votes
1answer
30 views

what is the purpose of the view folder in the .vim folder?

I got an error when opening my .vimrc with vim saying ".vimrc" 138L, 3781C Error detected while processing /home/fbence/.vim/view/~=+.vimrc=: line 117: E518: Unknown option: termkey= line 118: ...
1
vote
2answers
28 views

Move cursor and screen together

I am implementing a smooth scrolling function for <C-u> and <C-d>, which just sleeps for a few milliseconds and then moves the screen up (<C-y>) or down (<C-e>) one line: ...

15 30 50 per page