Home

Awesome

<h1 align="center">nvim-config</h1> <p align="center"> <b>Just another opinionated, visually appealing Neovim IDE.</b> <br /> <b>Configured for Windows, supports LaTeX, Python, Lua, C#, HTML, CSS, and Javascript.</b> <br /> <br /> <a href="https://github.com/neovim/neovim"> <img src="https://img.shields.io/badge/requires-neovim%200.8%2B-green?color=76946A&labelColor=16161D&style=for-the-badge&logo=neovim" /> </a> <a href="https://github.com/Neelfrost/dotfiles/blob/main/LICENSE" ><img alt="license" src="https://img.shields.io/github/license/Neelfrost/dotfiles?labelColor=151515&color=A270BA&style=for-the-badge" /></a> <a href="https://github.com/Neelfrost/dotfiles/stargazers" ><img alt="stars" src="https://img.shields.io/github/stars/Neelfrost/dotfiles?colorA=151515&colorB=6A9FB5&style=for-the-badge&logo=starship" /></a> <a href="https://github.com/Neelfrost/dotfiles/network/members" ><img alt="forks" src="https://img.shields.io/github/forks/Neelfrost/dotfiles?colorA=151515&colorB=788C4C&style=for-the-badge&logo=github" /></a> </p>

Table of Contents <!-- omit in toc -->

Screenshots 📷

start time file explorer file navigation latex latex python

Installation âš¡

The following instructions are for Windows (powershell). An admin prompt is required.

  1. Install chocolatey.

    Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
    
  2. Install main dependencies.

    choco install -y git.install --params "/GitAndUnixToolsOnPath /NoGitLfs /SChannel /NoShellIntegration";
    choco install -y neovim python SumatraPDF.install miktex.install;
    # Needed for various plugins
    choco install -y universal-ctags strawberryperl make SQLite ripgrep fd golang; refreshenv; exit
    
  3. Install python dependencies.

    pip install pynvim neovim-remote
    
  4. Clone the repository and open nvim-qt or nvim.

    For fresh installation:

    git clone https://github.com/Neelfrost/nvim-config.git "$HOME\Appdata\Local\nvim"; nvim-qt.exe
    

    For existing config:

    ren "$HOME\Appdata\Local\nvim" 'nvim-old'; git clone https://github.com/Neelfrost/nvim-config.git "$HOME\Appdata\Local\nvim"; nvim-qt.exe
    

LaTeX

Formatting (latexindent)

latexindent is now included with miktex, so downloading it separately is no longer necessary. Moreover, null-ls is pre-configured to run latexindent on save for tex files. Global formatting rules can be changed by:

  1. Creating $HOME/indentconfig.yaml:

    paths:
      - C:\Users\<username>\defaultSettings.yaml
    
  2. Creating $HOME/defaultSettings.yaml, followed by copying and overriding defaultSettings.

For further reading refer: docs.

Viewing PDF

To launch SumatraPDF using VimTeX (<kbd>\lv</kbd>), ensure SumatraPDF.exe is added to environment path.

Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name path -Value $((Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name path).path + ";" + "$HOME\AppData\Local\SumatraPDF" + ";"); refreshenv; exit

Inverse Search

For inverse search, open SumatraPDF then go to Settings -> Options and set inverse search command-line to:

cmd /c start /min nvim --headless -c "PackerLoad vimtex" -c "VimtexInverseSearch %l '%f'"

Use :checkhealth to check for errors if any.

Language Servers

Python (pyright)

  1. Install npm.

    choco install -y nodejs.install; refreshenv; exit
    
  2. Install pyright.

    npm install -g pyright
    
  3. Install black, isort, and flake for formatting and linting.

    pip install flake8 black isort
    
  4. Use :checkhealth to check for errors if any.

Lua (LuaLs)

  1. Install dependencies.

    choco install -y 7zip.install; refreshenv; exit
    
  2. cd into install directory. For example:

    cd C:\tools
    
  3. Install LuaLs.

    curl.exe -L $(curl.exe -s https://api.github.com/repos/LuaLS/lua-language-server/releases/latest | findstr.exe "win32-x64" | %{"$($_.Split('"')[3])"} | findstr.exe "github") -o luals.zip; 7z.exe x .\luals.zip -olua-language-server; rm luals.zip
    
  4. Add LuaLs to environment path.

    Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name path -Value $((Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name path).path + ";" + "C:\tools\lua-language-server\bin" + ";"); refreshenv; exit
    
  5. Install stylua for formatting.

    curl.exe -L $(curl.exe -s https://api.github.com/repos/JohnnyMorganz/StyLua/releases/latest | findstr.exe "win64.zip" | %{"$($_.Split('"')[3])"} | findstr.exe "github") -o stylua-win64.zip; 7z.exe x -oC:\tools\stylua .\stylua-win64.zip; rm .\stylua-win64.zip;
    # Add stylua to environment path:
    Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name path -Value $((Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name path).path + ";" + "C:\tools\stylua" + ";"); refreshenv; exit
    
  6. Use :checkhealth to check for errors if any.

C# (omnisharp)

  1. Install dotnet-sdk.

    choco install dotnet-sdk -y
    
  2. Install omnisharp-roslyn.

    curl.exe -L $(curl.exe -s https://api.github.com/repos/OmniSharp/omnisharp-roslyn/releases/latest | findstr.exe "omnisharp-win-x64-net6.0.zip" | %{"$($_.Split('"')[3])"} | findstr.exe "github") -o omnisharp-win-x64-net6.0.zip; 7z.exe x -oC:\tools\omnisharp .\omnisharp-win-x64-net6.0.zip; rm .\omnisharp-win-x64-net6.0.zip;
    
  3. Use :checkhealth to check for errors if any.

HTML, CSS, Javascript (vscode-langservers-extracted)

  1. Install dependencies.

    npm i -g vscode-langservers-extracted
    
  2. Install prettierd for formatting.

    npm i -g @fsouza/prettierd
    
  3. Use :checkhealth to check for errors if any.

Update 🚀

  1. Pull changes.

    cd "$HOME\Appdata\Local\nvim"; git pull
    
  2. Open nvim-qt or nvim and update plugins:

    :PackerSync
    

Features 📃

General

LaTeX

<details> <summary>Compile status on statusline</summary> <figure> <figurecaption>Compile not started</figurecaption> <img src="https://raw.githubusercontent.com/Neelfrost/github-assets/main/dotfiles/l1.webp" alt="Compile not started" /> <figurecaption>Compile running</figurecaption> <img src="https://raw.githubusercontent.com/Neelfrost/github-assets/main/dotfiles/l2.webp" alt="Compile running" /> <figurecaption>Compile success</figurecaption> <img src="https://raw.githubusercontent.com/Neelfrost/github-assets/main/dotfiles/l3.webp" alt="Compile success" /> <figurecaption>Compile failed</figurecaption> <img src="https://raw.githubusercontent.com/Neelfrost/github-assets/main/dotfiles/l4.webp" alt="Compile failed" /> </figure> </details>

Folder Structure

nvim
├── after
│   └── ftplugin         # filetype specific options, settings, mappings
├── lua                  # .lua config files
│   └── user
│       └── mappings.lua # keybinds
│       └── options.lua  # vim options
│       └── utils.lua    # utility functions
│       └── plugins
│           ├── config   # plugin config
│           └── init.lua # plugin definition file
├── ultisnips            # snippets
│   └── tex              # latex snippets
└── viml                 # .vim config files

Plugins

LSP

File navigation

Code completion

LaTeX

Looks

Buffer, Status

QOL

Mappings

ShortcutModeDescription
<kbd>F2</kbd>NormalReplace word under cursor
<kbd>F2</kbd>VisualRename selection
<kbd>F5</kbd>NormalOpen telescope.nvim module reloader
<kbd>F10</kbd>NormalToggle spellcheck
<kbd>F11</kbd>NormalToggle warp
<kbd>F12</kbd>NormalToggle paste mode
<kbd>\\t</kbd>NormalOpen windows terminal at cwd
<kbd>\\e</kbd>NormalOpen explorer at cwd
<kbd>\\c</kbd>NormalOpen current file in VSCode
<kbd>\\n</kbd>NormalOpen current file in notepad
<kbd>tf</kbd>NormalOpen telescope.nvim find files
<kbd>tr</kbd>NormalOpen telescope.nvim recent files
<kbd>ts</kbd>NormalOpen telescope.nvim session browser
<kbd>\q</kbd>NormalToggle quickfix
<kbd>\h</kbd>NormalDisable search highlight
<kbd>\v</kbd>Normal/InsertPaste from system clipboard in paste mode
<kbd>\w</kbd>NormalClose buffer (will discard changes if not saved)
<kbd>\u</kbd>NormalOpen URL under cursor in browser
<kbd>\s</kbd>NormalSearch word under cursor in browser
<kbd>\n</kbd>NormalOpen dashboard
<kbd>f</kbd>NormalSearch buffer using 1 chars
<kbd>S</kbd>NormalSearch buffer using 2 chars
<kbd>Tab</kbd>NormalMove to next buffer
<kbd>Shift Tab</kbd>NormalMove to previous buffer
<kbd>Tab</kbd>InsertExpand trigger or jump to next tab stop
<kbd>Shift Tab</kbd>InsertJump to previous tab stop
<kbd>Ctrl j(k)</kbd>CommandMove between completion items
<kbd>Ctrl j(k)</kbd>InsertMove between completion items
<kbd>Alt d</kbd>NormalDuplicate current line below
<kbd>Alt j(k)</kbd>Normal/VisualMove line (block) up or down
<kbd>Alt ]</kbd>NormalIncrease indent
<kbd>Alt [</kbd>NormalDecrease indent
<kbd>Ctrl /</kbd>Normal/Visual/InsertComment current (selected) line(s)
<kbd>Enter</kbd>InsertSelect completion item
<kbd>Ctrl Space</kbd>InsertForce completion menu to open
<kbd>Ctrl c</kbd>InsertForce completion menu to close
<kbd>Ctrl e</kbd>InsertSelect first completion item
<kbd>Ctrl t</kbd>InsertOpen omni-func completion
<kbd>Ctrl Backspace</kbd>InsertDelete previous word
<kbd>Ctrl Delete</kbd>InsertDelete next word
<kbd>Ctrl b</kbd>NormalToggle nvim-tree
<kbd>Ctrl f</kbd>NormalFormat document
<kbd>Ctrl h(jkl)</kbd>NormalMove to window to the left (down, up, right)
<kbd>Ctrl s</kbd>NormalSave current file
<kbd>Ctrl Shift s</kbd>NormalSave and reload module (current file)
<kbd>Ctrl v</kbd>InsertPaste from system clipboard
<kbd>Ctrl z</kbd>InsertCorrect preceding misspelt word
<kbd>Ctrl z</kbd>NormalCorrect misspelt word under cursor
<kbd>gD</kbd>NormalLSP: Goto function declaration
<kbd>gi</kbd>NormalLSP: Goto function implementation
<kbd>gh</kbd>NormalLSP: Preview documentation
<kbd>gd</kbd>NormalLSP: Preview function definition
<kbd>gs</kbd>NormalLSP: Preview signature help
<kbd>gr</kbd>NormalLSP: Rename instance
<kbd>gl</kbd>NormalLSP: Show line diagnostic
<kbd>gR</kbd>NormalLSP: Show references
<kbd>ga</kbd>NormalLSP: Trigger code action
<kbd>\li</kbd>NormalVimTeX: Info
<kbd>\lT</kbd>NormalVimTeX: TOC toggle
<kbd>\lq</kbd>NormalVimTeX: Log
<kbd>\lv</kbd>NormalVimTeX: View pdf
<kbd>\lr</kbd>NormalVimTeX: Reverse search
<kbd>\ll</kbd>NormalVimTeX: Compile
<kbd>\lk</kbd>NormalVimTeX: Stop
<kbd>\le</kbd>NormalVimTeX: Errors
<kbd>\lC</kbd>NormalVimTeX: Clean full
<kbd>\lx</kbd>NormalVimTeX: Reload
<kbd>\lX</kbd>NormalVimTeX: Reload state
<kbd>\t</kbd>NormalPython, Lua, C#: Run code in external terminal
<kbd>\r</kbd>NormalPython, Lua: Run code without terminal output
<kbd>\lt</kbd>NormalLua (LÖVE2D): Run game in external terminal
<kbd>\lr</kbd>NormalLua (LÖVE2D): Run game without terminal output

Todo ✔