2018-10-21         Borg

Vim: How to reformat a set of lines into a single line (if the line is a single sentence)?

Not a dup of In Vim, what is the simplest way to join all lines in a file into a single line?, as I specifically mean to use the gq reformatting functionality.I used to write latex in vim using 80 character textwidth. However, I've now switched to an infinite textwidth, so my lines go on forever.Vim's reformatting (gqap for example), combines a few lines into a paragraph, wrapping them at 80 characters. I'd like it to instead combine them into a single line.ieWithout a \clang{goto} statement in the HIR, we must instead use conditionalstatements to check the iteration number...

 vim                     2 answers                     9 view
 2018-10-21         Tracy

Can't read when Vim/Neovim highlight same color as text

I've been trying to take my vim/neovim game to the next level and one of the things I've been trying to do is fix the highlighting issues I've been having. The gist of it is that at times, syntax, visual selection, and search highlighting use the same/similar color for the highlighting as the original text, making it difficult to see what has been highlighted. Does anyone know how i might be able to fix this? based on the first screenshot, it looks like its completely capable of doing so, I just can't seem to find a config option to make it consistent.Here are some examp...

 vim                     1 answers                     90 view
 2018-10-21         Dick

Remove all vim 'hi link' definitions

vim 8.0's :h :hi-link indicates :hi link {from-group} NONE will remove a hi-link for one group. How can I remove all hi-link definitions? hi clear, syn clear, and syn off do not clear hi-links. Why would you need that? I don't see a use case for resetting all links; that's why it hasn't been implemented.Links are commonly used to customize syntax highlighting: Most filetypes (like python) in Vim come with a syntax that defines highlight groups (see them via :highlight). These particular groups (e.g. pythonFunction) are then linked to a set of default groups (:help highl...

 vim                     1 answers                     90 view
 2018-10-21         Mabel

Vim yanking range of lines

I'm a C# developer who has just recently decided to expand my knowledge of the tools available to me. The first tool I've decided to learn is Vi/Vim. Everything has been going well so far, but there are a couple of questions I can't seem to find the answer to:Lets say I wanted to yank a range of lines. I know there are many ways of doing so, but I would like to do it by line number. I figured it would be similar to how the substitute commands work, something like 81,91y. Is there a way to do this?I'm a little confused about the g command in normal mode. It seems to do...

 vim                     7 answers                     101 view
 2018-10-21         Abigail

What is logical AND in Sed/Vim?

I would like to get an AND -operator to the following Vim command:command! -nargs=1 GrepSource :! grep <args> `sed -n 's/^source \(.*\)/\1/p' %`such that I can use the command to find sources at# source <path># . <path> source <path>. <path>I am not sure whether it is possible or not to get AND -operator to SED or Vim.How can you add an AND -operator to the SED command? You can just use Vim regular expressions to find the <path> name, instead of using sed::command! -nargs=1 GrepSource :exe printf("!grep '<args>' '%s'", matchstr(g...

 vim                     2 answers                     21 view
 2018-10-21         Norma

How to add find-previous in xdvi or findPrevious in xpdf for vi keybindings?

Is there a way to add a find-previous function in xdvi or a findPrevious function in xpdf? Those would be equivalent to a function that brings up the search dialog with the "Search backwards" option already checked.I need such functions in order to define keybindingsbind ? any findPreviousin my .xpdfrc andxdvi.mainTranslations: #override\ <Key>?:find-previous()in my .Xdefaults. I'd then have a complete set of vi-like keybindings in both programs. You may have to change the code of xpdf. I read the source code of xpdf once, it provide...

 vim                     1 answers                     51 view
 2018-10-21         Violet

VIM hjkl navigation keys, aganist existing muscle memory of arrow keys

I recently migrated to Vim.But I am having diffuculty making use of "hjkl" keys for navigating because of my existing muscle memory of arrow keys.1. Is there a way to effectively use other keys like "ijkl" ( near to Arrow key layout ) without causing much conflict to other functionality in VIM , For ex: http://vim.wikia.com/wiki/Use_ijkl_to_move_the_cursor_and_h_to_insert and http://ergoemacs.org/misc/on_vi_keybinding.html2. Is it worth the efforts to retrain the muscle memory with "hjkl" ? But the problem is, I have to use arrow keys again with Web-...

 vim                     2 answers                     60 view
 2018-10-21         Patricia

Vi Showing Extra Characters ( *>> ) where spaces should be

I've been using vim from the past few months and am trying to make it my go-to text editor for all text files.I recently downloaded the most recent version of WordPress and noticed that all the files display a character sequence( »·»·»·»·) where a space is expected.How can I change this to show spaces instead? It's highlighting tab characters, not spaces. Turn it off with :set nolist. You can also see what hidden characters are configured to show with :set listchars? [XXX]

 vim                     1 answers                     35 view
 2018-10-21         Miranda

VIM and Scala -- indentation problems?

I downloaded Scala 2.8, installed the vim scripts included and tried to type in some Scala code. When I typed in val x = 1 + 2 and hit ENTER, the indentation goes to below the v. When I type in val x = (1 + 2), the indentation is below the x! If VIM is used by anyone at all for Scala, this bug should've been seen long ago. Or am I the only one seeing this? With the indent/scala.vim from the current 2.8.0.final release I have the same outcome... But I know, that it worked in a earlier release, because I have one file here where it works. Here it is:" Vim indent file" Lang...

 vim                     1 answers                     3 view
 2018-10-22         Charlotte

VimWiki - creating markdown files compatible with VimTex - a setup for math notes

OkI've read this thread: https://github.com/vimwiki/vimwiki/issues/69They're talking about the possibility to convert VimWiki files to LaTeX. This is close to what i'm trying to create in the world of note-taking setups.What i want is a feature where you have VimWiki as your main index of your note for a class (let's say math), and then can tab in/tab out and create new files where VimTex runs* using VimWikis FollowLink function.* My VimTex runs in markdown filesAn example of a math_index.md for understanding:# MATH NOTES - [[Link to this subject]] - description - [[Link to...

 vim                     1 answers                     45 view
 2018-10-22         Paula

VIM substitution: Using the current line as the search string

Assuming the following text file, which is actually a data dump of funds and price statistics:PBCPDF05/01/2006 0.0000 0.0000PBCPDF 0.000006/01/2006 0.0000 0.0000PBCPDF 0.0082[… lines repeat …]What I wanted to achieve is to delete all instances of PBCPDF except for the first one, which I could write the substitution command as :.+1,$s/PBCPDF\n//g.However, since I wanted to program a macro to process multiple fund names, I need a means to use some sort of pattern that would retrieve the current line as the search pattern without me doing it by hand.Is there a way to do that? ...

 vim                     3 answers                     80 view
 2018-10-22         Sibyl

Get live word count for document in vim

I would like vim to display the total document word count in the status bar (where the current line and character number are displayed). I have come across similar questions on SO, and have tried all the suggestions mentioned here and here --- and none of them had any effect whatsoever on my status bar.To explicitly name a few, I tried to paste any of the following in my ~/.vimrc (and ofc subsequently restarted vim):function! CountNonEmpty() let l = 1 let char_count = 0 while l <= line("$") if len(substitute(getline(l), '\s', '', 'g')) > 3 ...

 vim                     1 answers                     99 view
 2018-10-22         Blake

VIM Project and Tabs

Is there a possibility to combine the Project Plugin with Tabs?If i open a file in my Project Explorer, i want to open it in a new tab ... :) You have to hack this plugin yourself (I do not think it would be difficult) or email the author and kindly ask him to do it.I would also suggest NERDTree as a Project replacement (it can open files in tabs). [XXX]For open file of project in other tab useLeader T\T [XXX]I was having the same issue. For now I'vee learned to use buffers.To expand on the buffers post above, when you open a new file the Project plugin hides the ...

 vim                     6 answers                     59 view
 2018-10-22         Baldwin

Cursor disappears in vim when switching windows between vertical and horizontal split

I've been switching some windows in VIM from vertical to horizontal splits and back using:CTRL-W + KCTRL-W + LCTRL-W + JCTRL-W + HAfter doing this a few times the cursor disappeared. I can still type, and the status bar at the bottom still shows me my location, but there's no blinking cursor. Any ideas regarding:Why does this happen?How do I get the cursor back?I'm using vim 7.2 on Linux I have the same problem and I have used couple of work-arounds that work for me:Maximize gvim window and then click on the maximize button again to bring it to original size. This brin...

 vim                     11 answers                     88 view
 2018-10-22         Ralap

How to bind key to unexposed plugin function?

I am using Commentary. It defines the following keybindings:command! -range -bar Commentary call s:go(<line1>,<line2>)xnoremap <expr> <Plug>Commentary <SID>go()nnoremap <expr> <Plug>Commentary <SID>go()nnoremap <expr> <Plug>CommentaryLine <SID>go() . '_'onoremap <silent> <Plug>Commentary :<C-U>call <SID>textobject(get(v:, 'operator', '') ==# 'c')<CR>nnoremap <silent> <Plug>ChangeCommentary c:<C-U>call <SID>textobject(1)<CR>nmap &...

 vim                     1 answers                     103 view
 2018-10-22         Julian

How to invoke :CtrlSF search key in vim

I wondered is there the correct way to enter search in vim using CtrlSF vim plug-inI tried click Ctrl+S+F or Ctrl+Shift+F nothing work.I have to really copy paste CtrlSF to vim: Thanks @L3viathan let me know that need todo the mapping.I found Getting Started With Using Vimand Show current key setting?are good to start.Here what I did.Add these code in ~/.vimrclet mapleader=","nnoremap <leader>W :CtrlSFThat's it.In Vim normal mode type:,WIt will type::CtrlSFThen it work as :CtrlSF suppose to do [XXX]

 vim                     1 answers                     27 view

Page 1 of 51  |  Show More Pages:  Top Prev Next Last