How to edit efficiently

inspired by https://www.youtube.com/watch?v=5fBkVjNryVQ Sharpen the saw You have to keep on tuning the set of commands you use for your needs. Use Feedback: Learn from what you do. Don’t try to learn everything, just the things you need. Summary Step1: Detect inefficiency Find out what you waste time on Step2: Find a quicker way read the on-line help read the quick refeference, bookts, etc. ask friends and colleagues search the internet do it youself Step3: Make it a habit ...

August 20, 2023 · 1 min · ChaosNyaruko

Bulk rename files with Vim

Unix Shell Create list of files \ls | vim - The backslash tells your shell to disregard any aliases for ls; we need plain output with no color. Vim will open, displaying a list of file names. Change to list of shell commands In Vim you now have one file name per line. We need to change each line to be a valid stand-alone shell command. For example, to rename the files to lowercase: ...

August 19, 2023 · 2 min · ChaosNyaruko

Vim or Neovim in 2023?

Prologue Vim is one of the most famous based text editors(somehow infamous for serveral reasons). Neovim is a really weel-known fork of Vim, which even has its own community. So which one should I choose? It depends on your workflow and usage scenarios. I will introduce the pros and cons of both from my point view. Hope it will help you with the selection. Neovim vs Vim Neovim Pros/Vim Cons: Neovim has better default settings, which means you don’t need to “set nocompatible”/“set backspace”/…, see “:h nvim-default” for details in Neovim. Neovim has a more open and active community. (Check the “job control” story if you are interested). However, it depends on your attitude towards open source practice. Neovim has built-in LSP/treesitter support. Neovim makes Meta key available by default. Neovim uses Lua as first-class configure language, with high performance Lua-JIT as its engine. Lua is more like a programming language. Basicly all plugins written for Vim is available for Neovim, because Vimscript is still supported. The Vimscript engine is reserved. There are still some others advantages, which I personally don’t so much care, see offical website for details. ...

August 1, 2023 · 2 min · ChaosNyaruko

How to learn (neo)/vim?

Prelude This article is for those who decide to use vim/neovim or the key bindings. If you want to figure out whether you should learn it, you can refer to my previous article. The followin’ suggestions are given in my experience, may or may not fit you. Just take them as a reference. Hope it helps. Learn Vim Step by Step Learning the key bindings first. You don’t have to know everything, just follow “vimtutor”, know the basic usage of vim’s “modal”/“operator”/“motion”/“text object”/“regex”/… stuff. You don’t have to remember all the details at once, everyone improves the retention by daily usage and training. Once you know the basic key bindings, you can use “vim” in most of your IDEs/editors/… . Download the vim plugin and you can get familiar with vim’s way to operate text. The only point is “sticking to it”, even it will slow you down at the beginning. Now it’s time to know vim’s wonderful features and plugins. There are indeed some “distributions”, such as LunarVim or SpaceVim. However I personally don’t recommend you to use it directly. Two reasons for this: There are often other “layer"s in these distributions. You will have to learn the design as well, otherwise you will struggle to cope with problems. You will lose the happiness about the process of assembling your own PDE, and nobody knows your habit more than yourself. But I strongly recommend you to take them as your references, such as some config snippets or awesome plugins. They are really good resources for you to build your own PDE from scratch. Write your own plugins, contribute it to the community! Epilogue Enjoy yourself in doing “useless” things!

May 8, 2023 · 2 min · ChaosNyaruko

tmux cheatsheat

Personal Advice Modify your .tmux.conf file. set -g mouse on change your prefix Example conf: set -g mouse on # remap prefix from 'C-b' to 'C-a' unbind C-b set-option -g prefix C-a bind-key C-a send-prefix Create Windows prefix + c: [c]reate a window Navigation prefix + n: go to [n]ext window prefix + p: go to [p]revious window ...

May 3, 2023 · 2 min · ChaosNyaruko