All Questions

Filter by
Sorted by
Tagged with
1
vote
1answer
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 ...
2
votes
0answers
22 views

Allow pasting into all modes, not just insert [duplicate]

I use command-line vim in xterms (actually TERM=rxvt-unicode) and have long been used to allowing X to manage all mouse interactions, with vim remaining blissfully unaware of the difference between ...
1
vote
1answer
38 views

How to send messages from terminal to Vim using the JSON API?

Vim 8 built-in terminal allows communication to and from a running job. The manual describes a terminal API :h terminal-api that lets a running job to Vim. An example message is provided to open a ...
3
votes
1answer
86 views

Replace from the current position to the end of the line

Is there a way to search and replace replace from a specific position in the line to the end of this line? I am here and you are there ^ I tried to show cursor position with ^. For instance,...
2
votes
0answers
44 views

Vim has started adding commas unnecessary places [duplicate]

When I use :w to save my JSON file, vim automatically adds some commas at syntactically significant (?) places.  It does not happen when I use :x or ZZ.  This started today.  I did not change anything ...
0
votes
2answers
61 views

Review: git branch in statusline

I am learning vimscript, and below the part of my .vimrc used to display the current git branch in the statusline. I am aware that there are ready-made options out there, but this is more of an ...
2
votes
0answers
35 views

How do I delete a block a text using the mouse cursor?

Yes, I know this is unconventional, but I just want to know. When I right click on a chunk of higlighted text, the dropdown doesn't show any option for deleting - just copy, copy as html...show ...
2
votes
1answer
18 views

How to prevent vim from highlighting random words and types

I've been trying to disable vim from highlighting random words and types for a few hours now. I've noticed vim will highlight specific types when I write python and golang programmes. Even my .vimrc ...
0
votes
1answer
25 views

Option doesn't happen when opening vimrc?

I added this line to my .vimrc: set formatoptions-=ro. When I open any file it works as intended, except if it is .vimrc. In that case it doesn't work. Why does this happen and how to fix it?
1
vote
2answers
53 views

How to move a cursor to the last line with auto indent?

Assume autoindent is set, and you have the buffer below. Note the cursor is represented as I. for i in range(1, 6): print(i)I When you hit Enter key, you get this. for i in range(1, 6): ...
2
votes
0answers
41 views

Cycle between modes in fzf.vim

I'm using fzf.vim instead of ctrlp.vim for quite some time now but there is one functionality that a miss quite a lot. In ctrlp.vim once you have the extension opened you can cycle between modes using ...
0
votes
0answers
18 views

Vim what the :c command do? [duplicate]

On vim I enter for a mistake the :c And I can exit only with ctrl+c What the command :c do?
3
votes
1answer
22 views

Float YCM completion candidate list to make more of entry previews visible?

Using plugin YouCompleteMe, I get useful previews of entries. However, if the cursor is near the end of the line, the list gets out of sight. Screenshots below; the latter with pumwidth=75. (First ...
3
votes
1answer
27 views

How do I get the text that is chosen by some motion?

I'm wanting to write a simple plugin that allows using a motion to choose some text and then processes that text. I'm trying to find out how to get the text that a motion results in. So far I haven't ...
2
votes
1answer
30 views

copy or yank from line x until line y

I know about :yN for example , :y10 , yank 10 lines from current line. I need to yank from line 73 until line 81, How can I do it?
2
votes
2answers
33 views

abbrev for multiwords

How to add abbrevs made of more than one word? I've been trying: iabbrev a aquilo àquilo iabbrev a aquele àquele iabbrev a aquela àquela What I want to do is have the two words "a aquilo" expand to ...
1
vote
1answer
22 views

Is it possible to do consecutive vimgrep searches to refine and filter results?

If I do a grep search within vim, I'll get a list of results that I can browse using :lopen. Is there a way to do a subsequent search on only these resulting files? Basically I want to do refined ...
0
votes
1answer
28 views

Add a line after 1 line after match in Ex mode

I need to search for a string in a file, then I need to some text after one line following the first match. I need to perform this for a number of files in a script. I am trying to use vim ex mode ...
0
votes
0answers
30 views

unable to copy to system clipboard with +clipboard and +xterm_clipboard in vimx

The system is Centos7.2. I have installed vim-enhanced and vim-X11, used vimx command. It shows that vimx supports clipboard and xterm_clipboard. But in vimx, there is no reg + and reg *. I can't ...
1
vote
1answer
21 views

Switch pyflakes linter from python2 to python3 in ALE

pyflakes (with ALE) automatically defaults to python2 instead of python3 and gives me false errors and there are no variables in ALE documentation letting me change python versions. Thanks for any ...
1
vote
1answer
26 views

Entering visual mode is selecting whole lines unexpectedly

I'm editing a small bash script: d=$1 year=$(date -d"$d" +%Y) month=$(date -d "$d" +%m) day=$(date -d "$d" +%d) hive -f /home/gavin_cameron/hive_queries/dc_player_daily_snapshot.hive -d ...
2
votes
1answer
35 views

shared vimrc on two machines; only run command for one of them

I use git to share my vimrc across multiple machines. But now I have some commands which I only want on one machine. Namely, this line: au! redhat BufReadPost (derived from this very helpful answer! ...
0
votes
1answer
21 views

Ultisnips Sinppets in current scope on blank line

Background I'm using UltiSnips in conjunction with some autocomplete plugins. I have this line controlling the behavior of enter inoremap <expr> <cr> \ !empty(UltiSnips#...
0
votes
0answers
26 views

Run project specific _vimrc in windows?

I'm attempted to duplicate this functionality in a windows environment running gvim 8.1 but it doesn't appear to pick up my changes. I've updated my $VIMRC\_vimrc with set exrc set secure and my ...
0
votes
0answers
25 views

Autofix a single line in ALE

When prettier tells me to take one line with a whole object and put every property on a new line, I want a key to autofix that. I know prettier has things that can be auto-fixed, but I have no idea ...
1
vote
1answer
23 views

How to run Vim Diff without enter in interctive mode?

I really like the vimdiff / vim -d , it's awesome. But I need to see the vimdiff result without enter in the interactive mode. Show the result colored , scrolling all differences and exit. Behave ...
0
votes
1answer
21 views

How to update vim on centos7?

By default, the version of vim on centos7 is 7.4. I want to update it to vim 8. There are some questions with 'https://copr.fedorainfracloud.org/coprs/mcepl/vim8/repo/epel-7/mcepl-vim8-epel-7.repo -o /...
1
vote
0answers
23 views

Prevent “Pattern not found” error in autocompletition (i_Ctrl-N)

I use the following mapping for <Tab>: inoremap <expr> <Tab> getline('.')[col('.') - 2] =~ '\w' ? "<C-N>" : "<Tab>" It works well except that if I want to insert a tab ...
1
vote
1answer
33 views

How to pass everything from a command into a function with escaped characters

These are my scenarios and expected output function! s:Foo(text) echoerr "'" . a:text . "'" endfunction command ... FooCommand ... (not sure what to write here) FooCommand text 'text' ...
1
vote
1answer
13 views

Colorscheme Errors (E185) with vimrc and sessions

I have a couple of things which suggest there's an issue with the way I use colorscheme with my vimrc file. Errors when running source ~/.vimrc The colorscheme used when opening a vim session ...
0
votes
2answers
32 views

Return cursor to an initial position after pasting text from a function

in my plugin, i am joining XML tags together depending on a mapping a use. It also uses so i can make XML snippets repetitive. After inserting the text into a buffer, i would like the cursor to ...
1
vote
0answers
38 views

Is there a simple way to navigate a generated file that includes # line preprocessor directives?

I'm working on a code generator tool. I'm planing to use # LINE "filename" directives like the ones generated by the C preprocessor to show the relationship between the generated code and the original ...
2
votes
0answers
25 views

head isn't included in syntax/sh.vim

head is a common Unix/Linux executable, but it's not listed in the shell syntax highlighting configuration. In contrast, many common executables are. Specifically, its counterpart, tail, is listed. ...
3
votes
1answer
35 views

Write several files all of which have been changed since read [duplicate]

I opened several files in vim and then switched git branches. I want to save the versions I have open to the new git branch, for all of them, without having to silence the WARNING: The file has ...
0
votes
1answer
30 views

How show underlying container for vim, ie xterm etc

When I run :maps that use ! to execute linux commands, the vim display is suspended to show the command output in the underlying container (xterm in my case). When the mapping terminates, any shell ...
1
vote
0answers
15 views

Word wrap when printing a file with hardcopy

While in ViM I can set the linebreak option to make a long line wrap at the end of the window avoiding a word to be split in two pieces, but I cannot find an equivalent option while printing a file ...
0
votes
0answers
34 views

Regex match inside XML container

I'm trying to match data in a gnucash record, without skipping into the next record, so basically needing to stop matching at the closing tag. The record looks thus, for example: <trn:split> ...
2
votes
2answers
17 views

Automate breaking of history in insert mode

I started to learn ViM one month ago, so I'm not a ViM expert. My question is: if I make some changes in insert mode (let's say I type some text, then I delete the last two words and finally type ...
1
vote
1answer
40 views

How to set LaTeX syntax to “ConTeXt” in vimrc

TL;DR: How do I permanently and persistently :set syntax=context for *.tex files? I've been using vim for a LaTeX project, with monokai-tasty as the colour scheme. The default syntax highlighting ...
0
votes
1answer
51 views

Run vimscript function only once although v:count1 > 1

I have a function that accepts a count of iterations, its command is defined with -range: command -nargs=1 -range DocbkPrintTag :call s:DocbkPrintTag(<f-args>) and to output <listitem> &...
1
vote
0answers
25 views

Automatically saving on FocusLost sometimes stops working for a gvim window

In my ~/.vimrc I have at the moment: autocmd BufLeave,FocusLost * nested silent! wall Which most of the time works as I would like, however sometimes it seems saving simply stops working (for a ...
2
votes
1answer
39 views

How can I hide *.extension~ files by using auto hide plugin?

I have successfully hidden undo files by using this auto hide plugin, but I could not hide any *.extension~ files. suppose I created a.txt Now there are two files shown in windows explorer a.txt a....
1
vote
0answers
53 views

Break visual line without hard breaking line

Is it possible to break visual line without breaking line? For example: Some text blah blah "insert visual break" "cursor now here" keep writing. But both these sentences is one wrapped line. ...
0
votes
1answer
23 views

Changing PYTHONPATH from inside VIM

Today I was writing code in VIM and wanted to change the PYTHONPATH and so I ran: :!echo $PYTHONPATH;export PYTHONPATH="/home/oli/git/published_libraries/computer_communication_framework";echo $...
1
vote
2answers
66 views

Exclude files from vimgrep by using bash file name expansion?

Say I have files File1.m, File2.m, and File3.m in the current directory. I want vimgrep to search all but File3.m. After reading the help on using backticks to specify files for vimgrep, I tried: :...
1
vote
1answer
18 views

Abbreviations: Count backslash as part of the word

I am usually writing LaTeX documents. I like to use :iab iso isomorphism so that if I write a sentence like This map is an iso., it will expand to This map is an isomorphism.. However, I also quite ...
2
votes
1answer
23 views

Trouble mapping <control-pipe> in new keybinds

I've recently decided to improve my multiple-pane Vim workflow, so I'm adding some new mappings to avoid the awkward <C-W> command. Here's what I have currently: " split-pane navigation remaps ...
1
vote
2answers
21 views

Can I use syntax highlighting on an unwritten buffer?

I pasted some code into a new, unwritten buffer in Vim. I'd like to do some quick edits on the code without saving it to a file, but it hurts my eyes to look at code without syntax highlighting. Can ...
0
votes
1answer
22 views

Adding directory (header and source) to autocompletition search

I use Ctrl+P and Ctrl-N for autocompletition, and since I have library sources in another directory, like /opt/ST/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/inc /opt/ST/...
2
votes
1answer
21 views

Auto replace special programming characters

Programming in Javascript and similar syntax languages we use a lot of {} and (), more so than [] and the 90. Therefore we end up using SHIFT a lot. Is there a way to make it so that when I type [ ...

15 30 50 per page