An open API service indexing awesome lists of open source software.

https://github.com/lavantien/dotfiles

SWE Dotfiles (Neovim, Wezterm, Ubuntu) - Battery Included
https://github.com/lavantien/dotfiles

ai aider code-editor config dotfiles ide linux llm neovim ubuntu

Last synced: 5 months ago
JSON representation

SWE Dotfiles (Neovim, Wezterm, Ubuntu) - Battery Included

Awesome Lists containing this project

README

          

# SWE Dotfiles (Neovim, Wezterm, Ubuntu) - Battery Included

This setup covers basic linux/zsh/wezterm config and converts Neovim into a full-featured IDE for languages like Lua, Go, JavaScript/TypeScript, Python, C/C++, Rust, Java, and more. With integrated LSP, debugging, testing, and rich customization options, you can boost your productivity effortlessly.

## Installation 🔧

### Prerequisites

- **Neovim Nightly/Prerelease (v0.11+).**
- Essential tools: Git, GH CLI, GCC/LLVM, Go, NodeJS, Python3, Rust, Lua, etc.
- System tweaks: Increase file watchers and open file limits.

### Linux Setup

1. **System Setup:**
- **WiFi Power Save:**
```bash
sudo vi /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
```
Set:
```
[connection]
wifi.powersave = 2
```
- **Restart NetworkManager:**
```bash
sudo systemctl restart NetworkManager
```
- **File Limits & Inotify Watches:**
Edit `/etc/systemd/system.conf` and `user.conf` to set:
```
DefaultLimitNOFILE=4096:2097152
```
Then run:
```bash
sudo sysctl fs.inotify.max_user_watches=2097152 && sudo systemctl daemon-reexec
```
- **Install all necessary packages**: zsh, zsh-suggestions, fzf, ripgrep, eza, sccache, go, rust, node, java, etc.
2. **File Setup:**
- Deploy to destinations, and bring your own API keys to `.aider.conf.yml`:
```bash
./deploy.sh
```
- Update repo of latest local changes:
```bash
./update.sh
```
3. **Finalize:**
- **Reboot** your system.
- Automatically update all global packages:
```bash
sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y \
&& sudo snap refresh \
&& rustup update && cargo install-update -a \
&& npm -g update && go-global-update \
&& brew upgrade \
&& flatpak update -y
```
- Open Neovim (`nvim`) and allow plugins to auto-install.

### Windows Setup

Follow the original Windows instructions for environment adjustments, package installations, and file configurations.

## Features 💡

- **Multi-Language Support:** Lua, Go, JS/TS, Python, C/C++, Rust, Java, and more.
- **Integrated IDE Tools:** Virtual LSP, debugging, testing frameworks, code actions, and snippet management.
- **Streamlined Workflow:** Custom keybindings, Git integration, and an intuitive UI.
- **Customization:** Pre-configured themes (Gruvbox, Tokyo Night, Pine Rose) with flexible plugin management.

## Key Bindings ⌨️

### Detailed Keymap Overview

| Key Combination | Mode(s) | Command/Action | Description |
| --------------- | ---------------------- | ----------------------------------------------------------------------------- | -------------------------------------------- |
| `J` (visual) | Visual | `:m '>+1gv=gv` | Move text down |
| `K` (visual) | Visual | `:m '<-2gv=gv` | Move text up |
| `` | Normal | `zz` | Jump down half page and center view |
| `` | Normal | `zz` | Jump up half page and center view |
| `n` | Normal | `nzzzv` | Go to next match and center view |
| `N` | Normal | `Nzzzv` | Go to previous match and center view |
| `` | Visual (x) | `[["_dP]]` | Paste overwrite without yanking |
| `` | Normal/Visual | `[["+y]]` | Yank selected text to system clipboard |
| `` | Normal | `[["+Y]]` | Yank whole line to system clipboard |
| `` | Normal/Visual | `[["_d]]` | Delete without copying to clipboard |
| `` | Insert | `` | Escape/Exit Insert mode |
| `` | Insert | `require("minuet").make_cmp_map` | Manually invoke minuet completion |
| `Q` | Normal | `q` | Quit |
| `A-S-q` | Normal | `tabclose` | Close tab |
| `` | Terminal | `` | Exit terminal mode |
| `gt` | Normal | `split term` | Toggle terminal |
| `g=` | Normal | `vim.lsp.buf.format` | Format current file |
| `` | Normal | `cclose` | Close quickfix window |
| `` | Normal | `cnextzz` | Next quickfix item |
| `` | Normal | `cprevzz` | Previous quickfix item |
| `k` | Normal | `lnextzz` | Next POI location |
| `j` | Normal | `lprevzz` | Previous POI location |
| `` | Normal/Terminal/Insert | `j` | Jump to bottom pane |
| `` | Normal/Terminal/Insert | `k` | Jump to top pane |
| `` | Normal/Terminal/Insert | `h` | Jump to left pane |
| `` | Normal/Terminal/Insert | `l` | Jump to right pane |
| `` | Normal | `t` | Jump to top left pane |
| `s` | Normal | `:%s/\<\>//gI` | Concurrently replace all matching words |
| `ii` | Normal | `e ~/.config/nvim/lua/plugins/init.lua` | Go to plugins init file |
| `iq` | Normal | `e ~/notes/quick.md` | Go to personal quick note file |
| `ic` | Normal | `e ~/notes/checklist.md` | Go to personal checklist file |
| `it` | Normal | `e ~/notes/temp.md` | Go to personal temp text file |
| `ij` | Normal | `e ~/notes/journal.md` | Go to personal journal file |
| `iw` | Normal | `e ~/notes/wiki.md` | Go to personal wiki file |
| `ir` | Normal | `CellularAutomaton make_it_rain` | Run Make It Rain animation |
| `il` | Normal | `CellularAutomaton game_of_life` | Run Game of Life animation |
| `` | Normal | `builtin.grep_string({ search = vim.fn.input("Grep > ") })` | Grep string global via Telescope |
| `` | Normal | `builtin.find_files` | Browse files global via Telescope |
| `f` | Normal | `builtin.current_buffer_fuzzy_find` | Find string local via Telescope |
| `vf` | Normal | `builtin.git_files` | Find git files global via Telescope |
| `vh` | Normal | `builtin.help_tags` | Browse help tags via Telescope |
| `vp` | Normal | `builtin.commands` | Browse commands via Telescope |
| `vk` | Normal | `builtin.keymaps` | Browse keymaps via Telescope |
| `vq` | Normal | `builtin.quickfix` | Browse quickfix items local via Telescope |
| `vj` | Normal | `builtin.jumplist` | Browse jumplist global via Telescope |
| `vm` | Normal | `require("telescope").extensions.metals.commands()` | Browse Metals LSP commands |
| `ac` | Normal | `builtin.diagnostics` | Browse diagnostics items local via Telescope |
| `ar` | Normal | `builtin.lsp_references` | Browse LSP References via Telescope |
| `as` | Normal | `builtin.lsp_document_symbols` | Browse LSP Document Symbols via Telescope |
| `aw` | Normal | `builtin.lsp_dynamic_workspace_symbols` | Browse LSP Dynamic Workspace Symbols global |
| `ai` | Normal | `builtin.lsp_implementations` | Browse LSP Implementations via Telescope |
| `ad` | Normal | `builtin.lsp_definitions` | Browse LSP Definitions via Telescope |
| `at` | Normal | `builtin.lsp_type_definitions` | Browse LSP Type Definitions via Telescope |
| `` | Normal | `require("telescope").extensions.smart_open.smart_open()` | Open smart file picker in Telescope |
| `tf` | Normal | `neotest.run.run()` | Test single function |
| `ts` | Normal | `neotest.run.stop()` | Test stop |
| `tb` | Normal | `neotest.run.run(vim.fn.expand("%"))` | Test single file |
| `td` | Normal | `neotest.run.run(".")` | Test all from current directory |
| `ta` | Normal | `neotest.run.run(vim.fn.getcwd())` | Test whole suite from root dir |
| `tm` | Normal | `neotest.summary.toggle()` | Test summary toggle |
| `tn` | Normal | `neotest.run.run({ strategy = "dap" })` | Debug nearest test |
| `tg` | Normal | `ConfigureGtest` | Configure C++ google test |
| `tww` | Normal | `neotest.watch.toggle(vim.fn.expand("%"))` | Test watch toggle current file |
| `tws` | Normal | `neotest.watch.stop("")` | Test watch stop all position |
| `to` | Normal | `neotest.output.open({ enter = true })` | Test output open |
| `tp` | Normal | `neotest.output_panel.toggle()` | Test output toggle panel |
| `tc` | Normal | `neotest.output_panel.clear()` | Test output clear panel |
| `twj` | Normal | `neotest.run.run({ jestCommand = "jest --watch " })` | Test Jest watch mode |
| `twv` | Normal | `neotest.run.run({ vitestCommand = "vitest --watch" })` | Run Watch |
| `twf` | Normal | `neotest.run.run({ vim.fn.expand(" % "), vitestCommand = "vitest --watch" })` | Run Watch File |
| `` | Normal | `dap.continue` | Debug: Continue |
| `` | Normal | `dap.step_over` | Debug: Step over |
| `` | Normal | `dap.step_into` | Debug: Step into |
| `` | Normal | `dap.step_out` | Debug: Step out |
| `` | Normal | `function() dap.disconnect({ terminateDebuggee = true }); dap.close() end` | Debug: Stop |
| `b` | Normal | `dap.toggle_breakpoint` | Debug: Toggle breakpoint |
| `B` | Normal | `dap.set_breakpoint(vim.fn.input("Breakpoint condition: "))` | Debug: Set breakpoint condition |
| `ap` | Normal | `dap.set_breakpoint(nil, nil, vim.fn.input("Log point message: "))` | Debug: Set log point message |
| `el` | Normal | `dap.run_last` | Debug: Run last session |
| `er` | Normal | `dap.repl.open` | Debug: Open REPL |
| `et` | Normal | `require("dap-go").debug_test` | Debug golang test |
| `ee` | Normal | `require("dapui").eval(nil, { enter = true })` | Debug evaluate expression |
| `h` | Normal | `harpoon:list():add()` | Add current location to Harpoon list |
| `` | Normal | `harpoon.ui:toggle_quick_menu(harpoon:list())` | Toggle Harpoon interactive list |
| `` | Normal | `harpoon:list():select(1)` | Go to 1st Harpoon location |
| `` | Normal | `harpoon:list():select(2)` | Go to 2nd Harpoon location |
| `` | Normal | `harpoon:list():select(3)` | Go to 3rd Harpoon location |
| `` | Normal | `harpoon:list():select(4)` | Go to 4th Harpoon location |
| `` | Normal | `harpoon:list():prev()` | Go to next Harpoon location |
| `` | Normal | `harpoon:list():next()` | Go to previous Harpoon location |
| `re` | Visual | `refactoring.refactor("Extract Function")` | Refactor extract function |
| `rf` | Visual | `refactoring.refactor("Extract Function To File")` | Refactor extract function to file |
| `rv` | Visual | `refactoring.refactor("Extract Variable")` | Refactor extract variable |
| `rI` | Normal | `refactoring.refactor("Inline Function")` | Refactor inline function |
| `ri` | Normal/Visual | `refactoring.refactor("Inline Variable")` | Refactor inline variable |
| `rb` | Normal | `refactoring.refactor("Extract Block")` | Refactor extract block |
| `rB` | Normal | `refactoring.refactor("Extract Block To File")` | Refactor extract block to file |
| `rd` | Normal/Visual | `refactoring.debug.print_var()` | Refactor debug print var |
| `rD` | Normal | `refactoring.debug.printf({ below = false })` | Refactor debug printf |
| `rc` | Normal | `refactoring.debug.cleanup({})` | Refactor debug cleanup |
| `rt` | Normal/Visual | `refactoring.select_refactor()` | Refactor select native thing |
| `rr` | Normal/Visual | `require("telescope").extensions.refactoring.refactors()` | Refactor select operations via Telescope |
| `u` | Normal | `vim.cmd.UndotreeToggle` | Toggle undo tree |
| `gs` | Normal | `vim.cmd.Git` | Open git fugitive |
| `gh` | Normal | `DiffviewFileHistory` | Open history current branch |
| `gf` | Normal | `DiffviewFileHistory %` | Open history current file |
| `gd` | Normal | `DiffviewOpen` | Open diff current index |
| `gm` | Normal | `DiffviewOpen origin/main...HEAD` | Open diff main |
| `gc` | Normal | `DiffviewClose` | Close diff view |
| `zR` | Normal | `require("ufo").openAllFolds` | Open all folds |
| `zM` | Normal | `require("ufo").closeAllFolds` | Close all folds |
| `-` | Normal | `Oil` | Open parent directory |
| `-` | Normal | `require("oil").toggle_float` | Open parent directory in floating window |
| `tr` | Normal | `Markview Toggle` | Toggle Render Markdown |
| `nh` | Normal | `noice.cmd("history")` | Noice history |
| `nl` | Normal | `noice.cmd("last")` | Noice last |
| `nd` | Normal | `noice.cmd("dismiss")` | Noice dismiss |
| `ne` | Normal | `noice.cmd("errors")` | Noice errors |
| `nq` | Normal | `noice.cmd("disable")` | Noice disable |
| `nb` | Normal | `noice.cmd("enable")` | Noice enable |
| `ns` | Normal | `noice.cmd("stats")` | Noice debugging stats |
| `nt` | Normal | `noice.cmd("telescope")` | Noice open messages in Telescope |
| `` | Command | `noice.redirect(vim.fn.getcmdline())` | Redirect Cmdline |
| `` | Normal/Insert/Select | `require("noice.lsp").scroll(4)` | LSP hover doc scroll up |
| `` | Normal/Insert/Select | `require("noice.lsp").scroll(-4)` | LSP hover doc scroll down |

## Plugins & Tools 🔌

The configuration integrates over 80 plugins, such as:

- **LSP & Coding:** `lsp-zero.nvim`, `nvim-lspconfig`
- **Navigation:** `telescope.nvim`, `oil.nvim`, `harpoon`
- **Debugging & Testing:** `nvim-dap`, `neotest`
- **UI Enhancements:** `noice.nvim`, `lualine.nvim`

## Resources & References 📚

- **Video Tutorials:**
- [0 to LSP](https://youtu.be/w7i4amo_zae) 🎥
- [Zero to IDE](https://youtu.be/n93ctbtlcim) 🎥
- **Guides & Repositories:**
- [kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim)
- [ThePrimeagen's init.lua](https://github.com/theprimeagen/init.lua)
- [tjdevries/config.nvim](https://github.com/tjdevries/config.nvim)
- **Extras:**
- [Backup qBittorrent](https://github.com/cantalupo555/qbittorrent-backup-linux)

## License 📄

See the [LICENSE](LICENSE) file for details.