Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 LINUX/UNIX


  Vim anti-patterns

The benefits of getting to grips with Vim are immense in terms of editing speed and maintaining your “flow” when you’re on a roll, whether writing code, poetry, or prose, but because the learning curve is so steep for a text editor, it’s very easy to retain habits from your time learning the editor that stick with you well into mastery. Because Vim makes you so fast and fluent, it’s especially hard to root these out because you might not even notice them, but it’s worth it. Here I’ll list some of the more common ones.Moving one line at a timeIf ...

3,128 0       VIM MACRO SYNTAX ANTI-PATTERN


  Using vi key bindings in bash and zsh

Takeaway: If you prefer to use vi or vim for command-line editing, you can configure shells to use vi key bindings instead of emacs-style key bindings. Here’s how. By default, most shells use emacs-style key bindings for command-line editing and modification. For users of vi or vim, however, you can instead configure shells to use vi key bindings instead. This is done by editing ~/.bashrc in the case of bash, or ~/.zshrc in zsh and adding:set -o viin bash, and the following for zsh:bindkey -vOnce you have saved either ~/.bashrc or ~/.zs...

6,473 0       LINUX BASH VI ZSH KEY BINDING


  SSH Security and You - /bin/false is *not* security

Backstory While at RIT around 2004 or 2005, I discovered that a few important machines at the datacenter allowed all students, faculty, and staff to authenticate against them via ssh. Everyone's shells appear to be set to /bin/false (or some derivative) on said machines, so the only thing you'll see after you authenticate is the login banner and your connection will close. I thought to myself, "Fine, no shell for me. I wonder if port forwarding works?" Seems reasonable, right? Whatever sysadmin was tasked with securing these machines forgot some...

12,801 0       SECURITY LINUX SSH /BIN/FALSE


  Why, oh WHY, do those #?@! nutheads use vi?

Yes, even if you can't believe it, there are a lot fans of the 30-years-old vi editor (or its more recent, just-15-years-old, best clone & great improvement, vim). No, they are not dinosaurs who don't want to catch up with the times - the community of vi users just keeps growing: myself, I only got started 2 years ago (after over 10 years of being a professional programmer). Friends of mine are converting today. Heck, most vi users were not even born when vi was written! Yes, there are definite reasons why the vi/vim editing model is just superi...

2,544 0       LINUX ADVANTAGE HISTORY VIM VI


  Useful Bash Scripts

Many people hack together shell scripts quickly to do simple tasks, but these soon take on a life of their own. Unfortunately shell scripts are full of subtle effects which result in scripts failing in unusual ways. It's possible to write scripts which minimise these problems. In this article, I explain several techniques for writing robust bash scripts. Use set -u How often have you written a script that broke because a variable wasn't set? I know I have, many ti...

8,653 0       LINUX COMMAND SHELL BASH ROBUST


  Why I Use Vim

I've been using MacVIM as my editor of choice for a couple of years now, yetin many ways I still feel like a beginner. Every day I am learningmore and more about my editor, but it takes a conscious effort to become proficient withan editor like Vim. Here's why I make that effort.Editors are something that are very personal; they have to fit with your ownwork flow approach to programming. If you have ever stopped to think about it,the way each person goes about editing text is quite different. I frequentlypair program with colleagues and I find it amazing, and sometimes frustrating,to see how o...

3,448 0       FEATURE VIM EDITOR


  What are some lesser known but useful Unix commands?

A few that come to mind, some less known, some more:xargs or parallel: run things in parallel, with lots of optionssed and awk: more well-known but still super useful for processing text files, and faster than Python or Rubym4: simple macro processorscreen: powerful terminal multiplexing and session persistenceyes: print a string a lotcal: nice calendarenv: run a command (useful in scripts)look: find English words (or lines in a file) beginning with a stringcut and paste and join: data manipulationfmt: format text paragraphspr: format text into pages/columnsfold: wrap lines of textcolumn: form...

8,494 0       LINUX COMMAND UNIX LESS USED


  Vim: revisited

I’ve had an off/on relationship with Vim for the past many years.Before, I never felt like we understood each other properly. Vim isalmost useless without plugins and some essential settings in .vimrc, but fiddling with all the knobs andinstalling all the plugins that I thought I needed was a process that inthe end stretched out from few hours to weeks, months even; and it theend it just caused frustration instead of making me a happier coder.Recently, I decided to give Vim another shot. This time around it wasdifferent – something in my brain switched and now for the first ti...

2,710 0       LINUX SETUP VIM EDITOR QUICK GUIDELINE