All Questions

0
votes
1answer
25 views

Where is the command list for the default keys?

I would like to remapping some of the default keys, where I can find all the command name list used by vim?
0
votes
1answer
22 views

How can I make Vimscript check if the current line has a comment?

I want to make a Python ftplugin (but other filetypes will also have this option) where, if the previous line has a comment that starts with #, the next line can be commented via <Shift><CR&...
0
votes
0answers
31 views

Mapping Buffer Movement [duplicate]

How can I configure Vim and MacVim to respond to control-arrow and meta-{h,l} key-presses? The configuration below is ignored by both. I'm using iTerm2 (version 3.2.7), Tmux (version 2.8), and Vim (...
4
votes
2answers
29 views

Command works in ex mode but not during init (call)

When I run this command in ex mode it works without a problem: :call deoplete#custom#source('ultisnips', 'rank', 1000) However, when I put it in my vimrc I get an error: Error detected while ...
0
votes
0answers
12 views

Editing file on remote host using scp not working

I'm trying to edit a file on a remote host using vim scp://user@host//path/to/file However, vim just displays "Stopped" and crashes. Here is the log thats produces when I run vim -V9 scp://user@host//...
2
votes
0answers
12 views

Using an iTerm color scheme inside a Vim :terminal window

My normal terminal color scheme is set via a color preset in iTerm. When I open a terminal window in Vim (:terminal) that color scheme doesn't get applied, presumably because Vim has no knowledge of ...
1
vote
1answer
46 views

Can't make vimwiki honor setting passed via command line

I am trying to write a wrapper shell script that is supposed to launch vim with a vimwiki in current directory: #!/bin/bash gvim -c "let g:vimwiki_list = [{'path': '$PWD/'}] | normal ,ww" The ...
2
votes
1answer
33 views

Search only within a relevant context?

When running through a log file, I will catch a log that's bad, and I want to search around that line for other lines that will match search parameters. Frequently the log files are very long, and ...
1
vote
1answer
24 views

Load current buffer in another pane

I'm writing a plugin where I have several buffers open in split panes ( let's call them small panes ). The user can navigate between the small pane using the usual ctrl+w , wincmd etc ways. While I ...
2
votes
1answer
29 views

How to set group of tabs and 1 single terminal in Vim 8?

I am a Vim beginner. I know you can do :tabnew file1 file2 to have Vim open up a bunch of files name file1, file2 spread across as tabs. I know you can move forward and backward between tabs. My ...
0
votes
1answer
27 views

How use a custom time value in `strftime()`

I am able to use strftime() to convert the current time to a string, but now I need to work the other way around: Convert a string to {time} Modify the time value Convert back to string Is there a ...
0
votes
1answer
31 views

autocmd for markdown textwidth=100 failing

I want to set my markdown files to have textwidth=100 but cannot get it working. The strange thing is that it works sometimes and sometimes not. My autocmd is: augroup auFileTypes autocmd! ...
0
votes
0answers
32 views

An operator pending mapping [on hold]

I have added the following operator pending mappings to my vimrc. onoremap K H onoremap H ^ onoremap J L onoremap L g_ This does not do what I want it to. I tried other suggestions in :h omap-info ...
0
votes
2answers
35 views

How to go up to previous command when in terminal mode in Vim 8?

I am new to Vim. I managed to use :terminal and :vertical terminal to have a terminal side by side with my code. This works great, I can move between my code and the terminals. However, how do I go ...
0
votes
0answers
27 views

BufRead autocmd error for “*.*” and E45

I have vim version 7.4.1689. It was running quite smoothly. But recently I noticed a problem that I didn't have before. Whenever I run :help <something> in command mode the following error shows ...
1
vote
0answers
45 views

How do I configure my VI environment on Ubuntu 18.10?

I have a fresh install of Ubuntu 18.10 and VI is exhibiting behavior I am unaccustomed to. For example, when I insert something using "i", 4 spaces are automatically placed in front of what I've ...
0
votes
1answer
17 views

Detect when at last character when character is multibyte

I have the following command for \ that jumps to the last character unless the cursor is under the last character, in which case it jumps to the start of the line. nnoremap <silent> <expr>...
1
vote
0answers
39 views

Basic and extended regular expression

I have a question: How to search a string using a basic regular expression in Vi editor? How about using extended regular expression in Vi editor?. Is it a real difference between basic regular ...
0
votes
0answers
20 views

Select characters in Visual mode (works differently than Normal mode)

I'm trying to understand the difference in character counting between Normal and Visual modes. Roses are red, Violets are blue, Sugar is sweet, And so are you. The task is to copy everything from ...
0
votes
1answer
37 views

Why does my function sometimes respect whitespace?

I have a few functions to help with adding PHP docblock tags. Suppose a block like this: /** * Does a thing * * | */ Where | is my cursor position. I have a mapping to <localleader>@p, for ...
1
vote
1answer
16 views

How to do a conditional key mapping dynamically?

I know that I can do a conditional key mapping by map-expression: map [key] [condition] ? [foo] : [bar] But now my situation is somehow awkward. I want to map <C-h> to <C-w>h if I have ...
1
vote
1answer
45 views

How to set opfunc to a lambda function?

I've found it's common to set opfunc in this manner: nnoremap <Leader>r :set opfunc=<SID>my_function<CR>g@ With Vim8 supporting lambda functions, is it possible to now set opfunc ...
0
votes
1answer
20 views

Why buffer tab plugin not work with Neovim 0.4

I installed the latest Neovim 0.4 from scratch, install 'vim-plug', then add only 4 lines to my init.vim: call plug#begin('d:/neovim/nvim/plugged') Plug 'ap/vim-buftabline' set hidden call plug#end() ...
0
votes
0answers
13 views

Pixels or half-points for font size?

It seems that Vim use typographic points for font, instead of pixels. Is there a way to: specify font size in pixels or use half-points (set guifont=Yourfont:h10.5)? E.g., I use 14 px Consolas font ...
0
votes
1answer
34 views

How to use fzf :Buffers/:Files commands from vim terminal buffer

When in (Vim) terminal mode, I can use and then :e! fileName to open a file. Note that without the !, the following error message is displayed "E948: Job still running (add ! to end the job)". How ...
1
vote
1answer
19 views

How to have vnoremap call function once?

I'm trying to write a function + map that works on a visual selection. My function just prints out the marks right now: let g:count = 0 function! s:plink(...) abort let g:count = g:count + 1 ...
1
vote
1answer
28 views

Detecting whether colorscheme is available [duplicate]

How can I detect whether a color scheme installed via a vim-plug plug-in is available? For context, I'm trying to automate my Vim setup on a new machine, pulling the vimrc from a git repository. The ...
0
votes
1answer
25 views

Setting $XDG_CONFIG_HOME

My current nvim is in ~/AppData/Local/ and I want to drag it out just one directory below $HOME. How can I set $XDG_CONFIG_HOME, and can it be done via Neovim?
0
votes
0answers
27 views

How to get the current word starting from the cursor?

In vimscript expand('<cword>') gives me the word under the cursor. How can I get the word under the cursor starting at he current cursor location (skipping the word start).
2
votes
1answer
22 views

':norm dtxdty' works different than '0dtxdty', what's happening?

On line ay, 0dtxdty deletes the a (as I would expect), but :norm dtxdty does nothing, norm! and exec don't change it. I wanted to use it as part of a command to align as explained here, but to two ...
2
votes
1answer
29 views

How to close several windows with one mapping?

I use CTRL-W c to close current window. I expected that 5 CTRL-W c close 5 windows in row, but it's not. Now I just type CTRL-W c 5 times. What is correct way to do it and why it don't work as I ...
0
votes
1answer
20 views

vim looks different when i launch it via the terminal

I'm using NVIM 0.2.2. When I launch it from the terminal, the color scheme of the terminal affects it's look. And when I launch it from the search menu, it works just fine What makes it behaves that ...
0
votes
1answer
26 views

Is there an fzf for finding an open tab?

I would like to be able to open up vim foo.md foo.css foo.html foo.ts And either be able to run :Tab md or the like and jump to the foo.md tag. Is it possible to get this kind of functionality ...
1
vote
1answer
19 views

bind mouse scroll up and down [duplicate]

I am trying to make it so, in the normal mode : some modifier + scroll upward triggers revert u some modifier + scroll downward triggers redo <C-R> Edit : I do mean mouse scroll some modifier ...
0
votes
1answer
26 views

Vim 8 on Windows doesn't see plugins directory

I am using Vim 8.1 on Windows 10 and with a default package manager Vim doesn't see plugins in C:\Program Files (x86)\Vim\vimfiles\pack directory. Did I put in into incorrect place? EDIT: It is the ...
0
votes
2answers
17 views

How to let a register contain exactly one ^M without an extra newline?

I'm trying to programmatically record a macro (using :let @m= rather than qm). In vim, I executed: :let @m = ':retab^M' where ^M is typed as ctrl+V, Enter. I expect the buffer to contain exactly ...
0
votes
2answers
33 views

prepend word before every function argument

accidentally just wrote void foo(bar, baz, que) { and forgot to specify type, I want to convert the above to void foo(String bar, String baz, String que) { How can I do that quickly?
0
votes
1answer
31 views

map <expr> <F2> Cannot Check Focus Pane

How can a keypress dynamically change its behavior, depending upon which split pane has focus? (Specifically, whether the pane containing the cursor has another split pane to the right, or not.) map ...
0
votes
0answers
38 views

weird characters on executing shell commands [closed]

MacOS: 10.14.3 Python: 3.7.2 Pynvim: 0.3.2 neovim started with: nvim -u None
1
vote
0answers
27 views

How can I record a macro across multiple files

I have two code files open and I'm trying to write a macro for moving code from one file to the other. I start recording the macro in file A. After I enter all of the commands I need in file A, I ...
1
vote
1answer
17 views

Exclude folder when searching files in working directory

I'm working in a react project and opened vim from the root folder. When I'm using :vimgrep /pattern/ ** I just can search everywhere, but I want to search everywhere except the 'node_modules' ...
0
votes
2answers
36 views

Shell running inside vim windows

Is there a way that a open up a window or buffer, where i can run my bash commands? I thought on something like you know it from VS Code(1). The code windows on the top and a small command prompt on ...
3
votes
2answers
173 views

How do I use 'cgn' for word under cursor?

I really like and often use the cgn command for replacing something I was currently searching for, but it sort of lacks a (imho) rather intuitive feature: replace the word (or whatever) under the ...
0
votes
0answers
22 views

How to bind command+s to save file on macOS?

I have a Macbook. I want to save files by pressing command + s (this should happen if it is in insert mode or not, and I want it to go to non-insert mode after it is saved). How do I do this? ...
1
vote
2answers
33 views

How to use different colorscheme and syntax highlighting in vim?

Suppose I want to use this colorscheme: https://github.com/NLKNguyen/papercolor-theme I copied the PaperColor.vim file into .vim/colors and made my .vimrc: syntax on colorscheme PaperColor ...
0
votes
1answer
65 views

How do I control an external program from vim? The final end is to listen to audio and make a transcript in sync

So it seems that vim is great for so many things. And I love it. And yet, it is the configuration that sometimes is a limitation for those of us who don't get a tight grasp on how to tinker into it. I ...
0
votes
1answer
27 views

Paste mode sometimes inserting “<Paste>”

Sometimes when I paste (via cmd+v) some text into neovim, it inserts <Paste> at the bottom, i.e: This was pasted and I got some bonus letters <Paste> I can't figure where this text comes ...
0
votes
0answers
14 views

How does (neo)vim set $PATH for system(['command'])

When I want to call an external program, I have the option of spawning a shell or not. system('my command') will spawn a shell (executing your .bashrc/etc and all it seems). system(['my command']) ...
1
vote
1answer
34 views

Some of the icons from Devicons not rendering properly

I installed the following plugins in NeoVim after installing the Nerd Fonts. Plug 'tiagofumo/vim-nerdtree-syntax-highlight' Plug 'ryanoasis/vim-devicons' And this is how NerdTree in Vim looks, As ...
2
votes
1answer
18 views

Is there a way to delete (trim) some jumplist items?

I want a jumplist like tree (undotree), or like taglist stack (trim some needless items), but I can not find any way to delete jumplist items. I think about hook jump action for my own jumplist, but I ...

15 30 50 per page