aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md117
1 files changed, 117 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..8d41cec
--- /dev/null
+++ b/README.md
@@ -0,0 +1,117 @@
1# Overview
2### Features
3The main goal of this config is being robust and as lightweight as possible. Nothing fancy, just minimum setup for ide-like(ish) experience.
4
5### Installation
6
7Run checkhealth before cloning my setup
8
9:checkhealth
10
11Then clone this repo to your .config folder, open neovim and wait till installation is over.
12
13git clone https://codeberg.org/philw/nvim ~/.config
14
15After the installation it may require a restart so it can load colorscheme properly
16
17### Further development
18
19After many years, this is the only text editor on my system, so I'll be adding updates as long as I find something better(not gonna happen soon).
20
21### Documentation
22
23## Global Settings
24
25### Editor settings
26- nu = true: Show line numbers.
27- tabstop = 2: Set the width of a tab to 2 spaces.
28- softtabstop = 2: Number of spaces that a tab character counts for during editing.
29- shiftwidth = 2: Number of spaces to use for auto-indentation.
30- expandtab = true: Convert tabs to spaces.
31- smartindent = true: Automatically indent new lines based on the syntax.
32- ruler = false: Hide the ruler (status bar showing line and column position).
33- wrap = false: Disable line wrapping.
34- swapfile = false: Disable the creation of swap files.
35- hlsearch = false: Disable highlighting of search matches.
36- incsearch = true: Enable incremental search.
37- updatetime = 50: Set the update time for asynchronous operations like completions.
38- laststatus = 0: Hide the status line.
39- signcolumn = "number": Display line numbers in the sign column.
40- autoindent = true: Enable automatic indentation.
41- clipboard = "unnamedplus": Use the system clipboard for copy-pasting.
42- termguicolors = true: Enable 24-bit RGB color support in the terminal.
43- fillchars = "eob: ": Customize end-of-buffer character.
44- lazyredraw = false: Disable lazy redrawing for smoother experience.
45- timeoutlen = 500: Set timeout for key sequences to 500ms.
46- netrw_banner = 0: Disable Netrw banner.
47- netrw_liststyle = 3: Use a tree-style layout for Netrw.
48- netrw_altv = 0: Disable vertical splits for Netrw.
49- netrw_winsize = 25: Set Netrw window size.
50- netrw_browse_split = 4: Open Netrw in a horizontal split.
51- rustfmt_autosave = 1: Enable automatic formatting for Rust files using rustfmt.
52- mkdp_auto_start = 1: Automatically start Markdown Preview (for mkdp).
53- vimtex_view_method = "zathura": Set PDF viewer to zathura for LaTeX files.
54- vimtex_compiler_method = "latexmk": Use latexmk for compiling LaTeX files.
55- vimtex_quickfix_mode = 0: Disable quickfix window for VimTeX.
56- tex_conceal = "abdmg": Enable automatic concealment of LaTeX formatting.
57- tex_flavor = "latex": Set the flavor of TeX to LaTeX.
58- gitgutter_set_sign_backgrounds = 1: Enable background color for GitGutter signs.
59
60## Auto Commands and custom functions (api.nvim_create_autocmd)
61
62### Format on Save
63- Formats the buffer using vim.lsp.buf.format before saving any file.
64
65### Run Prettier and Compile LaTeX on Save
66- For JavaScript, TypeScript, CSS, HTML, YAML, Markdown, and JSON files, Prettier is run automatically after saving. Yes, I could use lsp features here but in my case this is the bulletproof setup.
67- For LaTeX files (*.tex), VimtexCompile is triggered upon saving to compile the document.(bugged af)
68
69You can add anything you want. Just make sure it's on your system.
70
71### Auto-delete Netrw Hidden Buffers
72- Automatically deletes hidden buffers when opening a Netrw window. This is quite helpful for the ToggleVExplorer function.
73
74### ToggleVExplorer
75- Toggles the VExplorer window in Neovim.
76- If the window is already open, it will be closed; if it is closed, it will be opened in the first window.
77
78## Plugin Management (require("lazy").setup)
79
80The configuration uses Lazy.nvim for plugin management. I've tried them all. This works the best for me.
81
82- airblade/vim-gitgutter: Displays Git changes in the gutter (added, modified, deleted lines).
83- lervag/vimtex: Provides LaTeX support, including features like auto-compiling and PDF viewing.
84- norcalli/nvim-colorizer.lua: Highlights color codes in files.
85- nvim-treesitter/nvim-treesitter: Provides better syntax highlighting and tree-sitter integration.
86- neovim/nvim-lspconfig: Set up language servers for autocompletion and LSP features.
87- ms-jpq/coq_nvim: Provides autocompletion with COQ (a Neovim completion plugin).
88- nvim-telescope/telescope.nvim: A fuzzy finder plugin for file searching and navigation.
89- windwp/nvim-autopairs: Automatically closes pairs of parentheses, brackets, etc.
90
91## LSP (Language Server Protocol) Configuration
92
93### Rust Configuration (rust_analyzer)
94- Configures rust_analyzer with specific settings:
95 - imports.granularity.group = "module": Organizes imports by module.
96 - cargo.buildScripts.enable = true: Enable build script support for Cargo.
97 - procMacro.enable = true: Enable procedural macro support.
98
99Each language server is set up using lspconfig, and the configuration is ensured with coq autocompletion.
100
101### Mason Setup
102- mason.nvim: Automatically installs LSP servers(currently just rust_analyzer) and other tools.
103
104## Key Mappings (keymap.set)
105
106- <leader>e: Toggle the VExplorer window.
107- <leader>z: Search and replace the word under the cursor in the entire buffer.
108- <leader>a: Select the entire buffer.
109- <leader>y: Replace the current line with cc (change the line).
110- <C-c>: Yank the current line to the clipboard.
111- <C-v>: Paste from the clipboard.
112- <C-z>: Undo the last change.
113- J and K: Speed up moving the selected text block down or up in visual mode.
114- <leader>f: Open Telescope's file finder.
115- <leader>g: Open Telescope's live grep search.
116- <leader>d: Go to definition (LSP feature).
117- <leader>k: Show hover information (LSP feature).