All Questions

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

How can I view a list of all of the features that can be checked for using `has()` in Vim?

How can I view a list of all of the features that can be checked for using has() in Vim? I recently came to know the has() function for testing the presence of "features" (see below). :h ...
3
votes
2answers
150 views

What does three commented curly brackets ("{{{) at the end of a line mean? Is it just a comment?

In the tcomment plugin, specifically in: ~/.vim/pack/tml/start/tcomment.vim/autoload/tcomment.vim and ~/.vim/pack/tml/start/tcomment.vim/plugin/tcomment.vim I'm seeing this at the end of some lines: ...
0
votes
1answer
23 views

How can I set a variable for a single Vim Ex command only?

I often set or modify a shell variable in Bash for the scope of a single command only: $ FOO=BAR <command> Is it possible to set or modify a variable in Vim for the scope of a single Ex ...
0
votes
1answer
21 views

Define a new ex command active only in specific filetype (C++)

I would like to define a new command for C++ files/buffers (ft=cpp). I shall explain the requirements through the example below. The newly defined command :stripdbg should strip the surrounding dbg() ...
1
vote
1answer
11 views

<esc>v$ without trailing space?

I want to use $ in visual mode but it always includes a trailing space (even if there isn't one on the line). How do I make it so $ only goes to the actual last letter?
1
vote
2answers
16 views

Shell syntax highlighting

I've noticed in bash/shell it highlights $(...) in red, for example: However, if I change the syntax from ft=sh to ft=bash, it does not do this: What's the reason for this? Am I doing something ...
1
vote
1answer
15 views

PATH order different in vim terminal window

I have anaconda set up with a few different environments. When I switch environments and open vim 8.2 and type :term to launch a terminal window and type echo $PATH, $PATH does not match what is ...
1
vote
1answer
7 views

Odd behavior when trying to perform a substitution on the clipboard register

I have a map that creates a markdown hyperlink for the current url open in the browser: inoremap <Leader>gg [<esc>:silent !~/bin/copy_safari_title.osa <cr>"+pa](<esc>:...
3
votes
2answers
35 views

How to run a single Python unittest.TestCase test in VIM?

I have two simple Python tests in my_tests.py file: from unittest import TestCase class MyTestCase(TestCase): def test_true(self): self.assertTrue(True) def test_false(self): ...
0
votes
0answers
9 views

=AutoPairsDelete() is inserted when using kite and auto-pairs in vim

I am currently using the vim editor. I am facing a problem right now. If I use kite and auto-pairs together in vim, =AutoPairsDelete() will be inserted when I press the Back space key repeatedly. I ...
2
votes
2answers
75 views

Why does peachpuff colorscheme looks completely different in terminal and GUI (MacVim)?

I've installed MacVim using Brew: brew cask install neovim I'm using the macOS's Terminal.app to run MacVim in Terminal mode. I've experimented with :colorscheme peachpuff, since many recommends that ...
2
votes
2answers
116 views

How to activate bracketed paste mode in GNOME Terminal for Vim inside tmux

Edit this issue happens inside a tmux session. The original value of $TERM before starting vim is: echo $TERM screen The issue appears for example when pasting this kind of indented code: def ...
0
votes
1answer
48 views

No highlighting for replacement text using conceal

I just discovered Vim's conceal feature. I've added the following to ~/.vim/after/syntax/haskell.vim: syntax match haskOperator "->" conceal cchar=→ syntax match haskOperator "<-" conceal ...
1
vote
0answers
13 views

“The ycmd server SHUT DOWN” with vim 8.1

I just upgraded my system, in the process vim was itself updated to version 8.1 (from 8.0). Now every time I start vim the following error is displayed: The ycmd server SHUT DOWN (restart with ':...
0
votes
1answer
76 views

NerdTreeToggle always opens up two directory windows instead of one

I'm using Nerd-tree for vim. Whenever I use :NERDTreeToggle key, it opens up two directory windows instead of one, like so It's only when I type :qon one of the windows does it become like this How ...
2
votes
2answers
44 views

Make an expr mapping dependent on the number of lines selected

How can I make a visual mapping's behaviour dependent on the number of lines selected? I tried creating an expr map, but the visual start and end marks don't seem to be correct: function! Xsurround() ...
138
votes
8answers
152k views

Displaying tabs as characters

When I work on files in python, I sometimes mistake tabs for spaces and vice versa. Is there a way I can get Vim to display a character for a tab instead of a tab?
2
votes
1answer
40 views

Using 'd%' to delete a bracket pair and its contents is now broken

I've long been editing code in Vim 7.4 with matchit and matchparen plugins. In my old setup it was easy to delete { some string } by placing the cursor on the { and then use the d% command. I've now ...
1
vote
1answer
38 views

Do you know any plugins which allow marks to be longer than one char?

I'm looking for plugin which emulates marks behavior for longer key sequences. I want to be able to mark two distinct files with 3 char mappings and jump to files when sequence is typed. Do you know ...
1
vote
1answer
38 views

Shortcut for spell checking

I would like to create a shortcut for the spell checker, since it requires a relatively long command. I inserted the following map in the .vimrc file: inoremap <F5> <C-O>:set spell ...
0
votes
0answers
20 views

Nvim black border issue

I am using nvim and color theme grubox and also I add the settings of my color theme. at my vim editor has some black border at around left, right, top and bottom. Anyone can help me to remove this ...
1
vote
2answers
100 views

Is there a way to make a command running inside a vim terminal open files in buffers?

I often find myself operating in the vim terminal needing to edit a few files. In this case I might type vim *.h. This opens a new vim instance nested inside my vim terminal. Is there a way to make a ...
0
votes
1answer
53 views

Warning:…Illegal mnemonic character; Could not convert X KEYSYM to a keycode?

Does anyone know how to prevent these annoying messages? bash$ gvim foo Warning: Name: subMenu Class: XmCascadeButton Illegal mnemonic character; Could not convert X KEYSYM to a keycode ...
2
votes
2answers
38 views

Is it possible to make a substitution command that preserves the case of the matched pattern?

Consider the following constant definition: define("_TBL_USERS","users"); Now, I want to transform it into: define("_TBL_USER_ITEMS","user_items"); I tried ...
0
votes
1answer
58 views

What's the simplest way of inlining a variable?

I've recently refactored vim-colors-solarized and I've stumbled on a code like this let s:foo = s:bar " used in multiple places " ... many lines let s:goo = s:boo " used in multiple places How can I ...
25
votes
5answers
5k views

How to use an external command in Vim to modify selected words and lines?

Something I've found useful in other editors is the ability to: take the selected text run an external command and pass the selection to its stdin take the external commands stdout and replace the ...
0
votes
1answer
133 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 ...
0
votes
1answer
17 views

Unable to reset settings after running command that triggers bash script

I have the following autocommand in my vimrc for vimwiki: autocmd BufWritePost *.md silent! VimwikiAll2HTML The VimwikiAll2HTML triggers a custom script with :! scriptname to process all the files in ...
0
votes
1answer
31 views

How to bind these keys to prevent recursive binding in Vim?

I have been trying to do :noremap j k and :noremap k j which works but instead of going up it goes slanted up and down. I want j to move up and k to move down which is opposite in vim. I also tried :...
1
vote
1answer
23 views

Autosave in vim causing side effects

I am trying to implement autosave in vim. I managed to put together these lines using this article - Understand Vim Mappings and Create Your Own Shortcuts! and added them to .vimrc " auto save on ...
3
votes
1answer
6k views

How to comment a line in vim?

#inlcude<stdio.h> int main() { printf("Hello world\n"); } I want to comment line where the cursor is. For, example if I am on the line printf then I want to get following - #inlcude<...
2
votes
0answers
93 views

Can't find hidden files in bash with fzf Ctrl-t or search for strings within hidden files with fzf's Rg command in vim

I just installed fzf for my bash terminal and the fzf.vim plugin for vim. I've placed the following code at the bottom of my .bashrc script: export FZF_DEFAULT_COMMAND='rg --files --hidden --no-ignore-...
3
votes
0answers
33 views

How to exit insert mode if pressing escape merely types “^[”?

I have neovim 0.4.2 running in a session of kiTTY 0.17.4 on OSX. I have pasted a long url while in insert mode. After doing this, every time I type BKSPC vim adds ^? to my document. Every time I type ...
0
votes
1answer
25 views

How can I make Neovim actually delete something instead of copy?

I find very frustrating in Neovim and vim that when I delete a text to replace it, what actually happens is that it copies the last thing I deleted. I've tried with this line in my init.vim: vnoremap ...
1
vote
1answer
34 views

How to create mappings with a function?

I am trying to create a function in vim that is capable of creating mappings for me. This is so I don't have to type out very similar commands over and over in my vimrc. Take these two mappings as ...
3
votes
1answer
44 views

Installing vim8.2 with python3.8 : Python.h not found

I have cloned the vim git repository (even tried to run git clean -xdf prior to configuring, as suggested here), then compiled with: ./configure --with-python3-command=python3.8 --with-python3-config-...
1
vote
1answer
115 views

Execute command in terminal mode at terminal startup

I'm trying to execute simple commands in the vim terminal mode, but cannot get it to work. For example, I tried nmap <F12> :let $VIM_DIR=expand('%:p:h')<CR>:terminal<CR>cd $VIM_DIR&...
0
votes
0answers
15 views

anyone know how to improve how filepaths are handled in vimwiki?

In VimiWiki plugin, using markdown syntax we can hyperlink to other files... it's great but the problem is how file paths are interpretted. Linking to a file in the current directory is simple and ...
2
votes
1answer
27 views

How to preserve options in Vim sessions?

I am using vertical splits to compare two files which cannot be compared with diff. I don’t know how to save specific settings in the session. Here is how I proceed: enable the settings: :set ...
0
votes
2answers
36 views

no + or * register when entering vim from ranger

I'm running Ubuntu 18.04 with i3wm. Vim and vim-gtk3 packages are installed. If I'm in a regular terminal and I start editing a file in vim. I can yank text to the + register as expected. However, if ...
2
votes
1answer
32 views

Is there a motion to select the comment block under the cursor?

One thing that I often need to do is reformat a code comment with gq or gw. For example, I often want to convert something like this: // Lorem ipsum // dolor // sir // amet int foo(int x) { ...
0
votes
0answers
19 views

gVim wont open skeleton code when creating new file

I am currently using gVim to code in C++. I've recently made a skeleton file that includes imports, macros, etc., so that every time I make a new .cpp file it automatically adds the skeleton to it. To ...
2
votes
0answers
28 views

How does ft-c-omni work and how can I make it faster?

As I was studying the various ways of doing completion in Vim 8.0, I came across the very interesting "omni-completion" feature and its 'omnifunc' option, which is specialized as ccomplete#...
1
vote
3answers
39 views

Can I remove all maps containing key?

I have a plugin (c.vim) which includes a lot of maps (all with leader key). I changed my leader key to space, which I like, but the problem is that the maps also apply to insert mode. I would like to ...
3
votes
2answers
98 views

Is it possible to enter visual mode without changing the last visual selection?

In a script, I want to delete a rectangular block of text. For example, I want to convert this: ABCD EFGH IJKL MNOP into this: ABCD EH IL MNOP One way to do this is with visual block mode. Move the ...
4
votes
3answers
6k views

How could I create a terminal at the bottom

I could create a terminal with vim by running :term in the vim normal mode. However, this terminal is opened at the top of the window and I would like to open it in the bottom. How could I open it at ...
1
vote
0answers
24 views

How can set up ALE to be opt-in?

I'm trying to use ALE for auto-formatting for one specific language, however it has everything turned on for all languages by default and I can't figure out how to configure it so that it's disabled ...
1
vote
1answer
39 views

Is it possible to view a history of commands (per mode) executed in Vim?

I sometimes execute commands in Vim by mistake, either in normal-, visual-, or ex-mode and have no idea what was executed. Is it possible to see a history of executed command per mode in Vim? I know ...
2
votes
1answer
41 views

Yank visual selection with modifications in a terminal-buffer

Upon writing a code, sometimes I open a terminal split with :term to test it by issuing some commands and checking some output. As an example, this is a fragment of what I have executed in a split ...
3
votes
0answers
36 views

Unicode in vimrc no longer displaying correctly

I'm using VIM 8.1.2234 with +multi_byte and +multi_lang In my vimrc file, I have set listchars=tab:▸\ ,trail:· (Notice the "▸" and the "·") When I cat or less my vimrc, the text ...

15 30 50 per page
1
2 3 4 5
187