All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
13 views

How to put Shift+v in a function?

I'm trying to apply the Shift-v keymap in a vimscript, but not sure how. I tried using <s-v> and Shift-v without success.
3
votes
3answers
216 views

How to list open buffers simplified

I'd like to use ls command to show opened buffers. I'd like to make the output of this command as simple as possible. I'd like to see only the buffers' names, numbers and status (#,%,+,..). I don't ...
1
vote
2answers
126 views

Check if a specific window is open

I have a window in vim opened (current file) and another one in split called [Scratch]. I want to check if the [Scratch] is open or not. Any example is appreciated.
1
vote
2answers
25 views

How to replace everything between PORT= and )

I have a (copy of) oracle listener log, and would like to replace the portnumber in every line. These are always of the form (PORT=1234) with sometimes 4 and sometimes 5 numbers. So an exampleline, ...
1
vote
1answer
61 views

How to use read instead of execute in a function?

I'm trying to search for the selected line of a file using the following: function! GrepSelection() normal! gvy let result = escape(@", '\\/.*$^~[]#') let result = substitute(result, &...
1
vote
1answer
21 views

Installed Ale linter using Pathogen, but none of the commands are working

I followed the documentation for installing Ale using Pathogen but when I open a Vim file and type :help ale-fix or :ALEFix I get E149: Sorry, no help for ale-fix and E492: Not an editor command: ...
1
vote
1answer
102 views

Yank multiple lines without using visual mode

I have the text: abcd abcd abcd abcd my cursor is in the first line, and I want to yank the first 2 lines. Usually I would do it by pressing Shift+v, selecting the second line by going down with j ...
1
vote
2answers
30 views

Why does a range search “:[range]/pattern/action” not work the same way as “:[range]g/pattern/action”?

Can someone explain why range search :[range]/pattern/action does not work the same way as :[range]g/pattern/action? Also :'a,'b/pattern/action gives a warning that the range is 'backward', even ...
3
votes
1answer
40 views

How can I make a new line in my _vimrc after using the normal i command?

I'm very new to Vim and I have some ASCII art in my _vimrc. I've inserted it there using normal i, but it doesn't display properly, because the normal i commands don't have a line break at the end. I'...
-3
votes
0answers
38 views

why what i copied from firefox in endeavouros linux won't get into “+ nor ”* registry in vim? [duplicate]

i am trying out en.os from a live usb, i need to write down some note to my existing note.txt from this en.os. but somehow what usually a no probwhy what i copied from firefox in endeavouros linux won'...
0
votes
1answer
67 views

Neovim automatically run command when opening a filetype from ftplugin file

I have Neovim setup with configurations for file types separated into ftplugin files. I would like to have Neovim start the Goyo plugin when I open a markdown file. However, I would like to keep this ...
1
vote
2answers
82 views

Open file, make changes, save it as a new one. In one step, using the Windows command prompt

I have a file foo.txt with just a one line ab. I want to launch Vim in such a way that it will open this file, swap characters using xp, and then save it as bar.txt. Something like this: gvim foo.txt ...
2
votes
0answers
26 views

gvim on ubuntu breaks the console when calling system command in vimrc

I use this version VIM - Vi IMproved 8.2 (2019 Dec 12 kompiliert am Aug 29 2020 14:11:37) Inklusive der Patches: 1-1539 Verändert von jonathon.fernyhough@york.ac.uk Übersetzt von jonathon.fernyhough@...
1
vote
1answer
43 views

Yank visually selected text: Keep virtualedit & avoid left/right padding

I use Cygwin's vim & gvim. I used to be able to do as follows. Consider this file mk.bash, with no right-padding spaces: // mk.bash // ------- javac \ -classpath "/c/Program Files/MyJarFile....
2
votes
1answer
32 views

Where is the help function defined or located?

I'm trying to find where the help function/command is defined. So far I tried: :verbose function help but since the h isn't in uppercase, it doesn't work (not sure if it's even a function at this ...
0
votes
1answer
47 views

How to open a command in a split window?

I'm using grep in vim to do something such as: :grep pattern file and have a key-map for it that looks like that: function! Escaped() call inputsave() let result = escape(@", '\\/.*$^~[]#...
2
votes
0answers
38 views

Is there some way to retrieve/redisplay :echon output?

I want to create a multi-color enabled debug-print command. As far I know, the only way to print multi-color messages in Vim is: echohl Macro | echon "Hi" | echohl Statement | \ echon &...
1
vote
0answers
14 views

automatic popup in vim with clang_complete plugin

I want to use Vim to program in clang (*.c and *.cpp). At the moment I am trying to use the clang-complete plugin and I like the autocompletion but I have to use the <C-n> or <C-p> ...
0
votes
0answers
15 views

In Vim how can I compile my .tex file automatically after pressing ':w'? [duplicate]

I just did: cd ~/.vim/bundle git clone https://github.com/lervag/vimtex.git as Karl said, then how can I compile because He just do not explain it ¡ ..?
1
vote
1answer
34 views

Can I remap y key in vim-surround plugin?

I use langmap to be able to use QWERTY-like layout for normal mode, and Bépo to input text. Key      |      Usage  y   maps to    x  ç   maps to    y However, I can’t use vim-surround to add ...
4
votes
2answers
62 views

How to open folds in a pedit-preview popup window?

I'm displaying a file contents by using :pedit …the-file-path…, to then call popup_setoptions(…the-ID…,#{firstline:anumber}) in order to scroll the popup and highlight/show the desired part of the ...
0
votes
1answer
22 views

Grep for a pattern using current visual selection on another file

I want to basically search for a pattern in the current file on another file, from vim, using the current visual selection. I know doing: :grep pattern otherfile works, but i want the 'pattern' to be ...
1
vote
1answer
37 views

Ctags doesn't find tag existing in tag file

I've been having some troubles with setting up ctags and vim with a large project I'm new at. The tag files seem to be generating properly (specific options are: --sort=foldcase --recurse --extra=+q --...
2
votes
1answer
43 views

Is there going to be a VimConf this year?

Since Covid-19 hit, many conferences have been canceled or moved online. Are we going to have a conference for Vim and NeoVim in 2020?
0
votes
1answer
21 views

How do I turn off specific listchars in my current file?

In my .vimrc file I have listchars set to showing tabs and trailing spaces. set listchars=trail:~,tab:>- How do I change my settings for the file I currently have open to stop showing the tabs?
5
votes
1answer
77 views

Why are there no rightabove / leftbelow commands?

Referring to the existing leftabove and rightbelow commands, which do the following: execute a command if the command results in a split, it will be either opened on the left, or above the current ...
2
votes
2answers
27 views

vim-fetch install

I downloaded vim-fetch, but the install instructions are not clear to me: Download and source the most current vimball from the releases list, then run :helptags {dir} on your runtimepath/doc ...
2
votes
2answers
213 views

Efficient way of cleaning up the buffer list

Very often, after days and days of coding, opening vim -S session everytime, I end up with a fair long buffer list that I want to clean. Therefore I use :ls to list all buffers, and then :bdelete ...
2
votes
0answers
25 views

Can I define window position/contents via command line arguments ? Maybe a sort of parameterised session file? [duplicate]

I would like to open, say, 4 files and then have windows arranged in a grid so that the first file was in top left, second bottom left, third top right and fourth bottom right. So a command like this (...
1
vote
1answer
46 views

Pipe :Ag output to a new buffer

I'd like to search for a regex using Ag. This results in more than 1000 findings. I'd like to save these findings in a buffer to be able to go through them slowly
1
vote
0answers
23 views

How can I keep my cursor normal after exiting a terminal buffer?

Right now, whenever I open a terminal with :term, my cursor changes from a half-height/orange cursor to a full-height/gray cursor (depending on the emulator). When I navigate back to another window, ...
0
votes
1answer
20 views

Autosave and Nerdtree conflicts

I was trying to setup NeoVim to autosave each time a change is made. I used this command, which I wrote in ~/.config/nvim/init.vim: autocmd TextChanged, TextChangedI * silent write It works perfectly ...
3
votes
1answer
183 views

Unexpected substitution behavior

I need to put a comma between any two digits in a string of digits. For example, I want this 12345678910 to become this 1,2,3,4,5,6,7,8,9,1,0 The approach I took was the following s/\([0-9]\)\([0-9]\...
0
votes
1answer
34 views

Vim triple button combinations

In vim, many keys in normal mode perform an action only when appended by another character. For example g, by itself, doesn't do anything. But gg goes to the top of the page, gt goes to the next tab, ...
1
vote
1answer
33 views

Vim filter command not using line-wise selection

I may have seen this question before on Vi Exchange but I'm having trouble locating it while searching now. If it's already been answered, please let me know the duplicate and I can find that. I have ...
2
votes
0answers
13 views

How can I use Vim with rmate?

TextMate 2 introudced rmate, which has become a de-facto standard for editing remote files, with multiple implementations of the remote component and client implementations for other editors, ...
1
vote
0answers
28 views

How to debug change in command / key binding behavior (<c-p> / ctrl-p for ctrlp.vim vim plugin)?

I'm using the vim ctrlp plugin, and the <c-p> (Ctrl+p) key binding / command (which invokes :CtrlP) often goes back to the vim default of moving the cursor up a line. I can't figure out why ...
2
votes
0answers
22 views

regard continuous colons as part of a word

I want to regard continuous colons as part of a word. How can I configure the iskeyword option? For example, in ::hoge, the whole thing is a word in :hoge, : is a word, and hoge is also a word in ...
3
votes
1answer
60 views

First new line in multi-line vim commands has broken highlighting

In my init.vim I have the following command: nnoremap <Leader>s :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") \ . "> fg<&...
0
votes
1answer
58 views

What is the rationale of configuration files of neovim?

I switched to neovim some time ago, so I still have files from Vim. I mean, ~/.config/nvim and ~/.vim coexist. However I don't understand, for example: If I install a plugin with vim-plug it goes to ...
5
votes
1answer
73 views

How often and when is foldexpr evaluated?

I want to toggle foldmethod between expr and manual because if we always set foldmethod=expr, then the cursor tends to move slowly in vim. I think that foldexpr is evaluated just after switching ...
1
vote
1answer
23 views

Line breaks while typing but can be fixed after with cap-J

My lines break when I am typing beyond a certain length in vim, but afterwards, if I move up one line and type J, the line will reconnect. So it is apparently not a matter of fixed length. I would ...
1
vote
2answers
64 views

How can I paste text appending it to the end of each line? [duplicate]

If I have file1.txt which contains the following: Line 1.1; Line 1.2; Line 1.3; and file2.txt with the following Line 2.1; Line 2.2; Line 2.3; I want to copy all the lines of file2.txt and paste it ...
2
votes
1answer
28 views

Command to load buffer but not make it current

I can list buffers with :ls and see their load state. I can load all the buffers using :bufdo e and a specific buffer using a range, for instance to load only buffer 2 :2bufdo e, however this makes ...
4
votes
3answers
101 views

create own snippets

I'm rather new to vim. And I don't like much to install many packages. I use html, javascript and react.js, and i would like to create some simple way to type and then have the correct snippet on the ...
2
votes
1answer
25 views

Required to write gvimdiff file1 ..\..\..\file2 to diff correctly

I'm trying to diff two files using gvimdiff file1 file2. This works in certain parts of my file system, but if I'm several directories deep, it stops working. Instead, it'll open three files and one ...
2
votes
1answer
35 views

Are opening and closing double quotes expected to be of different color in a bash script?

I've just noticed, after years using Vim, that the two double quote characters opening and closing a string in a bash script have different colors, which I can verify by simply writing var="var&...
0
votes
0answers
20 views

coc.nvim - no rome found in your project root

I have the latest version of Ubuntu and recently installed vim. I'm trying to get coc.nvim to work. See https://github.com/neoclide/coc.nvim . This is an autocompletion package (and then some) for vim ...
3
votes
2answers
36 views

Is there a way to insert documentation comments into a VIM macro definition?

I have found VI / VIM macros extremely obtuse to understand even a week after I've written them. The syntax of a .vimrc file supports comments on lines beginning with a doublequote character (") ...
2
votes
0answers
89 views

YouCompleteMe unavailable: unable to load Python [duplicate]

I have done PlugInstall but it gives: YouCompleteMe unavailable: unable to load Python. The same error happens while loading UltiSnips: E370: Could not load python36.dll My vimrc: set rnu set nu ...

15 30 50 per page