Have you ever had the nead to count the lines of code in a project or a folder? If you did, or want to, cloc is a neat utility that can help with just that.
As per it’s description on the GitHub page, «cloc counts blank lines, comment lines, and physical lines of source code in many programming languages». It displays a summary of file types and counted files, and then it breaks down a list of lines of code per language.
cloc is available on many distros default repo, as well as npm install. To install it use:
sudo apt install cloc # Debian, Ubuntu
sudo yum install cloc # Red Hat, Fedora
sudo dnf install cloc # Fedora 22 or later
sudo pacman -S cloc # Arch
sudo emerge -av dev-util/cloc # Gentoo https://packages.gentoo.org/packages/dev-util/cloc
sudo apk add cloc # Alpine Linux
sudo pkg install cloc # FreeBSD
sudo port install cloc # Mac OS X with MacPorts
brew install cloc # Mac OS X with Homebrew
choco install cloc # Windows with Chocolatey
scoop install cloc # Windows with Scoop
c. Add a plugin to the plugin section. If you don’t know what to add you can start with vim-illuminate, which highlights multiple instances of the same word that is under the cursor.
"Vim plugin for selectively illuminating other uses of the current word under the cursor
" Initialize plugin system
d. Now open a file with vim, or if you already have a file open, source your vimrc with :source ~/.vimrc
e. Now that we have the plugin section and a plugin defined, call vim-plug to install your plugin with :PlugInstall
And that’s it! You are ready to start using your new plugin.
Whenever you want to install a plugin, repeat steps «c» through «e».
Latte is a great «newish» dock for KDE that can be used as launching/task dock, or even completely replace your plasma panels. The dock is fast stable with a good «feel», and it fully supports plasma widgets.
I myself do not like the Apple like task docks. I prefer using docks for app launching and let my panels do the task management. I was looking for a fast dock for my Arch VM at work, and Latte was one of the best options. The only thing missing was how to remove the task manager option. But luckily I ended up finding a way on my own (which feels more of a bug, but I won’t get into it), and I’m sharing the instructions here.
a. Install latte-dock
$ pacman -Syu latte-dock
b. Start the dock (from the terminal or with Alt+F2)
c. Right click on the dock and click on «Add/Widgets». Add a widget (like the «Audio Volume» widget)
d. Right click on the dock again and click on «Dock/Panel Settings»
e. Remove the «Latte Widget»
F. Now try to drag an application icon (like from /usr/share/applications) to the dock. If that does not work, try opening and closing the «Dock/Panel Settings». It will eventually let you add the application icon (hence why I said it seems like a bug). Once the first application shortcut has been added you can drag more.
Here’s a quick way to get quick simplified explanation and usage for commands in Bash with TLDR Pages.
$ tldr tldr
Simplified man pages.
- Get typical usages of a command (hint: this is how you got here!):
TLDR pages is community driven and holds common commands for UNIX, Linux, macOS, SunOS and Windows. The amount of commands available is already pretty vast, and users are encouraged to contribute with new pages on their git repo - https://github.com/tldr-pages/tldr.