From 62582c94d7c4523e061ace48d7d0bdc8be3f3ccf Mon Sep 17 00:00:00 2001 From: juancwu <46619361+juancwu@users.noreply.github.com> Date: Sun, 18 Dec 2022 18:46:51 -0500 Subject: [PATCH] update(docs): docs are have more details and are separated into modules. --- readme.md => README.md | 26 ++++++++------ docs/fish.md | 12 +++++++ docs/linux.md | 82 ++++++++++-------------------------------- docs/macos.md | 77 ++++++++------------------------------- docs/nvim.md | 40 +++++++++++++++++++++ 5 files changed, 101 insertions(+), 136 deletions(-) rename readme.md => README.md (85%) create mode 100644 docs/fish.md create mode 100644 docs/nvim.md diff --git a/readme.md b/README.md similarity index 85% rename from readme.md rename to README.md index d74b014..e756cd3 100644 --- a/readme.md +++ b/README.md @@ -1,10 +1,10 @@ # Overview -These are my configuration files for my development environment using Fish (shell) and NeoVim. +One place to keep all my general configurations to setup my development environment on the terminal. -There are different branches for each OS. - -The configurations in this repository are highly inspired by and referenced from [craftzdog](https://github.com/craftzdog/dotfiles-public). +The configurations in this repository are highly inspired by and referenced from: +- [craftzdog](https://github.com/craftzdog/dotfiles-public) +- [ThePrimeagen](https://github.com/ThePrimeagen/init.lua) # Terminal Colourscheme @@ -46,20 +46,24 @@ The configurations in this repository are highly inspired by and referenced from - Cursor: #839496 - Cursor text: #073642 -# Instructions +# Instructions Based on OS + +These are set of instructions to setup the terminal (fish and neovim). - [Linux](docs/linux.md) - [Mac](docs/macos.md) -# 1Password Configuration SSH-Agent +# Other Setups + +## 1Password Configuration SSH-Agent Use 1Password SSH-Agent for SSH authentication and commit signing. -## Windows & WSL2 +### Windows & WSL2 We need to create a bridge with named pipes between Windows and WSL2 so that WSL2 can use 1Password SSH-Agent. -### Steps +#### Steps 1. Enable Windows Hello in Settings 2. Install [npiperelay.exe](https://1password.community/home/leaving?allowTrusted=1&target=https%3A%2F%2Fgithub.com%2Fjstarks%2Fnpiperelay) @@ -98,18 +102,18 @@ end 5. Restart terminal. 6. Test with `ssh-add -l`. This should output the 1Password SSH keys. -## MacOS +### MacOS MacOS setup is pretty straight forward. -### Steps +#### Steps 1. Open the settings page of 1Password. 2. Go to the `Developer`. 3. Turn on `Use the SSH agent` option. 4. Configure singed commits -## Configure Signed Commits +### Configure Signed Commits This will make each commit show as `verified` on GitHub. diff --git a/docs/fish.md b/docs/fish.md new file mode 100644 index 0000000..24525ec --- /dev/null +++ b/docs/fish.md @@ -0,0 +1,12 @@ +# Fish Shell Customization + +This section defines a list of plugins used to customize fish. + +- [Tide](https://github.com/IlanCosman/tide) - The ultimate Fish prompt. +- [Fisher](https://github.com/jorgebucaran/fisher) - Manage functions, completions, bindings, and snippets from the command line. +- [Exa](https://the.exa.website/) - New gen `ls`. +- [Z](https://github.com/jethrokuan/z) - tracks the directories you visit and jump between them. +- [Peco](https://github.com/peco/peco) - Filterting tool. +- [Llama](https://github.com/antonmedv/llama) - Terminal file manager. +- [ghq](https://github.com/x-motemen/ghq) - Manage remote repository clones. + diff --git a/docs/linux.md b/docs/linux.md index cf2b2d6..c4c1a19 100644 --- a/docs/linux.md +++ b/docs/linux.md @@ -1,4 +1,4 @@ -# Setup +# Linux Setup Follow the steps below to configure the dotfiles on Ubuntu. @@ -22,6 +22,8 @@ Verify fish has been installed. which fish ``` +Here is the list of [Fish customizations](/fish.md). + #### Make fish the default shell ```bash @@ -42,75 +44,29 @@ If not, visit [https://minbrowser.org/](https://minbrowser.org/). ### 3. Install Neovim -Neovim is an extension of vim that supports Lua scripting for configurations and plugins. +Install `v0.9.0` for all the plugins to work. The debian package can be download with this link: (This is not a stable release but the latest `v0.8.1` is showing problems with treesitter) -```fish -sudo apt install neovim +- https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.deb + +After downloading the package, use the command below to install: + +```bash +sudo apt install ./nvim-linux64.deb ``` -After installing neovim, we want to install all the language servers needed and formatters before installing plugins to avoid any problems. +> Note: This installation assumes that you are using Ubuntu. --- -#### Language Servers +#### Install Plugin Manager For Neovim -For information on specific configuration head to [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md) +We are using [packer](https://github.com/wbthomason/packer.nvim) as the plugin manager. -**Typescript**: [https://github.com/typescript-language-server/typescript-language-server](https://github.com/typescript-language-server/typescript-language-server) +Copy the code below to install: -**Golang**: [https://github.com/golang/tools/tree/master/gopls](https://github.com/golang/tools/tree/master/gopls) +```bash +git clone --depth 1 https://github.com/wbthomason/packer.nvim\ + ~/.local/share/nvim/site/pack/packer/start/packer.nvim +``` -**Clangd**: [https://clangd.llvm.org/installation.html](https://clangd.llvm.org/installation.html) - -**Pyright**: [https://github.com/microsoft/pyright](https://github.com/microsoft/pyright) - -**Tailwindcss**: [https://github.com/tailwindlabs/tailwindcss-intellisense](https://github.com/tailwindlabs/tailwindcss-intellisense) - ---- - -#### Formatter - ---- - -**Prettierd**: [https://github.com/fsouza/prettierd](https://github.com/fsouza/prettierd) - ---- - -#### Neovim plugins - -- [wbthomason/packer.nvim](https://github.com/wbthomason/packer.nvim) - Plugin Manager for Neovim >= 5.0 -- [nvim-lualine/lualine.nvim](https://github.com/nvim-lualine/lualine.nvim) - A blazing fast and easy to configure Neovim statusline written in Lua. -- [tjdevries/colorbuddy.nvim](https://github.com/tjdevries/colorbuddy.nvim) - A colourscheme helper for Neovim. -- [svrana/neosolarized.nvim](https://github.com/svrana/neosolarized.nvim) - A truecolour, solarized dark colourscheme using. -- [neovim/nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) - Configurations for Neovim builtin LSP server. -- [onsails/lspkind-nvim](https://github.com/onsails/lspkind.nvim) - vscode-like pictograms. -- [hrsh7th/nvim-cmp](https://github.com/hrsh7th/nvim-cmp) - A completion engine plugin for neovim written in Lua. - - [hrsh7th/cmp-buffer](https://github.com/hrsh7th/cmp-buffer) - nvim-cmp source for buffer words. - - hrsh7th/cmp-nvim-lsp - No link for this one, but it is needed -- [L3MON4D3/LuaSnip](https://github.com/L3MON4D3/LuaSnip) - Snippets for the LSP popups. -- [nvim-treesitter/nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) - Neovim treesitter for incremental syntax highlighting. -- [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs) - A super powerful autopair plugin for Neovim that supports multiple characters. -- [windwp/nvim-ts-autotag](https://github.com/windwp/nvim-ts-autotag) - Use treesitter to autoclose and autorename html tag. -- [nvim-telescope/telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) - telescope.nvim is a highly extendable fuzzy finder over lists. Built on the latest awesome features from neovim core. -- [nvim-telescope/telescope-file-browser](https://github.com/nvim-telescope/telescope-file-browser.nvim) - telescope-file-browser.nvim is a file browser extension for telescope.nvim. It supports sunchronized creation, deletion, renaming, and moving of files and folders powered by telescope.nvim and plenary.nvim. -- [nvim-tree/nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons) - A lua fork of vim-devicons. This plugin provides the same icons as well as colours for each icon. -- [iamcco/markdown-preview.nvim](https://github.com/iamcco/markdown-preview.nvim) - Markdown preview -- [akinsho/bufferline.nvim](https://github.com/akinsho/bufferline.nvim) - A snazzy buffer line. -- [norcalli/nvim-colorizer.lua](https://github.com/norcalli/nvim-colorizer.lua) - A high-performance colour highlighter for Neovim which has no external dependencies. -- [glepnir/lspsaga.nvim](https://github.com/glepnir/lspsaga.nvim) - A light-weight lsp plugin based on Neovim's builtin lsp with a highly performant UI. -- [ray-x/lsp_signature.nvim](https://github.com/ray-x/lsp_signature.nvim) - Show function signature when you type. -- [jose-elias-alvares/null-ls.nvim](https://github.com/ray-x/lsp_signature.nvim) - Use Neovim as a language server to inject LSP diagnostics, code actions, and more via Lua. -- [williamboman/mason.nvim](https://github.com/williamboman/mason.nvim) - Portable package manager for Neovim that runs everywhere Neovim runs. -- [williamboman/mason-lspconfig.nvim](https://github.com/williamboman/mason-lspconfig.nvim) - mason-lspconfig bridges mason.nvim with the lspconfig plugin. - -# Fish Shell Customization - -This section defines a list of plugins used to customize fish. - -- [Tide](https://github.com/IlanCosman/tide) - The ultimate Fish prompt. -- [Fisher](https://github.com/jorgebucaran/fisher) - Manage functions, completions, bindings, and snippets from the command line. -- [Exa](https://the.exa.website/) - New gen `ls`. -- [Z](https://github.com/jethrokuan/z) - tracks the directories you visit and jump between them. -- [Peco](https://github.com/peco/peco) - Filterting tool. -- [Llama](https://github.com/antonmedv/llama) - Terminal file manager. -- [ghq](https://github.com/x-motemen/ghq) - Manage remote repository clones. +Now it is time to [setup Neovim](/nvim.md). diff --git a/docs/macos.md b/docs/macos.md index 1dd855e..7e2bb18 100644 --- a/docs/macos.md +++ b/docs/macos.md @@ -1,4 +1,4 @@ -# Setup +# MacOS Setup Follow the steps below to configure the dotfiles on macOS. @@ -21,6 +21,9 @@ For more info: - [Fish](https://fishshell.com/) - fish is a smart and user-friendly command line shell for Linux, macOS, and the rest of the family. + +Here is a list of [Fish customizations](/fish.md). + #### Make fish the default shell ```bash @@ -67,69 +70,19 @@ Neovim is an extension of vim that supports Lua scripting for configurations and brew install neovim ``` -After installing neovim, we want to install all the language servers needed and formatters before installing plugins to avoid any problems. +After installing `neovim` check if the version is `>= 0.9.0`. +This is important because `treesitter` seems to be having problems with earlier versions. +As of now the stable version is `0.8.1` and it is causing problems. ---- -#### Language Servers +If the version is not `>= 0.9.0`, follow these steps to install a compatible version: -For information on specific configuration head to [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md) +1. Download [nvim-macos.tar.gz](https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz). +2. Run `xattr -c ./nvim-macos.tar.gz` (to avoid "unknown developer" warning) +3. Extract: `tar xzvf nvim-macos.tar.gz` +4. Run `./nvim-macos/bin/nvim` -**Typescript**: [https://github.com/typescript-language-server/typescript-language-server](https://github.com/typescript-language-server/typescript-language-server) +Let's create a symlink to the binary file: +`sudo ln -s /path/where/it/is/located/bin/nvim /usr/local/bin/nvim`. This will allow us to run `nvim` without moving the binary to `usr/local/bin`. -**Golang**: [https://github.com/golang/tools/tree/master/gopls](https://github.com/golang/tools/tree/master/gopls) - -**Clangd**: [https://clangd.llvm.org/installation.html](https://clangd.llvm.org/installation.html) - -**Pyright**: [https://github.com/microsoft/pyright](https://github.com/microsoft/pyright) - -**Tailwindcss**: [https://github.com/tailwindlabs/tailwindcss-intellisense](https://github.com/tailwindlabs/tailwindcss-intellisense) - ---- - -#### Formatter - ---- - -**Prettierd**: [https://github.com/fsouza/prettierd](https://github.com/fsouza/prettierd) - ---- - -#### Neovim plugins - -- [wbthomason/packer.nvim](https://github.com/wbthomason/packer.nvim) - Plugin Manager for Neovim >= 5.0 -- [nvim-lualine/lualine.nvim](https://github.com/nvim-lualine/lualine.nvim) - A blazing fast and easy to configure Neovim statusline written in Lua. -- [tjdevries/colorbuddy.nvim](https://github.com/tjdevries/colorbuddy.nvim) - A colourscheme helper for Neovim. -- [svrana/neosolarized.nvim](https://github.com/svrana/neosolarized.nvim) - A truecolour, solarized dark colourscheme using. -- [neovim/nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) - Configurations for Neovim builtin LSP server. -- [onsails/lspkind-nvim](https://github.com/onsails/lspkind.nvim) - vscode-like pictograms. -- [hrsh7th/nvim-cmp](https://github.com/hrsh7th/nvim-cmp) - A completion engine plugin for neovim written in Lua. - - [hrsh7th/cmp-buffer](https://github.com/hrsh7th/cmp-buffer) - nvim-cmp source for buffer words. - - hrsh7th/cmp-nvim-lsp - No link for this one, but it is needed -- [L3MON4D3/LuaSnip](https://github.com/L3MON4D3/LuaSnip) - Snippets for the LSP popups. -- [nvim-treesitter/nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) - Neovim treesitter for incremental syntax highlighting. -- [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs) - A super powerful autopair plugin for Neovim that supports multiple characters. -- [windwp/nvim-ts-autotag](https://github.com/windwp/nvim-ts-autotag) - Use treesitter to autoclose and autorename html tag. -- [nvim-telescope/telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) - telescope.nvim is a highly extendable fuzzy finder over lists. Built on the latest awesome features from neovim core. -- [nvim-telescope/telescope-file-browser](https://github.com/nvim-telescope/telescope-file-browser.nvim) - telescope-file-browser.nvim is a file browser extension for telescope.nvim. It supports sunchronized creation, deletion, renaming, and moving of files and folders powered by telescope.nvim and plenary.nvim. -- [nvim-tree/nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons) - A lua fork of vim-devicons. This plugin provides the same icons as well as colours for each icon. -- [iamcco/markdown-preview.nvim](https://github.com/iamcco/markdown-preview.nvim) - Markdown preview -- [akinsho/bufferline.nvim](https://github.com/akinsho/bufferline.nvim) - A snazzy buffer line. -- [norcalli/nvim-colorizer.lua](https://github.com/norcalli/nvim-colorizer.lua) - A high-performance colour highlighter for Neovim which has no external dependencies. -- [glepnir/lspsaga.nvim](https://github.com/glepnir/lspsaga.nvim) - A light-weight lsp plugin based on Neovim's builtin lsp with a highly performant UI. -- [ray-x/lsp_signature.nvim](https://github.com/ray-x/lsp_signature.nvim) - Show function signature when you type. -- [jose-elias-alvares/null-ls.nvim](https://github.com/ray-x/lsp_signature.nvim) - Use Neovim as a language server to inject LSP diagnostics, code actions, and more via Lua. -- [williamboman/mason.nvim](https://github.com/williamboman/mason.nvim) - Portable package manager for Neovim that runs everywhere Neovim runs. -- [williamboman/mason-lspconfig.nvim](https://github.com/williamboman/mason-lspconfig.nvim) - mason-lspconfig bridges mason.nvim with the lspconfig plugin. - -# Fish Shell Customization - -This section defines a list of plugins used to customize fish. - -- [Tide](https://github.com/IlanCosman/tide) - The ultimate Fish prompt. -- [Fisher](https://github.com/jorgebucaran/fisher) - Manage functions, completions, bindings, and snippets from the command line. -- [Exa](https://the.exa.website/) - New gen `ls`. -- [Z](https://github.com/jethrokuan/z) - tracks the directories you visit and jump between them. -- [Peco](https://github.com/peco/peco) - Filterting tool. -- [Llama](https://github.com/antonmedv/llama) - Terminal file manager. -- [ghq](https://github.com/x-motemen/ghq) - Manage remote repository clones. +Now it is time to [setup Neovim](/nvim.md). diff --git a/docs/nvim.md b/docs/nvim.md new file mode 100644 index 0000000..5a57d44 --- /dev/null +++ b/docs/nvim.md @@ -0,0 +1,40 @@ +# Setup Neovim + +> This section assumes you have cloned this repository. + +1. Create a symlink of the `nvim` folder: `ln -s /path/to/repository/nvim $HOME/.config/nvim`. +2. Replace `$HOME` with the full path to your home directory. +3. Open `packer.lua` that is inside `nvim/lua/juancwu`. +4. Run command `:so`, then run `:PackerSync` or `:PackerInstall`. + +Everything should be working. + +## Neovim plugins + +Here is a list of the plugins that I use: + +- [wbthomason/packer.nvim](https://github.com/wbthomason/packer.nvim) - Plugin Manager for Neovim >= 5.0 +- [VonHeikemen/lsp-zero](https://github.com/VonHeikemen/lsp-zero.nvim) - All in one, sweet, sweet LSP configurations. +- [nvim-lualine/lualine.nvim](https://github.com/nvim-lualine/lualine.nvim) - A blazing fast and easy to configure Neovim statusline written in Lua. +- [tjdevries/colorbuddy.nvim](https://github.com/tjdevries/colorbuddy.nvim) - A colourscheme helper for Neovim. +- [svrana/neosolarized.nvim](https://github.com/svrana/neosolarized.nvim) - A truecolour, solarized dark colourscheme using. +- [neovim/nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) - Configurations for Neovim builtin LSP server. +- [onsails/lspkind-nvim](https://github.com/onsails/lspkind.nvim) - vscode-like pictograms. +- [hrsh7th/nvim-cmp](https://github.com/hrsh7th/nvim-cmp) - A completion engine plugin for neovim written in Lua. + - [hrsh7th/cmp-buffer](https://github.com/hrsh7th/cmp-buffer) - nvim-cmp source for buffer words. + - hrsh7th/cmp-nvim-lsp - No link for this one, but it is needed +- [L3MON4D3/LuaSnip](https://github.com/L3MON4D3/LuaSnip) - Snippets for the LSP popups. +- [nvim-treesitter/nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) - Neovim treesitter for incremental syntax highlighting. +- [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs) - A super powerful autopair plugin for Neovim that supports multiple characters. +- [windwp/nvim-ts-autotag](https://github.com/windwp/nvim-ts-autotag) - Use treesitter to autoclose and autorename html tag. +- [nvim-telescope/telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) - telescope.nvim is a highly extendable fuzzy finder over lists. Built on the latest awesome features from neovim core. +- [nvim-telescope/telescope-file-browser](https://github.com/nvim-telescope/telescope-file-browser.nvim) - telescope-file-browser.nvim is a file browser extension for telescope.nvim. It supports sunchronized creation, deletion, renaming, and moving of files and folders powered by telescope.nvim and plenary.nvim. +- [nvim-tree/nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons) - A lua fork of vim-devicons. This plugin provides the same icons as well as colours for each icon. +- [iamcco/markdown-preview.nvim](https://github.com/iamcco/markdown-preview.nvim) - Markdown preview +- [akinsho/bufferline.nvim](https://github.com/akinsho/bufferline.nvim) - A snazzy buffer line. +- [norcalli/nvim-colorizer.lua](https://github.com/norcalli/nvim-colorizer.lua) - A high-performance colour highlighter for Neovim which has no external dependencies. +- [glepnir/lspsaga.nvim](https://github.com/glepnir/lspsaga.nvim) - A light-weight lsp plugin based on Neovim's builtin lsp with a highly performant UI. +- [ray-x/lsp_signature.nvim](https://github.com/ray-x/lsp_signature.nvim) - Show function signature when you type. +- [jose-elias-alvares/null-ls.nvim](https://github.com/ray-x/lsp_signature.nvim) - Use Neovim as a language server to inject LSP diagnostics, code actions, and more via Lua. +- [williamboman/mason.nvim](https://github.com/williamboman/mason.nvim) - Portable package manager for Neovim that runs everywhere Neovim runs. +- [williamboman/mason-lspconfig.nvim](https://github.com/williamboman/mason-lspconfig.nvim) - mason-lspconfig bridges mason.nvim with the lspconfig plugin.