All Questions

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

[no]foldenable / foldmethod for each buffer but keep those settings persist for each buffer

I have two opening buffers and one has foldenable and foldmethod=indent, other has nofoldenable and foldmethod=syntax. I need that when I move between buffers, each buffer has it own fold settings ...
0
votes
1answer
102 views

Neovim - Run a forward command with python

I need some help with writing a python plugin. I know how to create a plugin but I can't find a way to run a forward or any normal mode stuff. I know I can run commands like echo with self.vim....
1
vote
1answer
25 views

Open split window at far left

I use :vs to open a window. If I want this window to be the leftmost window, no matter what the currently active window is, how can I do it?
1
vote
1answer
18 views

What setting causes my autoindent to add indent on a new line?

I have this go code snippet that I am working on in vim with vim-go enabled. | is where my cursor is at. // PlayerServer is a HTTP interface for player information type PlayerServer struct { ...
1
vote
1answer
45 views

Is there any way to execute ex command without adding it to the command history?

When I start vim, I always use -s SCRIPT_FILE_NAME option to execute additional commands. In SCRIPT_FILE_NAME, some ex commands are written. Let COMM denote the additional commands in the file. The ...
1
vote
0answers
8 views

Using NerdCommenter to comment/uncomment blocks with old-style C comments

I'm using the NerdCommenters leader c<space> to toggle comments on blocks of C code, but when those blocks already contain C comments, they get replaced, by default with [> and <], and ...
1
vote
2answers
30 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 ...
0
votes
1answer
92 views

in function how to stop visual mode and how to run a mapping

Assume I am inside a function and currently in visual mode (mode() returns v or V or "\<c-v>", such as when you run vmap-expr) How can I quit the visual mode? Should I call feedkeys("\<esc&...
3
votes
1answer
23 views

How to manually install pangloss JavaScript plugin?

If possible, I would prefer to not start using a package manager for now. I'm trying to manually install this plugin for editing JS files: https://github.com/pangloss/vim-javascript I have looked ...
1
vote
1answer
32 views

Vim is executing commands it read from a function

On one copy of Vim that I use sometimes, I get errors like this when I start up: Error detected while processing /home/besham/.vimrc: line 524: E749: empty buffer line 555: E749: empty buffer line ...
0
votes
0answers
13 views

Create a netrw window in each new tab created

I have the netrw plugin's g:netrw_browse_split=3 option turned on, so every time I click on a file in the explorer, it opens the file in a new tab. I was wondering if it is possible to open a new ...
1
vote
1answer
76 views

Inserting a square bracket as part of search and replace

I have the text pattern [2] in a text file. I want to replace it with the text string '[1]'. Using the command: :%s/\<[2]\>/[1]/ only replaces the string '2' in the square brackets so the ...
1
vote
1answer
26 views

Is it possible to supply arguments to inoremap?

Currently, I have the following map for cpp files: inoremap ;;f for<Space>()<Space>{<Enter>}<Esc>kkf)i Which essentially allows me to quickly setup a c-style for loop. ...
1
vote
2answers
141 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....
51
votes
4answers
34k views

How can I integrate gdb with Vim?

Instead of gdbtui or ctrl+x under gdb which shows source code on top of the screen I would like to see this in my Vim editor that would jump between tabs, and buffers accordingly. How can I do this?
1
vote
3answers
51 views

Non ascii characters to similar ascii characters at Vim

I want to convert nonASCII characters to similar ASCII alternatives. I can do it at shell using echo şİçğ | iconv -f utf-8 -t ascii//translit but how can I do it for selected vim text?
0
votes
1answer
22 views

Can a vim session use environment variables to specify the path to a file it opens?

Can you edit a vim session, so that it opens a file based on the value of an environment variable instead of an absolute path to a file?
0
votes
1answer
1k views

Can I set multiple 'options' with a single `:set` command spread over multiple lines?

Is there any way to set options typed on multiple lines with a single :set command? Here is a part of my vimrc: se nu se sm se hls And as you see, I have se on every line in which I set an option. ...
0
votes
1answer
72 views

Installing a Vim package. syntax highlighting does not turn on

I want to use the nuweb.vim extension for syntax highlighting nuweb files. Long story short, nuweb files are basically a super-set of latex files. There is added syntax and markers to embed code-...
0
votes
2answers
47 views

Mapping Ctrl + mouse click

I want to map Ctrl + mouse click to a command: nnoremap <C-???> :YcmCompleter GoTo<CR> Is it possible to do that using nnoremap? What symbol should I use for that?
0
votes
1answer
25 views

In Vim how to keep markers per session?

I use sessions to separate projects in my workflow. - info.txt file that I always mark "I" - log.txt file that I always mark "L" But when I switch sessions, my markers are kept from the last ...
1
vote
1answer
22 views

Pasting modified register contents into Visual Block selection

Consider this mapping: vnoremap <leader>U ygv"=toupper(@@)<cr>p It will yank the current visual selection, select it back, and then put a modified version of it. In this case, uppercase ...
0
votes
0answers
29 views

I am running into problems while using Gpush command from vim-fugitive plugin

I have recently started using the vim-fugitive plugin, and currently I am facing problem with the Gpush command. I tried :Gpush % which gives me errors in the quick fix window saying fatal: ...
3
votes
1answer
49 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 ...
1
vote
1answer
129 views

How to visually select a pattern only on current line using vimscript?

I'm trying to write a vimscript function that will allow me to map a key to select a regex match on the line my cursor is on. This will help with selecting strings for use with ctags. For example, I ...
0
votes
1answer
29 views

fzf vim - when configured to display filenames of matched items, how to filter on just content and not the file names

I've configured my .vimrc file for GGrep: command! -bang -nargs=* GGrep \ call fzf#vim#grep( \ ('git grep -i --line-number '.(isdirectory(expand(".git"))?'--untracked ':'--no-index '))....
0
votes
1answer
108 views

Syntax folder under plugin/foo/syntax/foo.vim not automatically applied when filetype change?

I have a plugin under nvim/plugin/foo, but the syntax file nvim/plugin/foo/syntax/foo.vim is not automatically applied when the filetype change, but if I put it under nvim/syntax/foo.vim it works I'...
16
votes
4answers
18k views

How can I change the indent size?

I just discovered I could indent and un-indent easily in Vi with : << and >> By default it adds a tab character. Now I'm wondering, could this be to a number of spaces via a configuration in my ...
2
votes
1answer
165 views

autocompletion - How to add phrases as thesaurus synonyms

I have a thesaurus file which contains synonyms for the word iterate. I would like to add an alternative phrase for iterate like loop over so I added it to the thesaurus. Unfortunately, this doesn't ...
1
vote
0answers
23 views

Use the PYLS python LSP with ALE on Neovim

I installed NeoVim and dense-analysis/ale plugin with vim-plug. All of those seems to be installed, as the commands starting with :ALE autocomplete in NeoVim. Then I tried to install PYLS via ...
1
vote
0answers
17 views

Mapping breaks built-in Vim command? [duplicate]

In Vim the commands <C-o> and <C-i> move backwards and forwards through the jump list. :h CTRL-I I noticed that <Tab> is the alternative command you can use instead of <C-i> ...
1
vote
1answer
718 views

Make YouCompleteMe open definition in vertical split even if buffer is not saved

There is something I cannot do with YouCompleteMe that I could do when just using tags to navigate to a definition or declaration. The desired behaviour is (taking into account that , is my leader ...
0
votes
1answer
34 views

How to subscribe event by using nvim_subscribe

I am trying to handle events of nvim using nvim_subscribe() API via RPC. For instance, calling nvim_subscribe('CmdLineEnter'). I am not sure the specification of this API exactly, but I imagine that ...
2
votes
1answer
17 views

How to set printexpr on MacVim persistently?

Using MacVim 8.1.1722, if I print a buffer, it opens a PDF in Preview.app. I want to open the PDF in Google Chrome instead. So I changed the file association so open foo.pdf opens Google Chrome not ...
0
votes
1answer
86 views

In Vim, how to tag/enrich buffers with custom information (that persist naturally)

Gday, I am trying to persist some state about my buffers, specifically terminal buffers, over vim sessions with :mksession through the plugin 'vim-session' by xolox. The goal is to assign labels to ...
103
votes
6answers
57k views

How do I change the current split's width and height?

I am working on split (using ^w+v, ^w+s) buffers, but sometimes I would like to widen a current split or change its height. How can I achieve that?
57
votes
10answers
49k views

How can I clear word highlighting in the current document (e.g. such as after searching for a word)?

When you search for a word in a file with something like /console.log, all of the instances of console.log are highlighted. When you're no longer interested in these, the highlighting can be ...
3
votes
2answers
79 views

Inserting text with the Python interface

I would like to insert some Python-generated text at the current cursor position in insert mode using the Vim Python interface. The closest I have so far is: imap <c-x><c-r> <c-o>:...
1
vote
1answer
42 views

Make vim remember the fileformat of a buffer

I am using vim to view Spyder's Python comman history. I set to :e +=ff=dos to get rid of ^M at the end of each line. When I switch to another file, then switch back, the fileformat is unix again. ...
0
votes
1answer
27 views

How can I look up the current/default guifont reliably?

I'm trying to configure my guifont and I'd like to see the current setting so I can e.g. keep the same font but change the size. Is there a way to check the current font that works reliably, even if ...
0
votes
2answers
44 views

Find and replace only between searched patterns

Editing large HTML file. Would like to do something like: :/<blockquote>/,/<\/blockquote>/s/^\(\s\s\+\)\(<[^>].\{-}>\)/\1 \2/g So basically just trying to indent all between ...
3
votes
2answers
88 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
0answers
26 views

How do I remap result navigation buttons after a search?

I search with /, press enter, and go a few results down using n. I realize that I have gone a few more results down than I meant to and want to go back a few. I press m because that is next to n just ...
1
vote
1answer
22 views

Find the location of a directory at runtime to provide a default directory

I want to move some scripts that I have made to some sort of standalone plugin. The content would look like myplug/ plugin/ mydefaultdir/ For the scripts, I require a set of files which could ...
2
votes
1answer
56 views

Is there a function for blockwise visual selection in Vimcript?

I have two text files including steps, one is the main-file which has the entire steps and the other one is a sub-file has only part of steps. As follows. [main-file] SeqMain.txt 0001 K1G554 1 1 ...
2
votes
1answer
19 views

Configure formatting to indent all lines of a numbered list (enum-list)?

How to make vim respect the enumerated list indentation also on consecutive, not only on the second line? I.e. so that pressing gq on: 1. A long line reaching near &tw. following text on the ...
3
votes
1answer
142 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 : ...
8
votes
1answer
288 views

Dealing with case insensitive filenames on Windows

I'm using the latest vim/gvim (8.0.118), but have noticed this problem in the past, with other versions. I created a file named fizzbuzz.java (outside of gvim), and opened it in a new tab in gvim on ...
1
vote
0answers
21 views

matchparen made a wrong match on angle brackets

I used the MatchParen to match the parenthesis while coding C++ projects. Here is my config in .vimrc: hi MatchParen cterm=underline ctermbg=NONE ctermfg=DarkCyan set matchpairs+=<:> However, ...
1
vote
1answer
70 views

xml ftplugin overrides textwidth

I would like to hard wrap XML files during editing. In every other filetype my set textwidth=80 works fine. But in XML something overrides the insertion of line breaks. I tried adding t to ...

15 30 50 per page