So you can have street cred.
Duh! Why else
?
(you don't really want to get your work done faster, do you?)
The text editor you can use anywhere.
Yes, built-into Mac is the vi
command/program.
So in your terminal you can run vi myfile.rs
and start editing immediately without downloading anything.
But way more importantly, vi
is available on most Linux/Unix
servers.
So if you are attempting to update a config file on a server without a GUI,
knowing how to use vi
/vim
is very useful.
Who still uses servers?
Aren't those like, "old school",
isn't everything "Serverless"
and "Edge Functions" now?
Yes, running on infrastructure you don't understand
with high vendor-lockin and latency
is always an <option>
...
But sooner or later you will need
to go lower-level and edit a config file.
Be it on a Raspberry Pi, Firewall
or
legacy Oracle System
that
you need to integrate with
because you're building a
FinTech / Healthcare / EdTech startup ...
Trust us, being proficient at Vi
/Vim
will pay off.
Most Linux
/Unix
Operating Systems
have vi
already included/installed by default.
But if yours does not,
then installation is usually pretty straightforward and quick.s
brew install macvim
see: https://www.vim.org/git.php (most Linux already have Vim, check your distro)
GOTO: https://www.vim.org/download.php
First:
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
Then add the following to your .vimrc
file:
set nocompatible " be iMproved, required by Vundle
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
:
" These are two plugins that will be installed/managed by Vundle:
Plugin 'slashmili/alchemist.vim'
Plugin 'scrooloose/nerdtree'
" All of Plugins must be added before the following line
call vundle#end() " required
Finally restart Vim and run the following command: :PluginInstall
When you edit a README.md
you should see something like this:
NERDTree is a directory/filesystem navigator. see: https://github.com/scrooloose/nerdtree
It's already installed above in the Vundle section.
If you want to map a keyboard shortcut, go with F6
as it's available.
Add the following line to your .vimrc
file:
nmap <F6> :NERDTreeToggle<CR> " Keyboard shortcut https://vi.stackexchange.com/a/9968
- Keyboard shortcut: https://vi.stackexchange.com/questions/9967/how-do-i-open-and-close-nerdtree-toggle-nerdtree-view-using-a-single-keystroke/9968
First, bring up NERDTree and navigate to the directory where you want to create the new file.
Press m
to bring up the NERDTree Filesystem Menu.
This menu allows you to create, rename, and delete files and directories.
Type a
to add a child node and then simply enter the filename.
You’re done!
To create a directory follow the same steps but append a /
to the filename.
Thanks to @soofaloofa for summarising this in https://sookocheff.com/post/vim/creating-a-new-file-or-directoryin-vim-using-nerdtree/ ❤️
- How to install NERDTree (or any other Vim plugin) using Vundle: https://vi.stackexchange.com/questions/5335/how-to-install-nerdtree-with-vundle
Helix
is a "post-modern" modal text editor
that picks up where Vim
left off.
See:
helix-editor.com
and
github.com/helix-editor/helix
It includes many of the most popular features
that are plugins in the Vim
ecosystem
such as a file-picker, fuzzy searching, language servers and themes.
It's a "batteries included" alternative to Vim
with many enhancements.
It's built with Rust
and under active development.
If you already have the Rust
toolchain on your computer,
you can install Helix
with:
git clone https://github.com/helix-editor/helix
cd helix
cargo install --locked --path helix-term
see: github.com/helix-editor/helix#installation
brew install helix
Once installed,
in any terminal window,
start Helix
by issuing the command:
hx .