Git Product home page Git Product logo

damian-conway-s-vim-setup's Introduction

Damian Conway's .vimrc and associated files

Totally unsupported.

______________________________________________________________________________

Copyright (c) 2011-2016, Damian Conway. All rights reserved.

This is free software. It may be used, redistributed
and/or modified under the terms of the Perl Artistic License
(see http://www.perl.com/perl/misc/Artistic.html)


DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

damian-conway-s-vim-setup's People

Contributors

preaction avatar thoughtstream avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

damian-conway-s-vim-setup's Issues

vmath echon output not visible

Hi

I tried your vmath.vim plugin which looks like a great idea.
However the output is not visible for any reason with vim 7.3 on Linux.
I only see the output "-- VISUAL LINE --" at th bottom.
I added "echom" for testing to VMATH_Analyse() and then suddenly I see both, your output and my test output.
Any ideas?

PS: I also tried with a clean vim config to exclude any side effects.

regards,
Gerhard

Error in all perl files.

Not fully sure what happened. I have been using trackperlvars.vim for a couple years now without problem. Yesterday I did a system update, I am guessing it updated vim (I was not paying attention). Now every time I open a perl file or try to move my cursor I get this:

Error detected while processing CursorMoved Autocommands for "<buffer=1>"..function TPV_track_perl_var[137]..CursorMoved Autocommands for "<buffer=1>"..function TPV_track_perl_var: line 11: E803: ID not found: 664668

If I disable the plugin I do not get the error anymore.

I have tracked it to this line:

391 " Remove previous highlighting... 392 try | call matchdelete(s:match_id) | catch /./ | endtry

If I comment out line 392 I no longer get the error, but only the first thing I highlight ever gets highlighted (obviously) and it never goes away (also obvious).

I am very perplexed as I would expect the try/catch construct to catch such errors.... I know almost nothing about vim scripting though, so maybe there is something obvious I am missing.

Any chance these plugins could be organized into separate repos?

Hello,

I copied a couple of your plugins to my ~/.vim/plugin directory, thank you. But nowadays, it's much more common to install vim plugins using plugin managers (such as vundle and vim-plug) that download and install plugins from repos.

Again, it's not a big deal for someone to manually install one plugin one one machine, but using a plugin manager nowadays makes things super convenient by making plugin installation across several machines much easier. And then later updating them.

`gd` can think that a loop list is the definition

Given the program:

my ($self) = 1;

for my $x ($self->method) {
  say $x;
}

say $self;

If I move onto the $self in the last line and hit gd, it takes me to the ($self->method) instead of the my ($self)

only works on .pm / .pl files

I was trying to work up a little bit of test code to demonstrate another issue and I found that the highlighting wouldn't work. I realized it started working if I renamed foo to foo.pm

It's because of:

  au CursorMoved *.pl,*.pm,*.t call TPV_track_perl_var()

One solution is probably to use the FileType event to set a buffer-local autocommand on each buffer as needed. I may try implementing this myself, but if not, at least there's a record of the issue? :)

locking tracked vars then switching buffers causes confusion

  1. edit a perl file
  2. highlight a var and lock highlighting in the file
  3. edit a new buffer, leaving the old one hidden
  4. return to the old buffer
  5. observe that while tracking seems locked, nothing is highlighted

I'd further note that there's a lot of "how much do you want to care?" here. I poked at making the g:track_perl_var_locked a b:track_perl_var_locked instead, but if you have the same file open in two windows right now (a split, for example), you get independent tracking. I think that tying the lock state to a b: variable would make this problematic. Is there even a way to scope the way that's needed without gymnastics? I think your use of s: for match state might also bite you here.

Anyway, as you have ably fixed everything else I noticed, I will put my faith in your judgement and skill. :-)

Add an option to equalignsimple to allow chosing the alignment character

I use equalignsimple everyday to great success. My code is much more readable and better organized. For 99% of the cases that I use it for, aligning on = is perfect.

The only use case I've seen that does not work for is CSS files. Is it possible to change the alignment character based on the filetype? Specifically in CSS files we should align on : instead of =

I looked at editting it myself, but that s:LINE_WITH_EQ regexp is a little beyond me.

highlighting escapes original buffer

Steps to reproduce:

  1. edit a Perl file, move cursor onto a variable (say, $self) so that it's lit up
  2. :ene to get a new buffer
  3. write a line or two, including $self
  4. observe that the new $self, in a file not matching *.pm and not ft=perl, is lit up

…and since the autocmd won't fire on a non-Perl file, you can't clear it without going back to a Perl file to edit!

Errors when loading the .vimrc on macOS

Hi, Dr. Conway!

I was just trying to go through your O'Reilly vim videos with your setup. When I use this repo as my .vim and .vimrc, there seems to be a few files it is expecting to find that aren't in the repo:

$ vim
Error detected while processing /Users/tfiala/.vimrc:
line  623:
E484: Can't open file /Users/tfiala/.vim/perlmodules
Error detected while processing function <SNR>20_recompile_spelling_files:
line    2:
E484: Can't open file /Users/damian/.vim/grammarian/errors/spell/en.latin1.add
line    5:
E484: Can't open file /Users/damian/.vim/grammarian/cautions/spell/en.latin1.add
Press ENTER or type command to continue

Is there any chance you might be able to add those? Is there any major harm if those aren't around? (I figure the missing Perl dir might significantly reduce functionality).

Thanks!

echomsg for non-punc vars is persistent

Perhaps this is intentional, but it seems odd.

Some change today has made it the case that when I move the cursor atop $self, I get an echomsg of [$self]: <none> -- as if it thinks it found a punc. var and doesn't know what it is.

If I move the cursor away, the message remains until I move to a new variable.

This is not the behavior on "real" punctuation variables, where the definition clears as soon as I move off.

Array Out of Bounds Error - yankmatch

This line appears to produce an array out of bounds error when a visual selection is made which does not start on the first line of a file.

call remove(inverted_line_nums, line_num-1)

The following code should resolve that:

call remove(lnverted_line_nums, line_num-start_line)

The plugin can also be made to respect a user's clipboard setting by replacing

let @" = yanked

with

    if !exists('g:YankMatches#ClipboardRegister')
        let l:clipboard_flags = split(&clipboard, ',')
        if index(l:clipboard_flags, 'unnamedplus') >= 0
            let g:YankMatches#ClipboardRegister='+'
        elseif index(l:clipboard_flags, 'unnamed') >= 0
            let g:YankMatches#ClipboardRegister='*'
        else
            let g:YankMatches#ClipboardRegister='"'
        endif
    endif
    let l:command = ':let @' . g:YankMatches#ClipboardRegister . ' = yanked'
    execute 'normal! ' . l:command . "\<cr>"

while also allowing the user to specify if they want a different register.

next match error when searching in split files

i have 2 files in split mode. the matching works well on the first file. when i switch over to the 2nd file and search next (n), i get the following error -

Error detected while processing function HLNext[2]..HLNextOff:
line    2:
E803: ID not found: 14
Press ENTER or type command to continue

Code::Refactor missing

from the perlrefactor.vim there is a systemcall with a Module called Code::Refactor which is curently not public available.Perhaps this can be added here? Or published at cpan?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.