Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/johannesbausch/dotfiles

A customized development environment built with NeoVim, WezTerm, and Fish. 👾
https://github.com/johannesbausch/dotfiles

config configuration dotfiles dotfiles-linux environment ide

Last synced: 13 days ago
JSON representation

A customized development environment built with NeoVim, WezTerm, and Fish. 👾

Awesome Lists containing this project

README

        

[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Unlicense License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]



Logo

Development Enviroment


Using NeoVim, WezTerm and Fish.




Please ⭐ this repository if you find it helpful!







Agenda

- [1. Project Information](#1-project-information)
- [1.1. Building blocks](#11-building-blocks)
- [2. Getting Started](#2-getting-started)
- [2.1. Set up WSL](#21-set-up-wsl)
- [2.2. Set up WezTerm](#22-set-up-wezterm)
- [2.3. Set up Fish](#23-set-up-fish)
- [2.4. Set up NeoVim](#24-set-up-neovim)
- [2.5. Programs & Dependencies](#25-programs-&-dependencies)
- [3. Configure your WSL & DNS](#3-configure-your-wsl--dns)
- [4. WSL Basics](#4-wsl-basics)
- [5. Quick NeoVim Crash Course](#5-quick-neovim-crash-course)
- [6. Discord Custom Rich Presence](#6-discord-custom-rich-presence)
- [7. Additional Information](#7-additional-information)
- [8. Contact Me](#8-contact-me)
- [9. License](#9-license)
- [10. Credits](#10-credits)

# 1. Project Information

This documentation provides a step-by-step guide for setting up a custom development environment using NeoVim.


Fork this project to get started.

**Note:**


Because this repository is designed to guide you step by step, I've included comments for all configurations, making it easy for you to immediately see and understand their purpose.



[Jump to Top](#top)



## 1.1. Building blocks

Here are the tools utilized in this development environment.

* **NeoVim:**


A text editor offering extensive plugin support and limitless customization options.




* **WezTerm:**


A customizable terminal designed to suit your preferences.




* **Fish:**


An enhanced alternative to traditional shells, offering extensive customization options.



[Jump to Top](#top)



# 2. Getting Started

In this section, you will learn how to set up and personalize the environment to make it your own.


There's a lot of information here, but don’t worry—everything is explained in detail, step by step.


Before getting started, let’s review the structure of this project.




This repository is organized into two main directories: `win` (Windows) and `wsl` (Windows Subsystem Linux).


The `win` directory contains configurations specific to WezTerm, as WezTerm is used within the Windows environment.


The `wsl` directory includes tools and settings for the Linux subsystem, such as Fish, NeoVim, and more, since these are part of the Linux subsystem.




Each System has its own `.config` file.
On Windows, you can place the repository's `wezterm` configuration file in the `C:/Users/your_name/.config` directory.


On Linux, you can replace your `/root/.config` with the `.config` directory from this repository.



**GitHub CLI**


The hosts.yml file located in `/root/.config/gh` is automatically updated whenever you log in to GitHub.


You don't need to modify this file manually.



**Git Config**


The `gitconfig` file must also be updated.


Replace `your_name` with your actual name and the placeholder email with your real email address.


This ensures that your commits are attributed to you with the correct name and email.



[Jump to Top](#top)



## 2.1. Set up WSL

To proceed, you first need to set up your Linux Subsystem.

* **Why do we do that?**


Setting up the Linux Subsystem enables you to run Linux tools and applications on Windows, creating a more flexible development environment.


Using NeoVim in Linux is beneficial because Linux offers better compatibility with development tools, native package managers, and scripting environments.


It also provides a more customizable and efficient workflow, especially when working with command-line utilities and managing dependencies.




* **How do we do that?**
```shell
wsl --install -d Debian
```

Now, all you need to do is create a user for your Linux Subsystem.



[Jump to Top](#top)



## 2.2. Set up WezTerm

First, visit the link and download WezTerm from here.


You know the drill—just run the setup, and you're good to go.

Next, move the repository's `wezterm` folder from your forked repository into `C:/Users/your_name/.config`.

Congrats! You now have WezTerm.



[Jump to Top](#top)



## 2.3. Set up Fish

Now that WezTerm is installed, we need a powerful shell to navigate with.

1. **Install Fish:**
```shell
apt install fish
```


2. **Install Fisher:**


A Plugin Manager for your shell.
```shell
curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher
```


3. **Install Tide:**


This allows you to Style And customize your shell.
```shell
fisher install IlanCosman/tide@v6
```


4. **Register the Fish shell in the system:**
```shell
echo /usr/local/bin/fish | sudo tee -a /etc/shells
```


5. **Change Fish To Default Shell:**
```shell
chsh -s /usr/local/bin/fish
```


6. **Set Up Tide:**


You can also configure the basic appearance using `tide configure`.


This will open a wizard with visual examples to guide you.

**Note:**


The `fish_variables` file is auto-generated.


The `fish_plugins` and `config.fish` files are either manually created or, if you utilize this repository's configuration, transferred from the repository to your `/root/.config/fish` directory.

**Info:**


The Fisher plugin manages Fish shell plugins, making it easy to install, update, and configure them.


The Tide plugin provides a visually customizable prompt for the Fish shell, enhancing its appearance and functionality.



[Jump to Top](#top)



## 2.4. Set up NeoVim

Of course, we can't forget about the heart of the environment—NeoVim.


NeoVim is entirely configured in Lua, eliminating the need to install any additional packages beyond NeoVim itself.

1. **Install NeoVim:**
```shell
apt install neovim
```


2. **Run Lazy.nvim:**


To install all the defined plugins, you need to run the plugin manager.


Type `vi` to enter Neovim, then type `:Lazy` and press Enter.

To find more plugins, visit



[Jump to Top](#top)



## 2.5. Programs & Dependencies

Now, let's take a look at some useful programs.

1. **Update Your Packages:**
```shell
apt update
```


2. **Install PNPM:**


I use pnpm as a package manager because it is faster and more efficient than traditional package managers like npm.


It uses a unique approach of hard-linking dependencies, which saves disk space and speeds up installation times.
```shell
curl -fsSL https://get.pnpm.io/install.sh | sh -
```


3. **Install Node:**


I use Node for my own projects.


If you don’t need it, feel free to skip it.
```shell
pnpm env use --global latest
```


4. **Install LSD:**


LSD is an enhanced version of the ls command that provides additional features, such as colorful output, improved file type icons, and a more user-friendly display of directory contents.


It makes navigating the filesystem more visually appealing and informative.
```shell
apt install lsd
```


5. **Install GCC:**


GCC (GNU Compiler Collection) is a C compiler that translates C code into machine code, allowing programs to be executed on a computer.


It's essential for compiling C programs and is widely used in development because it supports multiple programming languages, is highly optimized, and works across various platforms.
```shell
apt install gcc
```


6. **Install Neofetch:**


Neofetch is a system information tool that displays detailed information about your system in a visually appealing way, including details like the OS, kernel, uptime, memory usage, and more.


It’s useful for quickly checking system stats and for displaying custom system info in a terminal, often used by developers and in system setups.
```shell
apt install neofetch
```


7. **Install A Font:**


Quick step outside the Linux Subsystem:


Visit Nerd Fonts and download a font that you feel comfortable with.


Make sure to unzip the font and save the font file under `C:\Windows\Fonts`.


Then, update the `typography.lua` WezTerm configuration to reflect the new font.




8. **Install Clipboard:**


A clipboard allows you to copy and paste content both into and out of the Linux Subsystem.
```shell
apt install xclip
```


9. **Install grep:**


This tool helps you find specific files and definitions.


Most Linux distributions come with `grep` pre-installed, but if you don't have it, you may want to install it.
```shell
apt install grep
```


10. **Install Make:**


This tool is helpful for automating the process of building and managing dependencies in software projects.




11. **Install Unzip:**


This tool is helpful for extracting files from `.zip` archives.




12. **Install Git:**
* ```shell
apt install git
```
* ```shell
git config --global core.editor "nvim"
```


13. **Install GitHub CLI:**
* ```shell
apt install gh
```
* ```shell
gh auth login
```


14. **Install ripgrep:**
```shell
apt install ripgrep
```



[Jump to Top](#top)



# 3. Configure Your WSL & DNS

To properly work with your Linux Subsystem, you need to add a `wsl.conf` and a `resolv.conf`.


Follow the steps below to achieve this:

1. **Create a `wsl.conf`:**


Move the `wsl.conf` File from this repository into your `/etc/` folder.




2. **Override The `resolv.conf`:**


For example, you can use Google's public DNS.
```shell
bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf'
```


3. **Make the `resolv.conf` Unmodifiable:**
```shell
chattr +i /etc/resolv.conf
```

This way, your Linux Subsystem will have a DNS that properly resolves your requests.



[Jump to Top](#top)



# 4. WSL Basics

This section covers essential concepts that are important to understand about WSL.

1. **Starting WSL:**
```shell
wsl
```


2. **Access Windows Drive From WSL:**


This mounts your Windows drives to the Linux Subsystem, allowing you to copy or edit Windows files in Linux.
```shell
cd /mnt/c/
```


3. **Shutting Down WSL:**


Simply closing WezTerm won't work; it needs to be shut down separately.
```shell
wsl --shutdown
```



[Jump to Top](#top)



# 5. Quick NeoVim Crash Course

This section covers basic operations to ensure your NeoVim journey begins as smoothly as possible, as there are certain shortcuts you'll need to memorize.

1. **Open A File:**
```shell
vi file_name
```


2. **Save Changes:**
* **Save**


Press `esc` to enter normal mode, then type `:w` and hit enter.




* **Save and Exit**


Press `esc` to enter normal mode, then type `:x` and hit enter.




3. **Exit a File:**
* **Exit**


Press `esc` to enter normal mode, then type `:q` and hit enter.




* **Force Exit Without Saving**


Press `esc` to enter normal mode, then type `:q!` and hit enter.




4. **Undo:**
Press `esc` to enter normal mode, then type `u`.




5. **Redo:**
Press `esc` to enter normal mode, then type `CTRL+r`.




6. **Edit a File:**
Press `i` to enter insert mode.




7. **Copy And Paste:**
* **Copy**


Press `v` to enter visual mode, select the text, then press `y` to yank (copy).




* **Paste**


Press `p` to paste the copied text after the cursor.




8. **Open Database Tool:**


Press `esc` to enter normal mode, then type `:Dbee`.


Now, you could configure a database, for example: `postgres://user:password@localhost:5432/mydb`.




9. **Show Documentation:**


In Neovim, you can access the documentation by pressing `esc`, then typing `:h `.


For example, if you’re working with a file property like `vim.o.title = false`, you can type `:h title` to look up its details.


Once you’re done reading, you can close the help window by pressing `CTRL + w + q`.




10. **Open NeoTree:**


Press ``, then type `E`.




11. **Create a File In NeoTree:**


Navigate to a specific path, then type `a`.




12. **Rename a File In NeoTree:**


Navigate to a specific path, then type `r`.




13. **Delete a File In NeoTree:**


Navigate to a specific path, then type `d`.




14. **Switch Between Open Windows:**


Press `CTRL`, then type `w`.


After that, you can use `arrow_key` to navigate to another window.




15. **Change Window Size:**


Press ``, then type `w`.


After that, you can use `arrow_key` to resize a window.




16. **Show Error**


Press ``, then type `l` + `e`.
17. **Vertical Character Selection**


Hold `CTRL`, then type `g` to select characters vertically, creating a columnar selection.



[Jump to Top](#top)



# 6. Discord Custom Rich Presence

If you want others to see your activity in NeoVim through Discord's Rich Presence, there’s both bad and good news.


The bad news: WSL2 doesn't support this feature, so it's not possible to directly link your application to Discord.


The good news: There is a workaround.



With this configuration, Discord will always display NeoVim as your Rich Presence whenever WSL is launched, not just NeoVim.


This implementation was chosen for its smoother performance and user experience.


NeoVim is the primary tool used in most sessions of this development environment, making it a natural fit for the workflow.

1. **Install CustomRP:**


Visit this repository to continue.


Then come back.




2. **CustomRP Preset:**


Create a preset and move the (.crp) file to a location of your choice.


For example, `C/Users/your_name/your_preset.crp`




3. **Copy The Start CustomRP Script:**
After configuring CustomRP, move the `start_customrp.sh` script from its current location in the repository (`/wsl/etc/profile.d/start_customrp.sh`)
to your own profile directory at `/etc/profile.d`.


Then, modify the path in the `start_customrp.sh` script to reflect the location of your CustomRP preset.




4. **Make It Executable:**
```shell
chmod +x /etc/profile.d/start_customrp.sh
```


5. **Create a Simlink:**
```shell
ln -s /mnt/c/Users/name/AppData/Roaming/CustomRP/CustomRP.exe /bin/customrp
```


6. **Copy The Start Service:**


Relocate the `start_customrp.service` file from the repository to your system's service directory (`/etc/systemd/system/start_customrp.service`).




Enable The Service:
```shell
systemctl enable start_customrp.service
```



[Jump to Top](#top)



# 7. Additional Information

Here is some information that is not specific to any particular topic but is still important to mention.

**Health Check**


Health checks may display warnings and errors.


These often relate to tools I currently don't utilize, so installing every suggested fix might introduce unnecessary bloat.


However, if you actively use a tool like Python, it's advisable to address the health check hints for optimal performance and security.


To use `groovyls`, which requires Java 11 or later, I installed the necessary Java Development Kit (JDK) using the following command:
```shell
apt install openjdk-17-jdk
```



**Issues With Groovy**


Please note that installing `groovyls` and its Java dependency is optional and based on my personal preference.


If you don't require `Groovy`, you can safely remove them without affecting the overall system functionality.



**LSP Log Errors**


The `/root/.local/state/nvim/lsp.log` file may contain error messages related to language servers.


For instance, if you encounter issues with the Bash, TypeScript, Tailwind CSS, or VS Code JSON language servers, you can install or reinstall them within Neovim.


Press `esc` to enter normal mode, then type `:MasonInstall bash-language-server typescript-language-server tailwindcss-language-server vscode-json-language-server` and press Enter.



**Installation Issues**


Treesitter may face issues during installation because it attempts to install immediately on startup.


To resolve this manually, open NeoVim and run `:TSInstall`.


The problem seems related to loading a specific specification.



**Menu Select**


To select a different launch menu, press `CRTL` + `l` while in the shell.



**Buffers**
It's important to note that when you edit a file from the outside (e.g., git update) and have a buffer open, it won't be updated in the buffer.


So, if you save the open buffer, any changes made from the outside will be overwritten.



[Jump to Top](#top)



# 8. Contact Me

Johannes Bausch - [Portfolio](https://johannes-bausch.com) - [email protected]

Project Link: [https://github.com/johannesbausch/dotfiles](https://github.com/johannesbausch/dotfiles)



[Jump to Top](#top)



# 9. License

This project is licensed under the Unlicense License. See [License](https://github.com/johannesbausch/dotfiles/blob/main/LICENSE) for more details.



[Jump to Top](#top)



# 10. Credits

Credit where credit's due.

contrib.rocks image



[Jump to Top](#top)



[forks-shield]: https://img.shields.io/github/forks/johannesbausch/dotfiles.svg?style=for-the-badge
[forks-url]: https://github.com/johannesbausch/kickstarter-repository/network/members
[stars-shield]: https://img.shields.io/github/stars/johannesbausch/kickstarter-repository.svg?style=for-the-badge
[stars-url]: https://github.com/johannesbausch/kickstarter-repository/stargazers
[license-shield]: https://img.shields.io/github/license/johannesbausch/kickstarter-repository.svg?style=for-the-badge
[license-url]: https://github.com/johannesbausch/kickstarter-repository/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/johannesbausch