sebastiandaschner news

monday, july 16, 2018

Hello from Munich and welcome to newsletter issue #29!

I’ve spent most of the last weeks with holding client workshops on the topics of microservices and cloud native technologies. Last week, I was on a “work vacation” in the beautiful and energetic city of Bangkok, Thailand. Tomorrow, I’ll fly once again to the island of Crete for the famous JCrete unconference! Already looking forward for philosophical sessions at that beautiful location.

I’ll also arrive a bit earlier on Crete to be able to have some relaxed days upfront. In my video course on developer productivity I was also talking about work environments and the positive impact quiet and peaceful places have on your efficiency. From my own experience, a good mix of productive time and leisure, especially in a beautiful location, produces higher-quality outcome.


What’s new


On Command Line Productivity

I spend most of my time typing, in either in IntelliJ or in the command line. For now, I use the command line for almost everything — I don’t even use a file explorer anymore. While this sounds very puristic and old school I’m actually convinced that this way I’m far more productive for the majority of tasks than using other GUIs or, god forbid, a mouse :-)

There are a few approaches that I found very helpful in order to facilitate the command line usage and to improve the user experience. I’ve tackled most of the in my video course on developer productivity. However, I specifically wanted to focus on what makes the life in the command line easier for us developers.

For that I’ve recorded a video solely on that topic, how to improve your command line productivity.

More specifically, there are some extensions for shell alias expansion, especially for zsh, that I believe makes the life with shell aliases easier. I explained the functionality and configuration in another blog post.

Just to mention, it doesn’t matter which specific technologies and command line tools you’re using; as an enterprise developer, I showed what I’m usually working with. However, with these resources I want to bring attention to a few generally-applicable principles, that when followed skyrocket your CLI productivity.

I hope you’ll find these resources helpful. If you have further command line productivity hacks that helped you, please respond to me and I’ll be happy to share them :-)


IntelliJ Hierarchical File Creation

A small but handy IntelliJ feature I’ve just learned about:

When creating new files you can not only provide the mandatory file name, but also type potential directories, in which the file should reside, that IntelliJ will create for you right away. Example: NewFile → Type folder/folder/file.yaml and IntelliJ will create two nested sub-directories folder containing a file file.yaml in the location where you’ve triggered the action. This also works with already existent directories.

The same idea works with creating Java classes. When creating a new class, you can directly provide (partly) package names, such as coffees.Order. Depending on which package you triggered the creation action, for example com.sebastian_daschner.coffee_shop, this will create the fully-qualified class com.sebastian_daschner.coffee_shop.coffees.Order.


IntelliJ IdeaVim extensions

I’m a heavy user of both Vim and the IdeaVim IntelliJ plugin.

There are a few clipboard key bindings that I want to use in both environments. I remapped my leader key to the space bar, which has to be configured slightly differently for IdeaVim. Last week, I was struggling with a correct configuration; that’s why I wanted to share my current setup, in case it’s helpful.

The copy-paste paste functionality in my ~/.ideavim file looks as follows:

let mapleader = " "

" system clipboard
vmap <leader>y "+y
vmap <leader>d "+d
nmap <leader>y "+yy
nmap <leader>p "+p
nmap <leader>P "+P
vmap <leader>p "+p
vmap <leader>P "+P

Notice the difference to the mapleader configuration, which in Vim is defined with \<Space>. This configuration enables to use the system clipboard in a more convenient way.

What else is even more powerful in IdeaVim is the ability to call IDE actions from the Vim emulation:

nmap <leader>h :action PreviousTab<CR>
nmap <leader>l :action NextTab<CR>
nmap <leader>bd :action CloseEditor<CR>

There is a Gist with the list of supported IDE actions that can be triggered with :action <action-name> from the command line bar or key bindings. With that you can reach your most frequent actions easier.


Thanks a lot for reading and see you next time!


Did you like the content? You can subscribe to the newsletter for free: