All Questions

0
votes
1answer
12 views

vi background color wrong on Windows 10 1903 WSL Terminal

After upgrading to Windows 10 1903 (18362.175), in Window Subsystem for Linux (WSL) Ubuntu 18.04, the background color is always set to black when scrolling backward in vi, vim, man and maybe some ...
1
vote
1answer
15 views

vim - how do I cut some lines of file-1 to file-2 in 1 step?

When I need to cut some lines from one file to another file, I always do the following steps: Select the lines in file-1 :w >> file-2 Re-select the lines d This is super annoying if you need ...
-1
votes
0answers
10 views

Missing } when starting vim [on hold]

I just did a system update, which updated Vim as well. I tried to use Vim today, and an error popped up. E220: Missing }. Press ENTER or type command to continue As far as I can tell, Vim works fine ...
0
votes
0answers
8 views

Using mouse to navigate to type using YouCompleteMe plugin

I'm trying to map ctrl+click event to generic navigation for java types using YouCompleteMe plugin. There's plugin command to do that: :YcmCompleter GoTo it navigates to "most sensible" place for type ...
0
votes
1answer
15 views

Mapping Ctrl + mouse click

I want to map Ctrl + mouse click to a command: nnoremap <C-???> :YcmCompleter GoTo<CR> Is it possible to do that using nnoremap? What symbol should I use for that?
0
votes
1answer
15 views

“map”pings in syntax files shows on startup

in my project I have different kinds of files. For every filetype I created a ~/.vim/syntax/[type].vim file for e.g. highlighting and key mappings. In every filetype I have a footer line with # vim:...
0
votes
0answers
19 views

folding code and moving along?

I recently discovered that vim can fold code. It works quite good with zc but when I move down with j then the code unfolds. How how can I prevent it from unfolding when I move with the cursor? Is ...
0
votes
1answer
25 views

Yank both sides of equation

While writing in latex I often want to copy a math equation's right hand side or left hand side. For example I have something like this \begin{gather*} 5 \cdot \left( A A 3 \right) + 50 \cdot \...
0
votes
1answer
46 views

Can I specify '-o' as the default for vi in my vimrc?

When I pass the names of multiple files to vim on the command line (e.g. vim foo.txt bar.txt), I almost always want to add the -o option, because I would like them to be visible side-by-side in ...
2
votes
1answer
33 views

`.vimrc` unsuccessful in setting highlight style

1) To underline misspelled words, I can execute the following in an open buffer: :hi clear SpellBad :hi SpellBad cterm=underline :set spell 2) However, if I write in my .vimrc the first two lines, ...
1
vote
1answer
10 views

On startup: ImportError: No module named ropevim

When starting nvim, my :messages contains: Error detected while processing function LoadRope[4]..provider#python#Call: line 18: Traceback (most recent call last): File "<string>", line 1, ...
1
vote
1answer
42 views

How to assign a Python list to a vim variable and escape its strings correctly

Here is a Python list that I'm trying to assign to some Vim variable. lines = ['"""Something foo\'s thing."""', '', 'foo = "asdfasdf" \\', 'bar'] command = 'let l:corrected_lines = {lines}'.format(...
1
vote
0answers
52 views

How to flush job output in vim8?

Trying to do something with job output in exit_cb or close_cb, but it's all buffered, how to flush it. e.g.: function! s:exit_cb(job, status) echom getbufline(s:bufnr, '$') endfunction function! s:...
1
vote
1answer
43 views

Repeat last normal command

Well, there is ; to repeat the last move in some cases. There is the . to repeat last change. But if I just did za or @a, is there a way to repeat it? I guess such a mechanism should ignore plain ...
0
votes
1answer
21 views

Is it possible to read a shell command's output from nvi's command line?

I was trying see if I can integrate fzf with nvi, but couldn't find a way to do something like :Edit <shell command's output> which would solve my problem. I tried :source nvi.ex -- it works ...
1
vote
1answer
47 views

CVE-2019-12735 question

Does anyone know if the Windows versions (pre 8.1.1365) of VIM (https://www.vim.org/download.php#pc) are vulnerable, per CVE-2019-12735? Everything I have read always mentions LINUX, and many LINUX ...
2
votes
0answers
30 views

Next tab completion item

I was seeing how the different default colorschemes look like in vim. To do that I typed :colo, then space and tab. But then when I want to set the next one, I have to press tab a lot of times to get ...
1
vote
1answer
20 views

Lexplore and split windows

Like many, I like to browse using :Lexplore. However, as indicated by the manual, By default, :Lexplore will change an uninitialized |g:netrw_chgwin| ...
0
votes
0answers
15 views

Remap delete key on mac osx to 'insert then backspace'

I'm using an intellij editor (Rider/Clion) with the vim plugin on mac osx and am attempting to intelligently select words in my editor, which I accomplish via an 'extend selection'/'shrink selection' ...
1
vote
1answer
21 views

Is it possible to run a script on a register content and send its output to another register on Vim?

Let's consider that I have the following bash script called time.bash: #!/bin/bash date -d @$1 This script converts the epoch timestamp to its corresponding date as the following: $ ./time.bash ...
0
votes
1answer
38 views

Are the contents of highlighted content saved to a register [on hold]

Let me briefly explain what I am trying to do. I work on an air gap network. Anything not native to Red hat, or that I do not write is out of the question. The most popular two IDE's are VIM/GVIM ...
1
vote
1answer
32 views

Line mode command to delete from column X to end of line?

Using gvim on a file with 30K lines, I want to use ex mode to delete from column 130 to end of line, making each record no longer than 130 characters. I want to do this for the entire file. My macro ...
0
votes
0answers
10 views

How to resize default NerdTree width? [duplicate]

I don't know what changed recently but my NerdTree keeps opening up super wide and pushing my existing window to the right. Here's a picture: Before opening NerdTree: After: I tried adding this ...
0
votes
1answer
48 views

Alarm for inactivity

I want to know if there is a way to setup vim (internal feature, plugin) in such a way that it would raise an alarm (bell, flashing screen, anything) if there were NO changes to the find within a ...
0
votes
0answers
14 views

Is there an `edefault` in the spirit of `gdefault` for setting the appropriate flags in vim's substitution commands?

To perform a buffer-wide substitution on all occurrences of foo (and not just the 1st one in a line), we can do %s/foo/bar/g The g flag may be omitted by setting this in the vimrc as set ...
1
vote
0answers
38 views

How can I still see underscores with cursorline?

Background and problem I've just discovered how to make the cursor a vertical line in insert mode. This works well with cursorline; even with the thinner cursor, I can still easily find my position. ...
2
votes
1answer
82 views

Does NeoVim really need plugins in 2019?

I've been using Vim with vim-plug, yiang-miao/auto-pairs and youcompleteme for a time now, and I really love it; but a friend recently recommended me NeoVim, and it seems it's more polished since it's ...
0
votes
1answer
29 views

Delete word around cursor and move to insert mode

My Problem Going from: To: I'm doing some editing (interactive rebase on a git repo, but the problem is generally relevant). The cursor is on a word (pick), and I would like to delete it , ...
0
votes
2answers
23 views

How to use setqflist to add an entry to the quickfix list

I'd like to be able to define my own functions that add certain kinds of line to the quickfix list, or set it to those in its entirety, without having to go via the filesystem with a made-up errorfile ...
0
votes
1answer
24 views

Go to next quickfix entry, removing current?

I frequently find myself going through the quick fix list, making my quick fix, with :cn and then quitting :q when I've finished ... and then :q again to also close the quickfix list. Is there a way ...
1
vote
0answers
17 views

How to get the right indentation and new line when adding a new line between brackets? [duplicate]

So I am curious about one thing: when I am between two brackets ({) in vim (or nvim), and I press Enter I go from this (where the pipe sign is the cursor): getUsers(){|} to this: getUsers(){ |} ...
1
vote
0answers
59 views

Simple .vimrc takes a very long time to save

Saving a file with :w takes several seconds for me, and I can't figure out the culprit. This is my .vimrc " Specify a directory for plugins " - For Neovim: ~/.local/share/nvim/plugged " - Avoid using ...
0
votes
1answer
30 views

Is there a way to enter ex mode for a single command directly from insert mode?

I'd like to go directly into ex mode from insert mode, enter a single command (say :r !date which inserts the date) and then go immediately back into insert mode. Basically something similar to the ...
0
votes
1answer
32 views

How to disable margin (+/!)?

Currently I installed vim addons for python. http://fisadev.github.io/fisa-vim-config/ However, I don't like the +/-/! on the margin. Does anyone know how to disable all of them? Thanks,
0
votes
0answers
29 views

How to start insert-mode completion from select mode using Vimscript?

I have some text selected in select mode. I want to delete it and start insert-mode completion. When I type these keystrokes into Vim it works perfectly: gvc<C-X><C-U> gv switches to ...
0
votes
0answers
13 views

Spell Check Not Working Using Vimtex?

What is the correct way to have spell check for Latex files using the vimtex plugin? Spell check works for other filetypes but doesn't seem to work for .tex file extensions. I have read about using "...
1
vote
1answer
21 views

Add surrounding quotes no leading whitespace

my question is simillar to this: How do I surround a quoted string without including leading whitespace? But not exactly. I am using vim-surround. I have a string print he^llo_and_welcome where ...
0
votes
1answer
25 views

localleader is not obeyed

for my fortran code, I have defined: au FileType fortran let maplocalleader = "`" # i have tried \` as well. For fortran filetype in vim, :echo maplocalleader is showing ` as expected. But, then,...
0
votes
1answer
54 views

How does vim decide if a file is “readonly”?

For testing purposes I set the setuid to my vim binary. Now when I open for example /etc/passwd, modify the file and execute :w, then I get the E45: 'readonly' option is set (add ! to override) error ...
4
votes
2answers
129 views

What's the functional difference between the key notations “\<xxx>” and '<xxx>'?

I stumbled recently upon a mapping in the Vim Tips Wiki that uses an expr-quote: nnoremap <silent> <Space> @=(foldlevel('.')?'za':"\<Space>")<CR> and realized it still worked ...
0
votes
1answer
39 views

how to have a new line from within brackets

I normally write my functions this way public void test() {} to continue, I need to insert a new line from within the brackets, so the final output is this: public void test(){ // cursor is ...
0
votes
1answer
34 views

Change saved session's working directory

I have a neovim session saved using :mks which by default saves to a subdirectory in my project ~/project/subdir/Session.vim. I want it to save to ~/project/Session.vim, which I can do by running :cd ...
0
votes
0answers
17 views

Problems installing Vundle in fresh install of Vim

I, I'm trying to to install vim to use as a Python IDE on arch. I was using this tutorial to do it, but ran into some troubles. When I tried to open vim I got the following error messages: https://...
1
vote
1answer
68 views

enter inside curly braces does not indent

When I create a curly braces and press enter inside it I get this behavious {|} -> enter key { |} Now how do I get vim to do this {|} -> enter key { | } my vimrc brief filetype plugin ...
2
votes
3answers
50 views

How to indent or unindent lines in a block of text?

I use two spaces in my indentation of codes. What are the possible ways to indent or unindent a block of code?
0
votes
1answer
35 views

custom snippet extender Ultisnips

Suppose I have a snippet: snippet prg !This is file : `!v expand('%:t:r')` ! Author= `!v expand($USER)` ! Started at: `date +%d.%m.%y` ! Last Modified : Sun 16 Jun 2019 12:30:58 IST ...
0
votes
1answer
37 views

Are there function equivalent to vim shortcuts?

It seems like I need to use a lot of shortcut tokens to do what I need in vimscript - which is making my code unreadable, so are there regular function calls for that? For example, I need to write ...
4
votes
1answer
50 views

How to pass v:register to custom operator when working on custom text object?

I have a simple custom operator, it echoes v:register, it's mapped to ,f. After reading this, i creat it like this : function! s:foo(type,...) echo v:register endfunction function! s:setupOpfunc(...
0
votes
2answers
47 views

Move cursor to old position after scrolling

I often want to edit text in say line 200 of a file, but while doing this I need to look at say line 100, so I scroll to line 100. Is there a way to quickly jump back to line 200 after scrolling? Is ...
1
vote
1answer
31 views

How to source vim-scripts on Windows?

In (g)vim on Windows I can use :source \Program\ Files\ (x86)\Vim\vim81\msvim.vim to source the script for the Windows settings. Vim suggested the syntax with leading backslash when I found it in some ...

15 30 50 per page