To prevent myself from going down wild Linux rabbit holes and trying every distribution I can get my hands on, I've transcended into an Apple chad. Therefore, this configuration may require changes to work in a Linux environment.
- neovim
- tmux
- yabai & skhd
- As part of the yabairc, we use jankyborders
- ripgrep
- fzf
- zsh
- sketchybar
- As part of the scripts (see here for example) we need jq
- Make sure you create a
sketchybar/scripts/weather.env.shfile containing the values forWEATHER_KEY=123andWEATHER_CITY=London
Optional Software: (Warning: you may have to remove some alises / plugins if these are not installed)
- bat
- eza
- zoxide
- todoist_helper
- neofetch
- tmate
- btop
- alacritty terminal
- zoxide
- nerd fonts for devicons to display in nvim-tree
- for instance,
brew tap homebrew/cask-fonts && brew install --cask font-commit-mono-nerd-font, and added to your terminal (see ./alacrity/config.yml)
- for instance,
- cmake
brew install cmakeor else the installation of telescopes fzf plugin will fail - fd as an optional dependency of telescope, used in telescope.lua
- gpgtools for signing commits. (Note: instead of symlinking
git/.gitconfig, copy it instead as you'll need to add a signingkey)
Most files in this repo are structured so that you can symlink the directory directly into ~/.config, except for a few that need to live in different places such as zshrc.
Using lazy.nvim as a plugin manager, here are the plugins used:
- goolord/alpha-nvim for the dashboard (see the asciis in utils)
- telescope.nvim for fuzzy finding
- nvim-treesitter for code parsing etc
- rose-pine/neovim as a colour scheme. an equivalent is used for tmux and alacritty themes too
- mason.nvim is used in conjunction with lsp-zero to manage your different LSPs
- lsp-zero.nvim to use NeoVim's LSP client
- harpoon is used for silky smooth file movement
- undotree for all your accidental undo's
- vim-fugitive for git within vim
- vim-rhubarb primarily just for
:GBrowse- going to the file you're in, in your browser - copilot.vim to let robots do our work for us
- nvim-tree.lua for a better than nerdtree experience
- nvim-tree/nvim-web-devicons for icons
- lualine.nvim a good looking statusline
- Comment.nvim to comment out your broken code
- nvim-surround to surround whatever you want, with whatever you want
- conform.nvim to enable formatters such as eslint
- vim-dadbod for mysql connections and queries in vim
- Line numbers and relative numbers are turned on.
- Line wrapping is turned off.
- The grep program for searching is set to ripgrep.
- Trailing whitespace is automatically stripped on buffer write.
<leader>is set to<Space><leader>spwill spell the previous word correctly.nandNafter a search will reposition the cursor to the center of the screen for better visibility.Jcombines the next line with the current line, ensuring the cursor remains at the beginning of the combined line.<C-d>and<C-u>scroll half a screen down or up while keeping the cursor position fixed.<leader><Enter>clears the search highlight.J(Visual Mode) andK(Visual Mode) move the selected lines down (J) or up (K) in visual mode.<leader>yand<leader>Yyank the current line (<leader>y) or from the cursor to the end of the line (<leader>Y) to the system clipboard.<leader>pand<leader>dpaste (<leader>p) or delete (<leader>d) without copying to the buffer.<leader>fformats the current buffer using the LSP (Language Server Protocol).<C-j>and<C-k>navigate through the quickfix list, ensuring the cursor position is centered.<leader>+h,j,k,lmove your cursor to different windows.<leader>sperforms a case-insensitive search and replace across the entire buffer, prompting for confirmation.<leader>rtoggles relative line numbers.K(Normal Mode) to show documentation.<leader>+and<leader>-vertically enlarge or reduce a pane.<leader>coand<leader>ccopen and close the quickfix list.
A random list of handy vim commands
-
Copilot:
- In insert mode,
<C-L>will complete the suggestion.
- In insert mode,
-
Fugitive:
<leader>gswill open git in nvim.<leader>gdfwill open a git diff of the current file.
-
Harpoon:
<leader>awill add to the list.<leader>ewill open the list. This is changeable using general vim motions, such as deleting or moving a line below.
-
Rhubarb:
<leader>gbwill open the browser to the current file.
-
Surround:
ys{motion}{wrapper}will surround with the{wrapper}variable. This also works invisualmode.
-
Telescope:
- Use
\for a fuzzy project word search. <C-T>to search files.<C-P>to search files that aren't in git.<leader>bto browse your buffer files.- Pressing tab to select from the list, then following with
<C-q>will open a quickfix list
- Use
-
Tree:
<leader>nnto open the file tree.<leader>nfto find the current file in the tree. Useato add files,dto delete, andrto rename from the tree.
-
Undotree:
<leader>uto open undotree.
-
Dadbod:
<leader>dbto open the database UI.
By default, the following LSPs will be installed:
ts_lsfor typescript. (old:tsserver)eslintfor eslint.solargraphfor ruby.lua_lsfor lua.tailwindcssfor tailwind.rust_analyzerfor rust.goplsfor golang.jsonlsfor json.emmet_lsfor emmet html.
- Pressing
Tab(orShift-Tab) completes your LSP suggestions. - Pressing
<Enter>populates the currently selected tab. [gand]gwill go to the previous and next diagnostics error respectively.gdwill go to definition.<leader>grwill go to references.<leader>crwill rename the currently highlighted variable.<leader>vcawill display code actions.<leader>cfwill apply the quickfix code action.
Additionally, use <C-Space> to open the completion menu if it's not automatically open.
A full list of zsh aliases live under ./zsh/aliases.zsh, but here are a few:
viandvimare aliased tonvim.gaandgaaalias git add for staging changes for either a specified file or all unstaged files.gapprompts for interactive staging withgit add -p.gbshows the Git branch, andgcinitiates a Git commit.gcacombinesgit add .andgit commit.gcois a shortcut forgit checkout.gcoballows you to interactively switch Git branches.gpushb,gbd,gpullb, andgmergebstreamline branch operations.gpsimplifies the Git push command.gfandgfaalias Git fetch commands.gstprovides a concise Git status with untracked files.egstshows modified files withgit statusand opens them in Neovim.CTRL-Twill search for files from the command line with fzfESC-C(ALT-Con Linux) will search for directories from the command line, and selecting one will place you in the directory
See the tmux config in ./tmux/.tmux.conf, here are a few helpful aliases:
<C-b>is the prefix<prefix>[to open vi mode within tmux<prefix>fto use thetmux-sessionizerscript, which will open a project in a new session<prefix>fto use thetmux-sessionizerscript, which will open a project in a new session<prefix>|to split vertically<prefix>-to split horizontally
- Check
:checkhealthto ensure all plugins are working correctly. - Use
:mapor:verbose map <leader>nn(for instance) to check keybinds are being set correctly. :lua print(vim.inspect(vim.lsp.buf_get_clients()[1].resolved_capabilities))to see what the LSP can do- If seeing errors using flags such as
error parsing flag -E- remember that this could be because it's aliased. In the instance ofgrep, you may need to use/usr/bin/grepto use grep intead ofrg - When starting
yabai, you may need to runyabai --start-serviceinstead ofbrew services start yabaiper this issue
You're more than welcome to submit an issue or PR with any bugs or feature suggestions. See issues for current feature requests/bugs.
If you want to pair up on a project or build out any of the above, pop me an email at hayden@rouille.dev.