# All Questions

7,385 questions
Filter by
Sorted by
Tagged with
10 views

. 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?
32 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 ...
14 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 ...
23 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....
58 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 ...
23 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\....
643 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 ...
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):...
34 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 ...
45 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. ...
32 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 ...
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 ...
14 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 ...
22 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 ...
29 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"...
45 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.
12 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 ...
19 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): ...
25 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 ...
40 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 ...
37 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,...
24 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']...
22 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 ...
27 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 ...
23 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 ...
37 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 ...
28 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 ...
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 ...
28 views

### Syntax highlighting region messed up by matching parintheses

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 ...
32 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 ...
34 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 ...
29 views

### Adjusting pdflatex settings [on hold]

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 ...
34 views

### My vim can't print Chinese right on my mac?

only the vim app can't show the Chinese right. I have checked the encoding, fileencoding and fileencodings configs, all of them are utf-8 at the first.
31 views

### Temporary normal mode doesn't wait for the command

When I press C-o in insert mode, the expected behaviour is that vim will wait for me to execute a single command and then returns to insert mode. Usually, after pressing C-o I have all the time in the ...
54 views

### ! is required but not allowed for custom command

I'm using Neovim 0.3.7. I have a default session file that loads up a number of files I'm working on at the moment. To save and load the sessions I have the following custom commands defined: let ...
25 views

### Save :Man window in session

TL;DR: I want to persist :Man windows in sessions I am obsessed with sessions, and use tpope's vim-obsession for managing them. Coupled with a scripted tmux, sessions make for a perfect "quit, go ...
29 views

### send <cr> to ipython in :term

When I am developing some python script, I regularly find myself running part of the code to see if it does what I want it to do. Currently I do this by copying the code that I want to run to the ...
50 views

### Pressing Shift-Backspace in insert mode types '^?' instead of backspacing

When I mess up typing an uppercase letter, I usually hold Shift while pressing the Backspace. Instead of backspacing, it types ^? (to my frustration). Google tells me that ^? is the "delete" ...
60 views

### How to go halfway into a line? Percentage navigation within a line

I know that e.g. 50% is a normal mode command to go halfway down a file, but [count]% is line-wise. How can I get to the halfway point of the line that my cursor is on?
26 views

### Pasting non-text data (image) from system clipboard [closed]

I would like to write a plugin which will be triggered at paste from system clipboard if it contains image data. Is it feasible to do this with scripting? My preference is to write in Python, using ...
58 views

### Linking a filetype to a syntax file of a different name

I’ve created a new filetype, “usenet,” for Usenet messages. I would like files with this filetype to be highlighted exactly as if they had the “mail” filetype. Is it possible to tell Vim that I want ...
14 views

### How can I trigger the autocmd FileType commands for all buffers? [duplicate]

I have a key binding to reload my ~/.vimrc. However, some of my options set via autocmd FileType are not active after reloading the config. Those are to set the text width, creating highlights, etc. I ...
37 views

### How to treat underscores as whitespace when skipping to the next word? [duplicate]

Let's consider an example where the cursor is at the beginning of the text one_two three. Underscores are treated as part of the word, so w moves right to the first letter of three. With set ...
39 views

### Why does vim still auto-indent LaTeX after I set noai noci nosi?

I want to disable autoindent and smartindent for LaTeX so I did :set noai noci nosi When I open a brand new mwe.tex, filetype=plaintex and there is no auto indent magic. When I then enter some code,...
44 views

### Number column in Tlist window

I want to hide the number column set nonumber norealtivenumber in Tlist window! Every time I call :Tlist the number column appears in the window. How can I disable the number column for that window.
38 views

### Vimtex conceal doesn't recognize new command math environment

I recently added the vimtex plugin which includes a conceal feature which I really like; however, I found it doesn't work in custom math environments such as \newcommand{\beq}{} \...
105 views

### Backspace functionality in normal mode

I'm trying to allow using backspace in normal mode. My best attempt is adding the following to my vimrc: nnoremap <BS> i<BS><ESC>l. This works great except for two situations: I'm ...
25 views

### vim and enhancedcommentify weird behavior for C

I am trying to use EnhancedCommentify plugin for vim and mostly using C. However I can't figure out the issue but when I comment/uncomment it uses (* ---- *) instead of /* ----- */. I tried to change ...