Saturday, July 4, 2020

Re: [Hint] quickfix list in vim for follow up errors

On 2020-07-04, Kunal Chauhan wrote:
> Hi Team.
>
> I am using the :make all from vim in my source code.
> as the code has multiple warning and some error.
>
>  Point is: if i do the clist it shows multiple lines of code with warning , but
> I want to follow up the error part only , with out scrolling so much in clist .
> Is there will some nicer way of finding the error part easily of compilation
> via quickfixlist in large code base ?

I usually use the cfilter plugin for this. It comes with Vim, so
you just need to enable it by putting

packadd cfilter

in your vimrc. See

:help cfilter-plugin

Then you can filter your quickfix list to contain only errors with

:Cfilter error

or remove all warnings with

:Cfilter! warning

Those commands create new quickfix lists without affecting the
original list, you can return to the original list with

:colder

HTH,
Gary

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200704152814.GA24359%40phoenix.

Re: [Hint] quickfix list in vim for follow up errors

On Sat, Jul 4, 2020 at 11:02 AM Kunal Chauhan <atkunalchauhan@gmail.com> wrote:
>
> Hi Team.
>
> I am using the :make all from vim in my source code.
> as the code has multiple warning and some error.
>
> Point is: if i do the clist it shows multiple lines of code with warning , but I want to follow up the error part only , with out scrolling so much in clist .
> Is there will some nicer way of finding the error part easily of compilation via quickfixlist in large code base ?
>
>
>
> Thanks
> kunal

The :cn[ext] (go to next error) and :cN[ext] (go to previous error)
allow you to go to the next point in the source where the compiler
complained, evn if the quickfix list itself isn't displayed. Similarly
:cnf[ile] and :cNf[ile] (next and previous file), and :crew[ind] (go
to first error) and :clast (go to last error). If you don't mind
taking up three keys with and without Shift, you can even assign them
to keys, for example as follows:

:map <F2> :cn<CR>
:map <S-F2> :cN<CR>
:map <F3> :cnf<CR>
:map <S-F3> :cNf<CR>
:map <F4> :crew<CR>
:map <S-F4> :clast<CR>

The same mappings apply of curse in any quickfix list, i.e not only as
generated by :make but also by :helpgrep and :vimgrep

Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXu3BXXRPDk0nnncKCo-HaG7CeuhS4mm2ZX%2BZymyTQ-DCQ%40mail.gmail.com.

[Hint] quickfix list in vim for follow up errors

Hi Team.

I am using the :make all from vim in my source code.
as the code has multiple warning and some error.

 Point is: if i do the clist it shows multiple lines of code with warning , but I want to follow up the error part only , with out scrolling so much in clist .
Is there will some nicer way of finding the error part easily of compilation via quickfixlist in large code base ?



Thanks
kunal

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CACEFAc0tCfo4J-9WF3oWt8%3DQrhkHWCztfLe_FOyAWNOam6g7yg%40mail.gmail.com.

Thursday, July 2, 2020

Re: Date in a boilerplate file



On Tuesday, June 23, 2020 at 11:56:34 AM UTC-5, Guido Milanese wrote:
In a project I am developing, I have written some boilerplate files to be used as headers for Markdown/LaTeX documents. One of the lines contains the document date, and ideally it should be:

date: <TODAY>

I know how to insert date from command line, but is it possible to embed the command in the boilerplate file and have it transformed into the real date? I tried autocmd to no success -- clearly I have not really understood how to use it!
The same applies to other fields (such as AUTHOR), but the DATE field is the most important one.
Thank you!
guido (Northern Italy)



You have some good suggestions already that use hard-coded substitute commands in the autocmd. A more versatile method would be to embed the expressions you want evaluated right in your template file: https://vim.fandom.com/wiki/Use_eval_to_create_dynamic_templates

Of course there are also a wide variety of template plugins that might be a good fit for you, too.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/e14f3cb1-e4a4-4488-9879-ca2b377b005eo%40googlegroups.com.

Wednesday, July 1, 2020

Re: An interesting little poser

On Sun, Jun 28, 2020 at 05:37:04PM EDT, Mateusz Okulus wrote:
> I've made the following macro that works for the given example, assuming
> 1 line of footnote.
>
> Run the following (copy and paste)
>
> :map <F2> G?\[\d\+\]<CR>va[y/<C-r>0<CR>dd0DnF[hr^llPdt]
>
> Press F2 to run this macro. You can also hold the key
> and will get a message when it's done.
>
> Explanation:
> G - to to the bottom of the file
> ? - start reverse search (search will look up)
> \[\d\+\] - regex - nonzero digits inside square brackets
> <CR> - enter to finish entering regex
> va[ - select square brackets and digits inside
> y - yank them
> / - search (this one will wrap)
> <C-r>0 - insert content of register 0, which holds last yank
> allowing us to search for the [digits] pattern
> <CR> - enter to finish entering search
> dd - delete line with [digits]; we are now on footnote line
> 0 - go to the beginning of the line
> D - delete to the end of line, without newline, so when we paste it
> won't be with newline
> n - go to the the place where the footnote is referenced
> F[ - search backward for [
> h - 1 left
> r^ - replace space with ^
> I've noticed the space is removed in example.
> ll - go to the first digit, skipping ^[
> P - paste footnote before the digits
> dt] - delete the digits, without ]

Above pseudo-code translated to a function wrapped in a while loop.

function! Footnotes2()
:normal G
:while search('^\[\d\+\]$', 'bc')
:normal va]
:normal y
:let b:p='\'.@0
:execute "call search(b:p)"
:execute "call search(b:p)"
:normal dd
:normal 0
:normal D
:execute "call search(b:p)"
:normal h
:normal r^
:normal ll
:normal P
:normal l
:normal dt]
:normal G
:endwhile
endfunc

I prefer a function for flexibility: I can easily add pre-processing
& post-processing code - e.g. to reflow multi-line footnotes... remove
the NULL lines at EOF... etc.

Thanks,

CJ

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200701210350.GE4819%40turki.local.

Re: Vim easter egg in command line completion

Am 28.06.2020 um 16:48 schrieb Yegappan Lakshmanan:
> Hi,
>
> Try pressing Tab after entering the following (you need a space after Ni):
>
> :hi Ni
>
> I haven't noticed this easter egg mentioned before.
>
> - Yegappan

Nice find for the 20 year an-Ni!-versary of Vim 5.7
(version for PC compiled Jun 24 2000).

It works with Vim 5.7 O.o

--
Andy

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/5EFCBB16.9060608%40yahoo.de.

Re: [typing Russian characters in vim with vim-LaTeX]

Am 27.06.2020 um 16:59 schrieb Maxim Abalenkov:
> Dear all,
>
> I hope all is well with you. This is my first post to the vim mailing
> list. I use vim for a long time and would consider myself a power
> user. Occasionally, I need to type documents in Russian in LaTeX
> format. To use Russian in vim I follow the guidelines from this Habr
> post (https://habr.com/ru/post/98393/). In short I have the following
> settings in my .vimrc file:
>
> set keymap=russian-jcukenmac
> set iminsert=0
> set imsearch=0
> highlight lCursor guifg=NONE guibg=Cyan
>
> With these settings in place I can use "Ctrl+^" to switch between
> English and Russian languages in vim insert mode. For convenient
> typing of LaTeX commands in vim I use the Vim-LaTeX distribution
> (https://sourceforge.net/projects/vim-latex/). The configuration
> commands relevant to vim-LaTeX in my .vimrc are:
>
> " envoke LaTeX-Suite on TeX file open
> filetype plugin on
>
> " load filetype-specific indent files
> filetype indent on
>
> " load vim-latex for empty TeX files
> let g:tex_flavor='latex'
>
> All is nice and well and I'm satisfied with this setup. However, there
> is one small problem that makes my life miserable. One of the Russian
> letters, the small letter «ю», is not typed correctly. When I press
> the relevant key on the keyboard I get a full stop symbol «.» instead
> of the small letter «ю». On the other hand, the capital letter «Ю»
> (when pressing the Shift key) is produced correctly. Would you please
> be so kind to help me debug the problem? Maybe I have some option
> clashes with the vim-LaTeX? Thank you and have a good day ahead!
>
> —
> Best wishes,
> Maxim
>
> Maxim Abalenkov \\ maxim.abalenkov@gmail.com <mailto:maxim.abalenkov@gmail.com>
> +44 7 486 486 505 \\ http://mabalenk.gitlab.io

This assumes vim-latex-1.10 ...


The keymap's (buffer-local) language mapping for `.' is overruled by a
buffer-local Insert mode mapping.


To show the problem: in a LaTeX (ft=tex) buffer:
:imap <buffer> .
(or just)
:imap .
shows something like (depending on g:Tex_SmartKeyDot)
<C-R>=<SNR>20_SmartDots()<CR>
or <C-R>=<SNR>12_LookupCharacter(".")<CR>


You can remove the Insert mode mapping after it gets defined:

Create a file
after/ftplugin/tex.vim
containing the line

iunmap <buffer> .

for example the file ~/.vim/after/ftplugin/tex.vim where
~/.vim/after must occur in the 'runtimepath'.

--------------------------------------------------------------
You can ignore what follows.

An alternative is to

put in the vimrc:
:let g:Tex_SmartKeyDot = 0

and to put in the after/ftplugin/tex.vim file:

" :echo IMAP_list_all('.')
" tex: "`. => "`.
" tex: \`. => \`.
" tex: ``. => ``.
" tex: `. => \cdot

if exists('*IUNMAP') && maparg('.', 'i') =~# '<SNR>\d\+_LookupCharacter("\.")'
call IUNMAP('"`.', 'tex')
call IUNMAP('\`.', 'tex')
call IUNMAP('``.', 'tex')
call IUNMAP('`.', 'tex')
endif


Would have been cleaner if there was an IUNMAP_ALL('.', 'tex') function ...

And not sure about the exact consequences ... the mapping for `.' is
created per buffer, but IMAP() creates internal data structures per
filetype.

--
Andy

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/5EFCBA7C.9060602%40yahoo.de.