All Questions

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

Increment the number at the end of variable

In my C code I am dealing with many variables of type RxMsgType0 RxMsgType1 RxMsgType2 RxMsgType3 ... My Question: Is there a way in VIM by which I can create 4 more variables which follow ...
3
votes
4answers
262 views

How to run a substitute command on only a certain part of the line

I have the following line in my code: INCORRECT_EMAIL_MOBILE_COMBINATION("incorrect_email_mobile_combination"); When I try to substitute the underscores, with spaces, in visual mode (using :'<...
1
vote
1answer
21 views

Mapping using <Esc> writes “<Esc>” in insert mode rather than switching to normal mode

I have the following line in my .vimrc: inoremap kj <Esc> It had been working fine, ie it returned me to normal mode. But now it inserts the string "< Esc>" (I use the initial space here ...
1
vote
1answer
38 views

How to enter normal mode while in terminal buffer?

Recently I found out that vim has added the :terminal command which opens a terminal buffer within vim, however I see no way to enter normal mode so that I can move around and copy things. Neovim has ...
-1
votes
0answers
55 views

Why didn't vim fix UI isses? [duplicate]

This is not a duplicate question. I am aware of the history of how the hjkl keys came to be in use. And I also know that you can remap keys. I mean, doesn't everyone remap their escape key? But I'm ...
2
votes
1answer
21 views

How to disable Ale if PAGER mode is enabled

I use both Ale and VIM pager plugins. But for obvious reasons I want to disable some Vim features and plugins in the "less" mode. But if I put as recommended this piece of code in my .vimrc it still ...
7
votes
1answer
2k views

Trying to compile vim with python 3.6. Where is my config directory?

I'm a bit of a noob when it comes to Linux, only started using it recently. However, I am trying to compile vim with python because I am using latex live preview and it needs a python compiled vim ...
1
vote
4answers
34 views

How to end selection at an occurrence of a word?

Let's say I have this text with | as my cursor: <<<<<<< HEAD hi ======= hello ====== >>>>>> XXXX GGg| Now, I'd like to select from >>>> to say second=== or ...
4
votes
1answer
21 views

Pipe native command to vsplit

I have opened vim in a directory of code which contains long_name_module.py. My path variable is path+=** so the python file is visible to find. I type :find lo<tab> and the filename is ...
1
vote
1answer
68 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 ...
0
votes
1answer
73 views

don't use scrolloff=5 for mouse clicks

I use (neo)vim with mouse=a and scrolloff=5. Clicking on one of the top or bottom five lines with the mouse causes the screen to jump (so that the new cursor position is more centered), which ...
12
votes
1answer
990 views

Can't map German 'umlaut' keys in .vimrc

I'm trying to find a way to map German umlaut keys (Ä,ä,Ö,ö,Ü,ü). A simple shortcut like this won't work: inoremap <c-ö> <Esc> Nothing happens when I hit ctrl+ö. Does anyone know a ...
1
vote
4answers
135 views

How to change word under cursor to upper case in command mode with shortcut?

I want to set up a shortcut to make word under the cursor upper case in the command mode. I know that you can get the word under the cursor with expand("<cword>"). But I am not sure how do I ...
2
votes
2answers
83 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 ...
1
vote
1answer
684 views

Make YouCompleteMe open definition in vertical split even if buffer is not saved

There is something I cannot do with YouCompleteMe that I could do when just using tags to navigate to a definition or declaration. The desired behaviour is (taking into account that , is my leader ...
1
vote
1answer
32 views

How to pass function return value to make command in VIM [duplicate]

I have this configuration in .vimrc function! FindProjectRootDir() return "some path" endfunction set makeprg=LC_ALL=C\ make\ MONOCHROME=1 nnoremap <F7> :make -C FindProjectRootDir()<...
0
votes
1answer
31 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 ...
11
votes
5answers
1k views

How to left-align two columns of text?

If I have a text file like this: alpha: 1 beta: 2 gamma: 3 delta: 4 epsilon: 5 Is there a way to align the numbers like so?: alpha: 1 beta: 2 gamma: 3 delta: 4 epsilon: 5
1
vote
1answer
21 views

How could I explore the files when using netrw to edit remote files

I can use :Explore to go through the current directory and open new files when I use vim locally. But when I use netrw to edit remote files, I cannot do it. For example, I opened a remote file with ...
2
votes
1answer
136 views

autocompletion - How to add phrases as thesaurus synonyms

I have a thesaurus file which contains synonyms for the word iterate. I would like to add an alternative phrase for iterate like loop over so I added it to the thesaurus. Unfortunately, this doesn't ...
0
votes
1answer
19 views

How to set internal vim variable from python code

I'm trying to write vim plugin for easier work with cmake. I want it to read some values from json file: build_dir, generator, cmake VARS and then give vim user few functions: configure, build, maybe ...
0
votes
2answers
32 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 ...
2
votes
1answer
26 views

Don't jump on search and replace

How do I get my cursor to not move to the last thing it replaced after a search and replace. No <C-o> or extra key presses. Is there some autocmd magic I can setup to listen on any substitute ...
3
votes
2answers
50 views

Add line numbers and remove line numbers to selected lines

Based on the accepted answer of the following post How to add permanent line numbers to a file? I would like to have the capacity to select a certain number of lines and add numbers to those ...
3
votes
1answer
36 views

Write several files all of which have been changed since read [duplicate]

I opened several files in vim and then switched git branches. I want to save the versions I have open to the new git branch, for all of them, without having to silence the WARNING: The file has ...
2
votes
1answer
62 views

Return <motion> character from Python function in <expr> mapping

I am trying to return this :GrepperAck ''<Left> from a Python function and use it in the following mapping def invoke_search_command(): return ":GrepperAck ''<Left>" :nnoremap <expr&...
3
votes
1answer
35 views

Syntax highlighting region messed up by matching parentheses

For a new filetype, I was trying to make block comments in the syntax highlighting but they kept disappearing while I was moving around. I have managed to reduce it to the following. First, in the ...
2
votes
4answers
666 views

Jump back to the position I started a search

I have a small question: let's suppose I'm at the beginning of line 10 and I search a term with the command /term_to_search and then I press <Enter> to start navigating search results with n or ...
0
votes
2answers
37 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 ...
0
votes
1answer
39 views

How to fix Leader Key Beep in Vim?

I cannot get the leader key working in vim. I have been troubleshooting for quite some time. Stuff I did already: Mapping leader key to another key :PlugInstall --> Already Installed x Plugin ...
2
votes
1answer
16 views

Jump to where insert mode was entered?

`. seems to take me to where I last left insert mode, but I would like to jump to where my cursor was when I entered insert mode last. How can I do that?
3
votes
2answers
70 views

Align a block of code on the basis of a single character

The question's title might sound a little vague, so I'll explain the situation here more clearly. I have these lines of code in a file which I want to align with respect to the character =. const ...
15
votes
4answers
11k views

How to share config between vim and Neovim

I started using neovim and moved my .vimrc to .config/nvim/init.vim and other stuff is located in .local/share/nvim. What is the best way to share configs or even plugins between vim and Neovim? ...
0
votes
1answer
29 views

Is it possible to use vim-fugitive outside of the repository (in local mounted directory)

I have a git repository: ~/home/foo/repo I mounted core to another directory: mount --bind ~/home/foo/repo ~/home/bar Now I want to edit my code with vim and use vim-fugitive. vim ~/home/bar/myCode....
3
votes
2answers
613 views

How to disable auto-indent when pasting in BusyBox's Vi?

I have a Vi running as BusyBox executable (VMware ESXi): $ vi --version BusyBox v1.20.2 (2014-08-27 12:48:18 PDT) multi-call binary. Is there a way to disable auto-indent when pasting the code? ...
5
votes
1answer
192 views

Disable bold character under cursor

This might be a newbie question but I can't seem to find an answer anywhere. I've created a custom colorscheme, but I don't know how to stop the character behind the cursor from becoming bold. This ...
6
votes
4answers
567 views

Store the number of matches in VimScript function?

Is there any way to store the number of matches in a variable in a VIMScript function? For instance I'm using: %s/,//gn
1
vote
2answers
24 views

Gvim - Change window position horizontally

I want to create a command that will place my gvim window to a different "x" location on my screen while maintaining the "y" position. I do this in my _gvimrc by calling winpos 319 16 I want to ...
0
votes
1answer
15 views

How to have the cursor at the right indentation when editing PHP/HTML

When I'm working with HTML in a PHP file and I press enter while in INSERT mode, my cursor goes to the start of the next line instead of going at the right positive therefore I have to press tab to ...
0
votes
1answer
63 views

Vim syntax line matching mechanism

Can someone explain or link to valid explanation information on the syntax highlighting mechanism. In particular I am having having a hard time understanding how rules are applied. Imagine the ...
6
votes
2answers
170 views

How to search literally without any regex pattern?

Does vim allow for searching raw strings? If what I want to search is in the variable string, does the following code work? call search('\V' . escape(string, '\')) Or are there other more direct ...
1
vote
1answer
26 views

Seach and replace with special characters

I am trying a search and replace because I am using some macros in my code. I want to replace tb.DUT.genblk4[0].U_rap_cisfd_wrapper this with `RAP_CISFD_WRAP_I in vim. I tried using :%s/tb\.DUT\....
16
votes
4answers
514 views

Set the paste option, but for one insertion only

I want to have a quick way of setting the Vim 'paste' option, inserting some text, and reverting to the previous value of 'paste'. A typical use case insert the OS clipboard content literally, ...
0
votes
2answers
49 views

:cnext / :cprevious without jumping to location

I've got a pretty large log file with some info interleaved with some errors / warnings and I would like to go to the next error in my quickfix window but without jumping to that location in the code. ...
1
vote
2answers
32 views

VIM command to insert multiline text with argument

new VIM user. I'm trying to make creating python properties easier for my class definitions. What I would like for say I type :pyp x then VIM will autofill where my cursor is @property def x(self):...
3
votes
0answers
39 views

Maps literally read < and > instead of the actual character

Here's the situation: Entire .vimrc: inoremap a <CR> Action: user types ia to enter INSERT mode and type a Expected result: a CARRIAGE RETURN is entered into the document Actual result: the ...
23
votes
5answers
8k views

Biggest differences between Vim and VI

Today, I decided to try Vi instead of Vim, I wanted to see how different it is. I didn't notice much differences at all, the biggest thing I noticed was how Vi didn't say -- INSERT -- when I went into ...
2
votes
1answer
43 views

Job continuously outputting to Vim buffer

I have a job that produces output continually. I want to write this output to a Vim buffer. I start it with: let job = job_start(cmd, { 'out_io': 'buffer', 'out_name': 'joboutput' }) But I can't see ...
3
votes
1answer
68 views

neovim-qt : Is it possible open files in the existing window?

When I open a file (either from dolphin or terminal) a window of nvim-qt is created. Is there a way to open the file in the existing nvim-qt window and raise/focus to the window? Note: I know there ...
0
votes
0answers
16 views

Adding directories to Lua’s search path

I’m trying to run Fennel scripts in Vim 8.1 using the fennel-nvim plugin. (Fennel is a language that basically lets you write Lua with LISP syntax; you can use it from any Lua-supporting application ...

15 30 50 per page