dotfiles
dotfiles copied to clipboard
Bootstrap neovim/zsh/tmux environment for Ruby on Rails development
What?
Configurations for neovim, zsh, tmux, and macOS, with a focus on neovim.
What You Get
- Neovim nightly
- LSP & tree-sitter integration
- FZF & Telescope integration
- tmux
Common tasks should require a minimum of keystrokes. Fuzzy finding is preferred over tab completion. File trees are for the weak.
Installation
> git clone [email protected]:jchilders/dotfiles.git
> cd dotfiles
> make install
make
- List available targets without doing anything
make install
- Install All The Things. Installs homebrew, default
homebrew formalae (including tmux), clones & builds neovim from source, and
links all configuration files (dotfiles). Typically used when bootstraping a
new development machine.
make clean
- Uninstall All The Things
make cfg
- Links configuration files (dotfiles) only, without installing
neovim or any homebrew formulae.
make cfg-clean
- Unlink configuration files
make neovim
- Install neovim nightly from source, configuration files, and
plugins
make neovim-clean
- Uninstall neovim nightly from source, configuration
files, and plugins
make neovim-cfg
- Install neovim configuration files
make neovim-cfg-clean
- Uninstall neovim configuration files
Run make
by itself to see other avalable targets.
Why Make?
Q: lol why are you using Make?
A: Because I'd never written a Makefile before, and honestly? It works pretty well.
ctrl-o
For both zsh and nvim commonly used functionality is provided via Ctrl-O mappings. There are two basic types of Ctrl-O mappings: git-related, and finding & editing files.
ctrl-o file mappings
These work in both zsh and nvim.
mapping | description |
---|---|
^oo | Find file & edit |
^oO | Find any file (ignores .gitignore ) & edit |
^orc | Find Rails controller & edit |
^orm | Find Rails model & edit |
^orv | Find Rails view & edit |
ctrl-o git mappings
These work in both zsh and nvim.
mapping | description |
---|---|
^oga | Find uncommited changed file & add to staging area (git add ) |
^ogb | Switch branch |
^ogd | Find uncommited changed file & show diff (git diff ) |
^ogs | Find uncommited changed file & edit (git status ) |
Neovim
Mappings
Additional Ctrl-O Mappings
Common mappings are given in the
mapping | description | provided by |
---|---|---|
^ob | Fuzzy switch buffer by filename | telescope.nvim |
^or | Fuzzy go to symbol (method name, etc.) for current buffer | telescope.nvim |
^oR | Fuzzy go to symbol (method name, etc.) for current workspace | telescope.nvim |
^os | Search directory for string under cursor | telescope.nvim |
Other Noteworthy Neovim Mappings
mapping | description |
---|---|
Enter | Clear highlighted search |
,, | Switch between next/previous buffers |
,ccs | Change (rename) current symbol |
,g | Toggle gutter |
,]] | Go to next error/warning |
,[[ | Go to previous error/warning |
,e | Show error/warning for current line |
gc. | Comment/uncomment code block (treesitter based) |
gc |
Comment/uncomment |
gcc | Comment/uncomment current line |
Ruby- and Rails-specific Neovim Mappings
mapping | description |
---|---|
,bp | Insert binding.pry below current line |
,bP | Insert binding.pry above current line |
,rp | Insert puts below current line |
,rP | Insert puts above current line |
,rr | Restart console running in tmux pane to the left |
,rt | Run most recently modified spec in tmux pane to the left |
Sending to Tmux
mapping | description |
---|---|
,sl | Send current line to tmux pane to the left |
,sl | Send current selection to tmux pane to the left |
zsh
Mappings
Additional mappings (widgets) available to zsh:
mapping | description |
---|---|
^t | Find file and append to current cursor position |
^r | Search command history (^r<enter> to run last command) |
Aliases
alias | description |
---|---|
bi | bundle install |
fc | Edit last command in $EDITOR |
gcb | Copies current branch name to pasteboard (clipboard) |
gd | git diff |
gst | git status -sb |
r | Rerun previous command |
rc | bin/rails console , or bin/console if in a Gem directory |
rdbm | rake db:migrate |
rdbms | rake db:migrate:status |
rdbmt | rake db:migrate RAILS_ENV=test |
rdbmst | rake db:migrate:status RAILS_ENV=test |
rs | rails server |
Directory Navigation
Uses zoxide
. For example:
➜ cd ~/work/myrailsproj
➜ pwd
/Users/jchilders/work/myrailsproj
➜ cd
➜ pwd
/Users/jchilders
➜ z myr
➜ pwd
/Users/jchilders/work/myrailsproj