All Questions

Filter by
Sorted by
Tagged with
1
vote
2answers
6 views

Get file name and directory in .vimrc file

I have mapped my f5 key in vimrc file to run the code using the following command: map <F5> :!sh -xc 'cd "/home/hashir/vscode/" && g++ test.cpp && ./a.out It is working well. ...
1
vote
0answers
13 views

Vim go into insert mode when as a macro starts

When doing <ESC>qq you can record a macro into the q register (still in command mode though). How can I make <ESC>qq go into insert mode right away (without having to type i)? map qq qqi ...
0
votes
1answer
13 views

How to move airline status bar to the bottom of the editor?

There is VIM's default bar below my Airline's status bar, which causes file information to be viewed twice (as shown in the image). How can I move my airline's bar to the bottom? I have tried adding ...
0
votes
0answers
7 views

ale is not showing any error/warning

My ale plugin is not showing any error even though ALEInfo says there is. Here's the output from my ALEInfo: Current Filetype: javascript Available Linters: ['eslint', 'fecs', 'flow', 'flow-...
1
vote
1answer
17 views

how to map # to , (when , is my leader) while using vim-sneak

I use ',' as leader, so when I f/t and I want to go to previous hit, I cannto use ',' I tried using #: nnoremap # , My mapping shows up (I think), :map # shows this n # * , but it does ...
1
vote
1answer
25 views

Enable Expr Folding in Markdown

I want to fold in markdown using the built in markdown plugin that I believe should come with the version of vim I have (Vi IMproved 8.1 (2018 May 18, compiled Apr 23 2019 20:02:08)). I am struggling ...
2
votes
1answer
53 views

regex that requires that two matches have the same length

I'd like to find a regex that matches Setex-style headings like: My Heading ========== The headings text and the underline need to be of the same length. However, I don't know how to specify a regex ...
3
votes
1answer
43 views

Is there a way to make some modeline that applies to all files in a directory, recursively?

I have a project consisting of files that Vim doesn't recognize by default, but has support for highlighting and indentation. I would like to have a vimrc file or a vimmodeline (or whatever similar) ...
2
votes
0answers
25 views

How to get this tab/autocompletion setup?

Basically what I want is a PyCharm-like completion: If there is only whitespace, insert <TAB>. If pum is visible and nothing is selected, complete with first, otherwise choose the selected word/...
1
vote
0answers
25 views

gvim adds one extra pixel spacing after each character?

For some reason, gvim is adding one extra pixel of spacing after each character. It almost seems similar to this question, but in my case gvim does use the correct font. I compared the same font in ...
1
vote
1answer
25 views

getting vim to autocomplete python methods

I am coming from statically types languages, but I will have to be using python for the next few years and I want to get my setup as smooth as possible. Right now I am using vim-jedi, and deoplete-...
2
votes
2answers
37 views

Is it possible to use a reverse range in global search

I have an error report where often the known errors are in the top few thousand lines, formatting issue rather than quantity unfortunately. I want to run :g/pattern/ from the end of the file. I know ...
17
votes
1answer
1k views

Go to last file in vim

Many text files can be opened at once using vim *txt I know I can use :<int>n to move forward <int> files, but I don't know how to get to the last opened file. So far I've tried :1000n ...
3
votes
1answer
69 views

Can I mark some piece of text as bold?

For example, lets say I have a line like: Hello, this should be bold. Then is there any way to change one or more words to be bold, so it will appear on the screen as: Hello, this should be ...
1
vote
1answer
23 views

“Press ENTER or type command to continue” -writing second command returns to the editor mode

When I write first command I get the "press enter or type command", even if I try to type second one it returns me to the editor mode, even though I would like to stay on console. I am new vim user.
3
votes
1answer
41 views

Remapping motion keys [duplicate]

I recently found the awesome plugin named CamelCaseMotion which is awesome. I used their suggested mappings in my .vimrc for the plugin like this: map <silent> w <Plug>CamelCaseMotion_w ...
2
votes
0answers
9 views

Get neomake to recognize python and gcc location

I installed the latest versions of Python and GCC/G++ in alternative locations. I am using SpaceVim. I think SpaceVim is using neomake as the default. I want to know how you can configure neomake to ...
0
votes
2answers
20 views

how can i remap <C-w>{number}h to <C-w>{number}j

I am trying to remap my hjkl keys to jklö. this is not a problem in most simple cases, but with commands like <C-w>h where you can specify an amount in the form of <C-w>{count}h or {count}&...
2
votes
2answers
10 views

How to open one file as “read only” but the others as writable using command line?

Here is what I am doing now: vim + $1 -c "set titlestring=$title guioptions-=m guioptions-=r lines=66 columns=239" -c ":source .vim_map" -c "sp .help.txt" -c ":wincmd j" I would like to open the ....
1
vote
1answer
54 views

Powerline font not working with airline in (g)vim on Windows 10

I'm trying to set up patched fonts from powerline/fonts with airline in gvim under Windows 10 64 bit. As you can see from the screenshot here: the characters from the font do show up, but the airline ...
3
votes
1answer
133 views

Cannot sort my bash functions correctly

I'm trying to sort my bash functions inside my .bash_functions file. Here is what I type : :g/^function /,/^}$/ s/\n/@@@ :sort /^function / :%s/@@@/\r/g EDIT0 : Here is some of the input : ...
1
vote
2answers
53 views

Insert text in the middle of a string vimscript

I'm trying to make a function in vimscript that converts markdown to html files using pandoc and putting that converted file in a specified directory. Currently i am putting the file in a directory ...
0
votes
0answers
34 views

Correct way to setup python version for coc

I want to set PYTHONPATH and python interpreter according to projects I am working on. I am working both on projects involving python 2.0, and ones involving python 3.0. There is the concept of ...
0
votes
1answer
81 views

Vim error detected

Vim error detected Everytime i quit the vim i got this error, it's just pop up in a second. I already upgrade the vim to the latest version but still got the same error.. How to fix that? The error ...
2
votes
1answer
28 views

Vimwiki open specific diary on vim startup with bash alias

I am trying to figure out how to open a specific vimwiki diary on opening vim. With one wiki I use an alias like alias todo='vim -c VimwikiDiaryIndex' which works perfectly. But now I want an ...
2
votes
2answers
53 views

Using visual selection or register for search and replace

Is there a way to use a register or visual selection for search and replace? I have some longer sequence of words that are used repeatedly in my script. I want to replace them all but want to avoid ...
1
vote
0answers
40 views

How to avoid dialog box when using echo in vimrc/gvimrc file?

If there is a echo/echom sentence in the vimrc or gvimrc file, a dialog box is popped out when gvim starts. How to avoid this?
3
votes
1answer
25 views

Match <Esc> only for the ESC key, not escape sequences

In a normal mode key mapping I'd like to match the ESC and only this key, not key sequences like caused by the arrow keys. Background: I thought I'd torture myself in the process of avoiding excess ...
1
vote
3answers
63 views

What's the deal with the Vi/Vim in Ubuntu 18.04/19.04?

Is it different to standard Vi/Vim, if so how and why? Is it Vi or Vim? It does show a version string/identifier that would suggest it is Vim 8.1.320 though oddly it is opened with the 'vi' command ...
2
votes
0answers
16 views

How to get tpope/vim-rails gf command to work with SpaceVim

I am using SpaceVim as Ruby on Rails IDE and installed the tpope/vim-rails plugin. However, the other commands like :Econtroller, :Emodel, :find, commands are working just fine but the gf command ...
3
votes
1answer
39 views

Add comment to file while opening (C)

I have output from static analyzer, that I parsed with Bash. Now I want Vim to run on specified by analyzer line and add comment containing warning id and description. I tried this, vim $file +$...
1
vote
0answers
15 views

Quickfix mode with path transformation

I have a build log file from compiling a project with Visual Studio on a Windows machine, and would like to use quickfix mode to jump to the errors and warnings in that logfile. The logfile is read ...
2
votes
2answers
71 views

How to get line numbers of a different window

I would like to get these line numbers of a different window without moving to that window. line('w0') line('w$') line('.') line('$') As for the first two, we can use getwininfo([{winid}]) which ...
1
vote
1answer
18 views

Is it possible to `lmap` a key to multiple characters?

I want to use f and t command for Unicode characters, so lmap is the way to go. I can map a letter to a Japanese kanji: :lmap k 中 then after i_CTRL-^, I can press fk to locate 中。 However, there is ...
2
votes
1answer
37 views

Write text under the cursor to new file and delete it form current file

I have this in my vimrc: " Export text under the cursor noremap <leader>e :w! >><Space> This allows me to select text using visual mode, press leader e, type a file name, and ...
3
votes
1answer
45 views

What is the #{} syntax in Vim?

I just noticed this in a Vim help page: popup_beval(s:balloonText, #{mousemoved: 'word'}) What is the #{mousemoved: 'word'}? It looks like a dict? I tried using :help #{, but that doesn't show any ...
2
votes
1answer
45 views

How can I merge two dictionaries in Vim?

I have two dicts: :let defaults = {'hello': 'world', 'bye': 'jupiter'} :let override = {'hello': 'mars'} How can I merge the keys from override so that I end up with a new dict like so: {'hello': '...
1
vote
1answer
16 views

Replace the regex search term with the new character along with the regex term

Consider the following text: alpha0_inc0 : beta0_inc0_term alpha1_inc1 : beta1_inc1_term alpha2_inc2 : beta2_inc1_term alpha3_inc3 : beta3_inc0_term I want to replace text matching the regex inc\d ...
2
votes
0answers
16 views

Different syntax highlighting in the same file for different languages

Is there a way to use more than one syntax highlighting schemes in one file? Specifically, I'm interested in having part of a LaTeX code highlighted according to my python syntax highlighting rules:...
2
votes
1answer
9 views

Vim 8.1 on Windows 10 Won't Detect Packages in $HOME

Take a plugin like Flake8. It instructs users to install using Vim 8's package manager by: mkdir -p ~/.vim/pack/flake8/start/ cd ~/.vim/pack/flake8/start/ git clone https://github.com/nvie/vim-flake8....
3
votes
1answer
51 views

How to enable “on-the-fly” autocompletion?

How can I make it so that no command or extra keystroke is required for the autocompletion menu to pop up? i.e. what I want is the menu to be always present while in insert mode and to be constantly ...
3
votes
2answers
41 views

How do I disable a a key in Tagbar

I've mapped 'L' and 'H' to change buffers in vim. I often end up hitting these keys in NERDTree and Tagbar. I'm able to use NERDTreeAddKeyMap to make NERDTree ignore keys. Tagbar only allows the use ...
1
vote
1answer
42 views

is it possible to map numpad differently?

Currently, the numpad does the usual things(input numbers and so on). numlock does nothing. I wonder if you can differentiate numbers/char entered on the numpad from those typed on the main section ...
1
vote
0answers
37 views

sort json content in terraform file

I'm trying to sort following json that is inside of terraform file. I'd like to sort it alphabetically by "name" value (ENV->PORT->USERNAME): { "name": "PORT", "value": ...
2
votes
0answers
21 views

How do I setup Mypy with Neomake

I'm trying to use Mypy with Neomake, but without success. I am currently using flake8 with Neomake, and it works seamlessly, e.g.: def foo(bar): return 1 foo(1) > E305 expected 2 blank lines ...
1
vote
1answer
23 views

How add new date formats to work in 'tpope/vim-speeddating' vim plugin?

In vim plugin 'tpope/vim-speeddating', it support wide variaty of date formats. e.g. %Y-%m-%d%[ T_-]%H:%M 2019-08-04 07:42 %Y-%m-%d 2019-08-04 But how to add my ...
1
vote
1answer
70 views

Is there a quicker way to go from the cmd window to normal mode?

Is it possible to map <esc> to close the cmd window and go to normal mode? Currently pressing <C-c> closes the cmd window but takes you into Cmdline mode. So you have to press either <C-...
1
vote
1answer
47 views

how to load vim8 optional packages in vimrc?

I am trying to load my optional language packages based on filetype. I am using vim8 native package feature. In vim I can load them with :packadd vim-javascript. However, I read in :help packadd - (...
3
votes
1answer
36 views

How to map number keys within motions typed during the operator-pending mode?

Typing source code is easier for me when the numbers row above the letters (the numrow) is permanently shifted, giving me access to the symbols at a single keypress, without pressing Shift. The ...
1
vote
1answer
20 views

Search/replace multiple lines with confirmation

I'm trying to write a substitution command that would search for a line that doesn't end with a space character and others (see regex) and isn't followed by an empty line. The line length may vary ...

15 30 50 per page