The user should have the neurons. The computer chips just need to network. Unfortunately as Facebook demonstrates, modern web is very good at reversing this.
You're the only person I've seen so far that actually takes advantage of tiling windows + terminal applications, everyone else seems to be wasting time with "I can customize it to do anything" but never get anything done, I don't want waste time customizing for no benefit. Sadly I don't see how I could impove my current workflow with this format, but it's really cool. PS: It would be real magic if we could get a stdout of a pdf.
I had no idea that vim could do this! All I ever knew about vim was how to quit it (after accidentally opening it and then spending a couple of minutes googling how to exit). Thanks :D
I use vim all the time but admittedly I've never put in the effort to become this much of a wizard with it. Next time I have a task like this (could be years) I'll pull this video back up again though!
1:31 pdfinfo (part of the poppler-utils package) will show info about PDF files such as titles. But these don’t always match the text you see on the title page of the document.
Thanks for sharing these vim tips! I'll share how I normally generate such files with a BASH loop:- for i in *.pdf; do echo -e "$(pdfinfo "$i"|sed -n '1s/^Title: *//p')" >>links.html;done This will write the HTML tags for each PDF found in the directory, and use the Title extracted with pdfinfo as the linked content. It might save a bit of time. Doing this stuff can be tedious.
Maybe I missed the part where he said it, but you can of course use r instead of read, and the space may be omitted if you use external commands. This might save time if you often do short external commands like these: :r!ls *pdf r!date etc
Cool, I just watched and read my first lessons on Vim earlier today, and I was going back and forth debating on if I should learn it or not...and this video showed me a good reason why I should bother going down that path.
On vs code you can type the same thing on multiple lines at a time. Just hold shift + alt and click and drag down and type. Im sure there is also a way to open the file and read the title but i havent had to do it yet.
I just started trying to get used to Vim a couple of weeks ago since everyone says that nano is nooby, hadn't really read any advanced tutorial either, just learned to navigate mostly. This stuff is amazing!
I use vim since maybe 10 years and I used this editor like a begginer all this time (I used only 2 modes, no buffers, and basic commands like w, q, y, p, b, w). Now I try to use it more like a poweruser because I want to be more productive when I write my thesis and I am surprised how this editor is powerful if you use it correctly. The "visual block" mode is magic. I never seen something like that from an other editor/program.
Nice example of mapping a key to bring up "mupdf" as an external command; but in split screen. BTW: You could wrap your file names in tags with just one ":vi" command line, rather than 2 steps: :g/pdf/s/\(.*\)// ( which translates to ) global-find all lines with "pdf" then substitute \( line-match \) with pre_text \1=insert-match end_text Note: REgex of ".*" matches whole line \( \) remembers it, and \1 shows where to re-insert string. "vi/vim" editor's :colon: command line has full "ex" editor commands for lots of bulk edit magic. Also: If you are more comfortable with "sed" you could use "!G" to pipe the whole file through cmd sed -e 's/^/
Really loved the vid Great job. I was able to do everything you did, in Emacs evil-mode, pretty much the same way you did. I had forgotten about :norm command. Again, GREAT JOB.
kate's block visual mode actually lets you go further than end of line so you can add prefix and suffix.opening the pdf's and the place holder trick was neat though
Could you upload that zipfile? those pfs seem to have interesting subjects! :D Thanks! I know I could just google them one by one but a) I still wouldn't have them all since only some files of that zip file are visible in your video b) it would be still boring to do search each pdf one by one and download it (going through all the waiting lists filesharing websites put you through etc :P )
I came to this video from a pinned post in r/vim that listed some resources to understand vim better. All I can say is I wish there were more videos like this showing how things are done in real world usage of the editor. (I have been using vim for almost 20 years.)
Do you think you could freeze vim while you were with the PDF opened, copied the title and, when closing the document, pasting the title inside de link tags, all with that command? Maybe it would make that easier.
Any timesaves would surely be lost from having to type in the paper names (or using vim magic tricks required to paste something from the system clipboard) would they not?
I'm newbie: I wonder what if you handle to open a 2 view with pdftotxt and move and yank manually the Title. I don't know, just to avoid typing. You still will need to see the original pdf view to know where is the title, but then you can search and yank.
7:55 Emacs has built-in online help, available from CTRL-H. For example, CTRL-H followed by A is “apropos”, where you can find relevant functions by keyword, CTRL-H C lets you get information about key bindings, etc.
I wrote a opengl loader with all the entry point declaration. They said to use a third party loader, that it would take forever. I was done in a hour. Thanks Vim.
Interesting. As an emacs user I do not know much about vim but I would have chosen a similar approach. I would have either renamed all the files first with a proper name , similar to what op did in the end with the article name and than wrote a macro in wdired mode to change everything automatically or I would have done it basically exactly like op. Open wdired mode with split screen, write macro that opens file in other screen, adds all necessary html code and put the courser at the correct position, so that I only have copy the name by hand. I like that in vim you just redirect bash-command output into the editors buffer. Pretty neat.
Cool technique but you should just use half of it to make a csv mapping from title to filename and just back your site with a server with templating logic and you can load the file paths from any destination and dynamically generate the links lol.. which would also allow a bit more dynamism in your site, pdf locations changing etc
Wow, this is even better and faster than recording a macro to repeat the process by pressing @@. Also, I liked to see mupdf behavior on it. I think I'm gonna stop using apvlv and zathura. Is mupdf able to invert colors?
could someone explain what is mapped for space + space or space + tab
9 месяцев назад
okay i would be interested to know how you could do it using php...shoul be doable as I have done something similar, where upon load it shows a list if websites (directories that have a index.html file) and show the name of the folder as the name of the link...so I am guessing that something like what u are doing could be done in a similar fashion
What file browser is that, which looks like the console but can preview pdfs for you?
4 года назад
Awk is perfect for this task. A one-liner like this should be all that's necessary: $ ls *pdf | awk '{ print "ADD TITLE" }' > list.html If your pdf files have proper metadata, you can use the tool pdfinfo to find out the title and modify the awk program above to automatically include it.
Woawww!!! You are really using the Computer. And not let the Computer using You. That is insane how powerful VIM is with a few little inocent commands ;)
With a bit of playing around I found the following will pull the title out of about 95% of pdf documents: pdftotext filename.pdf - | head -n 1 Would be fairly easy to get vim to paste that in the appropriate position. OK so you'd still need to go through and check for the odd few where it doesn't find the title properly but it would save a lot of work.
First time viewer of your channel. I was a linux (and other unices') sysadmin back in the day, and an infosec analyst back in the day. It's been a while since I've had linux on the desktop, though, the fruity company sucked me in with their wiles about a decade ago. Introductions aside, what window manager/shell is that? It looks amazing! All the efficiency of a CLI, and the ability to do very quick document previews. I gotta check that out.
Hey Luke. I really like your color scheme. Would you mind giving me (and the other commenters) the name or, in case it's a custom scheme, a file with the necessary values to replicate it? Great vid by the way. Appreciate it. Thanks in advance.
That was cool. If you said this in the video I'm sorry for missing it. Just wanted to say that some of the credit should go to i3 for presenting the PDF like that instead of opening a other window on that that you would have to alt+tab a couple of times.
Hi Luke : you could have saved minutes more :) - instead of :read !ls *pdf just !!ls *pdf (double exclamation; no colon) - instead of your + + and so, you could just :%s/\(.*\)/ A little explanation : - % means "the whole file" (= 1,$), - .* means "any character repeated", so the whole line - \(seq\) means that the "seq" is stored as substitutional parameter #1, - \1 means, insert the substitutional parameter #1. - and of course, don't forget to escape the slash in , or use a different separator for your substitution commande, like # for instance ":s#pattern#replace"
Hi, Below's one liner will runs xpdf or pdf viewer which will open pdf file. Select the title with mouse. Quit the pdf viewer and it will generate the html tag, and move to the next file.. The script needs the xsel package to b installed , and pdf files need to be in slectable text mode, not raster/image . $ ls *.pdf| while read f; do xpdf $f&> /dev/null; echo "`xsel | tr ' ' ' '`"; done > refs.html Enjoy. Update: If we encounter with image/raster pdf file, open xclipboard and type in the edit box. The content will be output by the xsel command in the script.
This is cool, but if you are going to create a website, chances are you're also going to be using a server-side language which you can use to loop through every file within a folder. Its a lot easier to read as well (your index.html source file will contain a few lines rather than 100s/1000s of lines) and also, what happens if you want to add 10 more pdfs? What would happen if now for every link or every second link you want a div with a specific class? Yes you can probably come up with a command for that, but it's in my opinion not the way to go, seeing as you would need to run that command again, rather than just have the server-side language load it all recursively. With like a total of 10 lines of code? (Source-code). If you are constrictrd to use only html, then sure, this can be handy.
to main problem was not adding html tags but naming the pdf correctly. I don't see how this can be done without human input if the file name and pdf info is incomplete