Skip to content

Commit

Permalink
Tweaks for NvChad
Browse files Browse the repository at this point in the history
  • Loading branch information
utensil committed Nov 4, 2024
1 parent 80f1175 commit f75d4c9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 9 deletions.
3 changes: 2 additions & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,5 @@ keymap("i", "kj", "<ESC>", opts)
keymap("v", "<", "<gv^", opts)
keymap("v", ">", ">gv^", opts)

keymap("v", "/", "gc", opts)
-- doesn't work
-- keymap("v", "/", "gc", opts)
16 changes: 13 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ run-shellcheck:
shellcheck *.sh

prep-term: prep-kitty
which nvim || brew install neovim
which lazygit || brew install lazygit
which yq || brew install yq
which gh || brew install gh
Expand Down Expand Up @@ -147,7 +148,7 @@ sync-lazyvim: stylua sync-plugins
cp -f init.lua ~/.config/lazyvim/nvim-init.lua
cp -f lazyvim-init.lua ~/.config/lazyvim/lazyvim-init.lua

sync-nvchad: stylua sync-plugins
sync-chad: stylua sync-plugins
mkdir -p ~/.config/nvchad/
cp -f init.lua ~/.config/nvchad/nvim-init.lua
cp -f lazyvim-init.lua ~/.config/nvchad/nvchad-init.lua
Expand Down Expand Up @@ -190,15 +191,15 @@ prep-lazyvim:
#!/usr/bin/env bash
cd ~/projects/{{PROJ}} && nvim --cmd 'set runtimepath+=~/.config/lazyvim/' --cmd 'lua package.path = package.path .. ";{{home_directory()}}/.config/lazyvim/lua/?.lua"' -u ~/.config/lazyvim/lazyvim-init.lua
prep-nvchad:
prep-chad:
#!/usr/bin/env bash
if [ -d ~/.config/nvchad ]; then
(cd ~/.config/nvchad && git pull)
else
git clone https://github.com/NvChad/starter ~/.config/nvchad
fi
@nvchad PROJ="forest": sync-nvchad
@chad PROJ="forest": sync-chad
#!/usr/bin/env bash
cd ~/projects/{{PROJ}} && nvim --cmd 'set runtimepath+=~/.config/nvchad/' --cmd 'lua package.path = package.path .. ";{{home_directory()}}/.config/nvchad/lua/?.lua"' -u ~/.config/nvchad/nvchad-init.lua
Expand Down Expand Up @@ -286,3 +287,12 @@ prep-monit:
rec:
uvx asciinema rec

add-brc LINE:
grep -F '{{LINE}}' ~/.bashrc|| echo '{{LINE}}' >> ~/.bashrc

prep-centos:
yes|sudo yum groupinstall 'Development Tools'
yes|sudo yum install procps-ng curl file git
yes|/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
just add-brc 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"'
23 changes: 18 additions & 5 deletions trees/uts-002F.tree
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ I use
- it has some [pre-installed plugins](https://www.lazyvim.org/plugins)
- similarly, see task `prep-lazyvim` and `lazyvim` in my justfile
- LazyVim specific keys are marked with 💤
- for both Vim flavors, the following apply:
- [NvChad](https://nvchad.com/)
- it's ~ 900 LOC lightweight configuration
- see tasks `prep-chad` and `chad` in my justfile
- NvChad specific keys are marked with 📦
- for all Vim flavors, the following apply:
- [shared configurations](https://github.com/utensil/forest/blob/main/init.lua)
- [shared plugins](https://github.com/utensil/forest/blob/main/uts-plugins.lua)
}
Expand Down Expand Up @@ -78,19 +82,22 @@ Other first aid key mappings or commands available in LunarVim:
- `<leader>+;` to open the dashboard for frequently used actions
- `<leader>+Lr` to reload the config
- `<leader>+li` to see LSP informations
- 📦
- `<leader>+ch` to open cheatsheet
}

\mdblock{Navigation}{
- Explore and find files
- `<leader>+e` to toggle file explorer on the left
- `x` to cut, `c` to copy, `p` to paste
- `a` to create a file, `d` to delete, `r` to rename
- `H` to toggle hidden files
- `H` to toggle hidden files, `I` to toggle git ignored files
- `Y` to copy relative path, `gy` to copy absolute path
- `s` to open in system file explorer
- `g?` for help, `q` to quit, `R` to refresh
- `hjkl` to move up/down, collapse/expand
- it will automatically follow the current file
- 💤 and 📦 can't be toggled, need `q` to quit
- 🌕
- `<leader>+sr` to fuzzy find recent files
- `<leader>+sf` to fuzzy find files
Expand Down Expand Up @@ -198,10 +205,12 @@ Other first aid key mappings or commands available in LunarVim:
- Indentation & comment
- use `<<`/`>>` to indent/unindent the current line
- use a single `<`/`>` to unindent/indent the selected text
- 🌕 `<leader>+/` to toggle comment
- 🌕
- `<leader>+/` to toggle comment
- works for both current line and selected text
- 💤 use `gc` to toggle comment for selected text
- that measn `Vgc` to comment/uncomment a line
- 💤
- `gc` to toggle comment for selected text
- `gcc` to comment/uncomment a line
- Multiple-cursor editing (\link{https://medium.com/@schtoeffel/you-don-t-need-more-than-one-cursor-in-vim-2c44117d51db})
- use `/xyz` + enter to search for `xyz`, then `cgn` to change it to something else, `Esc`, then
- use `.` to do the same for next occurrences
Expand Down Expand Up @@ -247,6 +256,10 @@ It's very important to stay in the flow and Zen mode as much as possible. Split
- `:term` to open a terminal
- it's normal mode by default, `i` to start typing commands
- `:sp term://zsh` to open a terminal running `zsh` at the bottom
- 📦
- use `<leader>+h` to open a new horizontal split terminal
- `:q` to hide terminal
- `<leader>+pt` to pick hidden terminal
- Working inside the terminal
- `exit` will exit the terminal and close the window associated with it
- `Ctrl`+`c` can be used for interrupting the terminal
Expand Down

0 comments on commit f75d4c9

Please sign in to comment.