All Questions

Filter by
Sorted by
Tagged with
2
votes
3answers
71 views

How to repeat the last : command for a visual selection instead of whole buffer?

Say I've done the command: :g/^.\{1,50\}$/m$ To move all lines with 50 or less characters to the bottom of the file. Then I realise I actually didn't want to do that for the whole file, but for ...
1
vote
1answer
33 views

ALE + clangtidy + large file = big delay when linting

I am using ALE plugin with clangtidy linter to lint my C code and whenever I save my file and this linter gets activated it takes around 3-4 seconds for it to check for errors. File in question is ...
0
votes
1answer
30 views

How can I alias a command with arguments?

All I want to do is to change :vertical resize + arguments into :vr + arguments. for example change: :vertical resize +60 <CR> into: :vr +60 <CR> From other answers Aliasing a command ...
1
vote
1answer
45 views

vim-LanguageTool and vim-grammarous not working

I am using VIM version 8.1.1401 on Debian Buster. I am pretty new to VIM (just few days ago I started using it) and trying to get some plugin which can detect the grammatical mistakes. After few ...
1
vote
1answer
18 views

Mapping between Vim syntax highlighting and Emacs font-lock [duplicate]

I try to harmonize the colors of my Vim and Emacs. But I am not sure how to map some Emacs faces to Vim. Emacs distinguishes between keyword and builtin. In shell mode if and case are of the type ...
1
vote
2answers
134 views

How to follow the output of a command in a terminal window

I recently decided to give a try at neovim and one thing is bothering me: I use a terminal window to run my code watcher i.e. a never ending command which outputs new lines each time I write a buffer....
0
votes
1answer
55 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 the ...
1
vote
1answer
46 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 ...
3
votes
1answer
48 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 ...
6
votes
4answers
525 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 :'<...
4
votes
1answer
31 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
4answers
39 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 ...
1
vote
1answer
44 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
28 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 ...
-2
votes
0answers
69 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
49 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 ...
1
vote
4answers
169 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 ...
3
votes
2answers
68 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 ...
2
votes
1answer
31 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?
0
votes
1answer
42 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 ...
0
votes
1answer
19 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
34 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....
4
votes
2answers
100 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 ...
1
vote
1answer
35 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\....
2
votes
4answers
689 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 ...
1
vote
2answers
36 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):...
1
vote
1answer
54 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 ...
0
votes
2answers
54 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. ...
3
votes
0answers
45 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 ...
2
votes
1answer
46 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 ...
0
votes
0answers
20 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 ...
1
vote
2answers
27 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 ...
1
vote
1answer
33 views

di in vim/fortran

I have tried without any luck, but can anyone kindly let me know if di is possible for language like vim/fortran which has structure like do loop Something end do UPDATE: command di', di"...
1
vote
1answer
65 views

Autocompletion plugin for c/c++ with specific header path?

Is there a plugin which autocompletes C/C++ code from specific headers given in a specific path (i.e. /path/)? If I include some headers from that path, I would get autocompletion from given header.
1
vote
0answers
21 views

Where can I find good indentation file for lex filetype?

I checked and found only a syntax file for lex filetypes in /usr/share/nvim/runtime/syntax, but found no indent file in /usr/share/nvim/runtime/indent I want my lex files to be properly indented; one ...
1
vote
1answer
21 views

How do I map multiple replace commands in visual mode

I'm trying to edit my init.vim to allow quick, custom retabbing with one key. My current attempt is as follows (the replace text in the last command is a tab character inputted in insert mode): ...
2
votes
1answer
39 views

Format / Indent c++ as you type inside expressions

In visual studio, that code : for(int x=0;x<10;x++) {} becomes that code : for (int x = 0; x < 10; x++) { } as soon as you hit enter. I was wondering, is it possible, and if so, how can I ...
1
vote
3answers
54 views

NERDTree maximize on enter

I'd like to maximize NERDTree when I enter the NERDTree buffer. The command I have so far is: autocmd BufEnter NERD_tree_* <A> ...but the <A> part is wrong. I get the error: E21: Cannot ...
2
votes
1answer
40 views

How to make two windows equally high?

It seems that there is an issue with window-resize with Quickfix list window. In case of regular window and quickfix list window, how to make them equal in high? The CTRL-W- (and the CTRL-W+) works,...
1
vote
1answer
33 views

How to use the result of a function in a Vim keymap?

I have a function in Vim script that returns a string. " Return first directory with ".git" folder, if none is found " return the current directory function! s:project_root() for vcs in ['.git']...
2
votes
2answers
26 views

Add buffer space on line wraps

Is there a way to add some buffer space between the vertical separator and the content of a file in vertical split mode? Another way to say this: How do I force vim to not let a line touch a vertical ...
1
vote
1answer
30 views

Cancel command line completion insert

I notice a different behavior in command line completion from the regular completion in a buffer. Usually even if I select and item from the completion menu, CTRL-E cancels the completion and reverts ...
0
votes
1answer
24 views

Reload vim autocmd Filetype [duplicate]

I tried searching for this on the internet but I get bombarded with answers saying to :so $MYVIMRCwhich does not work if I add lines of the type autocmd FileType foo bar. What's a more efficient way ...
1
vote
1answer
46 views

Find project root relative to the active buffer

I can use the finddir function to find a parent folder that contains a .git folder (project root), like this: let dir = finddir('.git/..', ';') However, this only finds project roots that are parent ...
0
votes
0answers
44 views

How to recover file overwritten by vim

I used the command :Texplore to rename a file in vim's file explorer. I closed the buffer that read the old file name into memory, then opened the new file name using a new instance of vim only to ...
0
votes
1answer
23 views

When openning netrw in split view, the opened buffer I'm still editing clears when I click a line number

Wondering why this happens, if it is a bug or supposed to happen? Steps to reproduce: open vim, split two windows, one with netrw and another with few lines of text (line numbers enabled). As both ...
3
votes
1answer
39 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 ...
1
vote
0answers
38 views

Is there a keybinding that allows to scroll through the status line?

I was wondering if it was possible to scroll (left or right) along the status line so that the content (which could not be displayed due to the size of the window) could be seen. Perhaps there is a ...
2
votes
1answer
38 views

Update external file based on VIM mode

Currently I have my vim set up to update the statuslline based on what mode the editor is in. Like if I'm in insert mode then the statusline turns red. Magenta in replace mode. Green in command ...
1
vote
1answer
30 views

Adjusting pdflatex settings [closed]

Ubuntu is my OS, and I have the Latex-Suite plugin installed. I'm trying to get pdflatex to output a .pdf file instead of a .dvi file, but it continues to output only a .dvi file (along with .log and ...

15 30 50 per page