learnbyexample

joined 2 years ago
 

Hello!

I am pleased to announce a new version of my Vim Reference Guide ebook.

This is intended as a concise learning resource for beginner to intermediate level Vim users. It has more in common with cheatsheets than a typical text book. Topics like Regular Expressions and Macros have more detailed explanations and examples due to their complexity. I hope this guide would make it much easier for you to discover Vim features and learning resources.

Links:

Did you know that Vim has an easy mode, which is actually very hard to use for those already familiar with Vim? See my blog post for more details!

I would highly appreciate it if you'd let me know how you felt about this book. It could be anything from a simple thank you, pointing out a typo, mistakes in code snippets, which aspects of the book worked for you (or didn't!) and so on. Reader feedback is essential and especially so for self-published authors.

Happy learning :)

 

I rarely ever use the date command, but when I need it I almost always struggle to get the right incantation. So, wrote a blog post for easy reference.

Do you use a cheatsheet as well?

[โ€“] learnbyexample@programming.dev 7 points 2 years ago* (last edited 2 years ago) (2 children)
alias a='alias'

a c='clear'
a p='pwd'
a e='exit'
a q='exit'

a h='history | tail -n20'
# turn off history, use 'set -o history' to turn it on again
a so='set +o history'

a b1='cd ../'
a b2='cd ../../'
a b3='cd ../../../'
a b4='cd ../../../../'
a b5='cd ../../../../../'

a ls='ls --color=auto'
a l='ls -ltrhG'
a la='l -A'
a vi='gvim'
a grep='grep --color=auto'

# open and source aliases
a oa='vi ~/.bash_aliases'
a sa='source ~/.bash_aliases'

# sort file/directory sizes in current directory in human readable format
a s='du -sh -- * | sort -h'

# save last command from history to a file
# tip, add a comment to end of command before saving, ex: ls --color=auto # colored ls output
a sl='fc -ln -1 | sed "s/^\s*//" >> ~/.saved_commands.txt'
# short-cut to grep that file
a slg='< ~/.saved_commands.txt grep'

# change ascii alphabets to unicode bold characters
a ascii2bold="perl -Mopen=locale -Mutf8 -pe 'tr/a-zA-Z/๐—ฎ-๐˜‡๐—”-๐—ญ/'"

### functions
# 'command help' for command name and single option - ex: ch ls -A
# see https://github.com/learnbyexample/command_help for a better script version
ch() { whatis $1; man $1 | sed -n "/^\s*$2/,/^$/p" ; }

# add path to filename(s)
# usage: ap file1 file2 etc
ap() { for f in "$@"; do echo "$PWD/$f"; done; }

# simple case-insensitive file search based on name
# usage: fs name
# remove '-type f' if you want to match directories as well
fs() { find -type f -iname '*'"$1"'*' ; }

# open files with default application, don't print output/error messages
# useful for opening docs, pdfs, images, etc from command line
o() { xdg-open "$@" &> /dev/null ; }

# if unix2dos and dos2unix commands aren't available by default
unix2dos() { sed -i 's/$/\r/' "$@" ; }
dos2unix() { sed -i 's/\r$//' "$@" ; }

I recently wrote a few interactive TUI apps to help practice grep, sed, awk and other CLI tools: https://github.com/learnbyexample/TUI-apps

[โ€“] learnbyexample@programming.dev 7 points 2 years ago (2 children)

EPUB reader

[โ€“] learnbyexample@programming.dev 5 points 2 years ago* (last edited 2 years ago) (1 children)

Check out https://github.com/auctors/free-lunch (list of free Windows software)

See also https://www.nirsoft.net/ (freeware, not open source)

Cradle by Will Wight is a page-turner. 12 book completed series and audio is great based on gushing reviews I've come across.

GVim.

Check out https://ghostwriter.kde.org/ if you are looking for a GUI app with live preview, full screen mode, etc.

If he likes games, check out "Invent Your Own Computer Games with Python": https://inventwithpython.com/invent4thed/

[โ€“] learnbyexample@programming.dev 4 points 2 years ago (2 children)

If you are looking for books, check out:

Intermediate:

  • Beyond the Basic Stuff with Python โ€” Best Practices, Tools, and Techniques, OOP, Practice Projects
  • Pydon'ts โ€” Write elegant Python code, make the best use of the core Python features
  • Python Distilled โ€” this pragmatic guide provides a concise narrative related to fundamental programming topics such as data abstraction, control flow, program structure, functions, objects, and modules

Advanced:

  • Fluent Python โ€” takes you through Pythonโ€™s core language features and libraries, and shows you how to make your code shorter, faster, and more readable at the same time
  • Serious Python โ€” deployment, scalability, testing, and more
  • Practices of the Python Pro โ€” learn to design professional-level, clean, easily maintainable software at scale, includes examples for software development best practices
  • Intuitive Python โ€” productive development for projects that last

I have a book for Perl One-Liners as well, which I'm currently revising :)

I've written books on regex too, if you are interested in learning ;)

[โ€“] learnbyexample@programming.dev 3 points 2 years ago (1 children)

Thanks a lot for the feedback on Coreutils book! It's so nice to hear that it helped in your thesis.

Regarding the ebook versions, I use pandoc to convert GitHub style Markdown to PDF/EPUB (wrote a blog post about my process here: https://learnbyexample.github.io/customizing-pandoc/). I had to search through stackexchange threads to customize the few things I could. I don't know how to fix the kind of page breaks you mentioned. But, I'll try to find a solution. Thanks again for the feedback :)

view more: โ€น prev next โ€บ