0
votes
0answers
17 views

Also apply changes to empty lines when doing visual block edits? [on hold]

Often I comment-out a block of code using block editing. I know there are tools for doing this (e.g., NERD Commenter), but I sometimes need/prefer to do it my own way. However, when I use insert ('I')...
1
vote
0answers
24 views

How can I prevent <CR> from moving the cursor downward? [duplicate]

In the vim help doc, it says: *CTRL-M* *<CR>* [count] lines downward, on the first non-blank character |linewise|. That is, in the normal mode, <CR> has the same ...
0
votes
0answers
28 views

how to write a self-contained color scheme

I'm making a simple colorscheme based on one I found on the vim website. https://www.vim.org/scripts/script.php?script_id=854 I'd like it to be declarative in the sense that the colorscheme is ...
0
votes
1answer
19 views

how to create a buffer like a fugitive temporary buffer

When we call :Gdiff on a file, fugitive will create a buffer with a name fugitive:///path/to/file/. The modifiable option is off and readonly option is on. Most importantly, the file does not exist on ...
0
votes
0answers
9 views

Supertab: autocomplete after a specific word followed by a space

By default, supertab is inserting a regular tab when the previous character is a space. I would like to keep this behaviour but with the following exception: if the previous character is a space but ...
0
votes
0answers
31 views

Is there anyway to let cursorline take care of the visual tabs generated by 'breakindent'?

now the cursorline leaves a hideous gap between the number column and the wrapped text, is there any way or trick to make the cursorline take care of the whole part of the wrapped line including the ...
1
vote
0answers
37 views

Error when opening shell scripts

I began to get the error Error detected while processing BufRead Auto commands for "*.sh": E117: Unknown function: dist#ft#SetFileTypeSH when I opened shell scripts (*.sh) I think it happened after ...
1
vote
1answer
12 views

Use flake8 for Cython with w0rp/ale

I'm using flake8 to check my code with ale plugin. I found a way to make it work with Python 3, but it seems it does not recognize Cython file (.pyx) even if we set as follows. let g:ale_linters = { \...
1
vote
2answers
29 views

Working with line continuations (\).

When working in the C language, sometimes you have to write multi line macros like the following. #define SOME_FUNCTION_LIKE_MACRO(a,b) \ foo(a); \ bar(b); ...
1
vote
0answers
40 views

Monkey-patch plugin function

Is it possible to override an autoloaded plugin-function? I want to customize an airline-internal function just like this: diff --git a/autoload/airline/extensions/default.vim b/autoload/airline/...
0
votes
1answer
47 views

Swap `j` and `gj` [duplicate]

I use vim a lot to edit tex files. When I have lines spanning multiple display lines, most of the time I want to navigate through them with gj not j (i.e. according to displayed lines, not physical ...
-1
votes
0answers
11 views

Beter pane resizing mapping for tmux [migrated]

My current pane resize mapping are bind Left resize-pane -L 5 bind Down resize-pane -D 5 bind Up resize-pane -U 5 bind Right resize-pane -R 6 I have to type the key binding strokes and the arrow ...
1
vote
1answer
37 views

diffpatch using the output of git diff directly

I guess many of you are like me, and even if they have been using ViM for years, still learn new features regularly. The last that I learned was :diffp[atch] patch/name Now, I want to combine it ...
0
votes
1answer
25 views

Match pattern and highlight it in modeline for a specific filetype

I need to match Issue in .conf filetype and highlight it with custom color but set in mode line instead of a fix in syntax/conf.vim file. The use-case is for each kind of document I need to highlight ...
1
vote
1answer
43 views

how to skip commented lines when navigating?

When navigating in normal mode by j or k, I want to skip commented lines. Is it possible? Is there a vimscript snippet for that?
1
vote
1answer
29 views

zt for horizontal scrolling

I love the keybindings zt zb and zz. They redraw the current window such that your cursor stays at the same place in the document, but it moves on your screen. The cursor will now be at the top, the ...
0
votes
0answers
10 views

Terminal Vim scrolls up once when I release the scroll wheel after having scrolling down

It is a weird behavior, and it's only happening on one of my laptop (they're both provisioned with the same script) which is the reason I'm having troubles identifying where does this come from. I ...
1
vote
0answers
19 views

How to list content of jar in jar .. in vim

As the title says, how to list the content of jar in jar. Suppose, you have a .jar file a.jar, in which you can with vim a.jar get a list of the content, like: a1.txt a2.txt b.jar With vim, you can ...
0
votes
1answer
24 views

Quick find and replace a fixed placeholder

I have a config file that have placeholder PKG, in workflow, I need to replace this PKG with a string but typing :%s/blah/blah/g cost time. I need a quick map key that asks for a string to replace ...
1
vote
0answers
27 views

Neovim not showing correct background color

I'm running neovim from a uxterm on arch linux with the solarized color scheme. The issue is that on scrolling only the characters which are non-whitespace are displaying the correct background. ...
0
votes
1answer
30 views

Statusline – update variables on file change

I'm currently learning Vimscript, but I'm stuck at a particular problem. I'm creating a statusline which shows the full path (~) of the file currently displayed in the buffer. Instead of just using %...
0
votes
0answers
12 views

can't use register when using vim in ssh [duplicate]

$ ssh username@ip $ login $ vim filename When in normal mode, if I press "*p, I will get an error: E353, nothing in register " What's the problem?
0
votes
0answers
30 views

what's wrong with this map?

:nnoremap 00 $ What I expected is to make the cursor to move to the end of the current line after a double hitting of "0". But actually, it will make the cursor go to the next line, why?
1
vote
0answers
24 views

Abbreviations do not work when space is conditionally remapped

I want to change the behavior of <Space> when the popup menu is open using this map inoremap <expr> <Space> pumvisible() ? "\<Down>\<Enter>" : "\<Space>" However, ...
1
vote
1answer
31 views

Match and replace very specific number

I would like to replace every number n in my document with n+1. Easy: :%s/\([0-9]\+\)/\=(submatch(0)+1)/g Now I would like to replace every number n with n+1, only when the number has exactly three ...
2
votes
1answer
32 views

Create remap with variable

How do I remap key combinations with a free variable? For example, let's say I want to be able to insert a single letter without leaving normal mode. I would want something like nnoremap <leader&...
4
votes
2answers
64 views

Change text between two $ symbols

If there is some text between quotations, such as "x = 5" I can type ci" in normal mode to delete the text inside the quotations and switch to insert mode. I often want to perform this same action ...
1
vote
1answer
29 views

Can capitalized marks be saved in session INSTEAD of viminfo?

Marks are saved in .viminfo I would like to have separate marks saved per session. Is there an easy setting to make this switch? I know I could write some vimscript to save my session marks ...
0
votes
1answer
21 views

Search and replace a pattern with new line except for a pattern

I am having a very long line file, I have to break the line into number of small lines. Example: < this>is a testing< /this>< next>testing< /next>< tested>successfully&...
0
votes
1answer
30 views

what is the difference between “* and ”+?

The two registers "* and "+, what is the difference between them? Maybe they are all about OS clipboard?
0
votes
1answer
29 views

Vim multi-line substitute/insert once on selected text

I tried to make a function function! WrapSelect (front, back) "puts characters around the selected text. execute '''<, ''>s/\%V\(\_.*\)\%V\(\_.\)/'.a:front.'\1\2'.a:back.'/' nohl ...
0
votes
1answer
48 views

Non-greedy regex quantifier is greedy

Note: I am not looking for a working substitution for my command (allready have that), but for an explanation. I have the following code: include <stdio.h> char ga[] = "abcdefghijklm"; void ...
2
votes
1answer
29 views

Can't echo messages from inside async functions

CASE 1: Have your autocmd command be setup like this: autocmd User ALELintPost call SayHello() " ALELintPost is async And your SayHello function set up like this function! SayHello() abort ...
0
votes
1answer
22 views

Why doesn't the cursor return to its original position in this command to create a new line?

I added the following command to my .vimrc, which is designed to insert a blank line below the cursor nnoremap <leader>o mzo<esc>`z The sequence of this command is mark the cursor ...
1
vote
1answer
25 views

how to know if the current file in the buffer is a (.)dotfile using vimscript?

I changed vim backup directory to be stored on .backup folder in my dotfiles local repo set undodir=$HOME/.dotfiles/backup//. it works well as expected but i want to separate actual dotfiles ...
0
votes
0answers
20 views

Highlighting a search capture group

By :set hl, the search result of a / expression is highlighted, for example: And if one wants to replace one substring distinguished by its surrounding, one can do so elegantly using regex capture ...
1
vote
0answers
16 views

CursorLineNR highlight not working

I have a vim configuration file (~/.vimrc) with the following settings: colo delek syntax on highlight clear CursorLine highlight clear CursorLineNR highlight clear LineNR highlight LineNR cterm=...
1
vote
1answer
10 views

Do not apply settings for non-modifiable popup windows

I have the following in my .vimrc: :set colorcolumn=81 This sets the background color of every window's 81st column to red. I would like to disable this for "pop-up" windows like syntastic's error ...
1
vote
0answers
14 views

Coloring Piece of Tabbar

I am using neovim with the gruvbox colorscheme. On its github page, you can see the buffers word on the top right is colored in orange: On my installation, it grey/brown: How can I find out what ...
0
votes
2answers
46 views

substitution in every other line

how do I search/substitute in every other line. :s/pattern1/pattern2{2}/g file looks like 1 pattern1 text 2 pattern1 text 3 pattern1 text 4 pattern1 text Output file should look like 1 pattern1 ...
0
votes
0answers
27 views

Sublime Text *like* project handling

Sublime Text has the concept of projects which map to a folder. When you search for a file or search for text within files, sublime presents the following search form: Find: Hello World Where: <...
0
votes
1answer
10 views

Exclude file pattern from keeping it in viminfo history?

I am comforable with using history of edited files that is kept in viminfo, the one that sets the limit in the first setting of set viminfo='100,... variable. After I've started using mutt as email ...
1
vote
0answers
21 views

Set different values for non-current and current statuslines

When vim is split into different panes horizontally, each pane has its own statusline. It's easy to highlight the statuslines differently based on current and non-current panes. BUT, I cannot figure ...
-1
votes
0answers
22 views

How to map alt + arrow keys in iTerm?

I set option to meta have successfully mapped <m-left> <m-right> in iTerm by choosing to send escape sequence [1;5C and [1;5D when pressing alt-left and alt-right, but when I set alt-up ...
0
votes
1answer
24 views

How to isolate what is changing `set noshowmode` to `showmode` upon startup?

In my .vimrc file I have set noshowmode However, upon starting vim, :set noshowmode? returns showmode. Something must be adjusting this setting upon startup (perhaps a plugin?). What's the best way ...
1
vote
1answer
27 views

How do I enable the gruvbox airline after installing gruvbox with Vundle?

If I understood it correctly gruvbox has it's own airline and you don't need vim-airline installed. I followed the easy install with Vundle but for some reason the airline just doesn't load. I'm using ...
0
votes
1answer
27 views

How to move a line onto the end of some other line

For example suppose i have 1 the cat jumps 2 over the moon I would like the result 1 the cat jumps over the moon In general how can I move line X onto the end of line Y. A solution that would ...
0
votes
1answer
17 views

Automatic format: how to insert needed amount of spaces for vertical aligning? [duplicate]

Given code: <option id='Nicole' data-language='en-AU'>Australian English - female - Nicole</option> <option id='Russell' data-language='en-AU'>Australian English - female - Russell&...
1
vote
0answers
17 views

Vim CursorLine default color

I run Vim in terminal and it was keeping to override the background color using it's own, so I added this lines to my .vimrc highlight Normal ctermbg=NONE highlight nonText ctermbg=NONE and ...
0
votes
1answer
23 views

Option set in vimrc is overwritten - nvim

I'm trying to disable autochdir in nvim by adding the following in init.vim: set autochdir! but when I start nvim, I check the value of this option by echo &autochdir and find it equals to 1. I ...

15 30 50 per page