LESVIM hosts custom Nvim configuration for all the platforms, focused on JavaScript, TypeScript, Rust and Lua
Β·
Report Bug
Β·
Request Feature
Table of Contents
- About The Project
- Getting Started
- Recommendation Read this section for having best experience in this development environment
- Prerequisites
- Installation
- Usage
- Plugins Read this section to increase your mastery of this development environment
- Show your support
We want to create an awesome Development Environment's so a big part of this document is not about Neovim, we briefly talk about the terminal emulator and prompt and other terminal tools, that make possible the whole Development Life live in Terminal.
-
We highly recommend using
LinuxorMacas your operating system. -
Please install the nightly build of
Neovim, You need at least version0.8. -
Using
Weztermas your default Terminal emulator.It is a GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
It's my
wezterm.lua, you should put it in$HOME/.config/wezterm/wezterm.lua: -
Using
Fish SHELLas your default Shell.It is a user-friendly command-line shell.
It's my
config.fish, you should put it in$HOME/.config/fish/config.fish: please note that you should be installezazoxideandstarshipto avoid throwing error forfunctionsandinitcommand in the config file -
Using
starshipas your default Shell prompt.It is the minimal, blazing-fast, and infinitely customizable prompt for any shell!
It's my
starship.toml, you should put it in$HOME/.config/starship.toml -
Using
lazygitorGitUIfor interacting with GIT it's is:Simple terminal UI for git commands,
Blazing π₯ fast terminal-UI for git written in rust π¦
It's my
GitUIVIM Likekeybinding, you should put it in$HOME/.config/gitui/key_bindings.ron -
Using
ezaas alscommand in the terminal:A modern replacement for βlsβ.
I personally set
llalias toeza --tree --level=2 -a --long --header --accessedwith this functions infishshell:function ll --wraps=ls --wraps=eza --description 'List contents of directory using eza tree' eza --tree --level=2 -a --long --header --accessed --git $argv end
-
Using
zoxideas acdcommand in terminal:A smarter cd command. Supports all major shells.
-
Using
RipGrepas a replacement forgrep:ripgrep recursively searches directories for a regex pattern while respecting your gitignore
-
Using
Batas a replacement forcat:A cat(1) clone with wings.
-
Using
fdas a replacement forfind:A simple, fast, and user-friendly alternative to 'find'
-
Using
gnu-sedsed (stream editor) is a non-interactive command-line text editor:sed is commonly used to filter text, i.e., it takes text input, performs some operation (or set of operations) on it, and outputs the modified text. sed is typically used for extracting part of a file using pattern matching or substituting multiple occurrences of a string within a file.
MacOs: you need run
brew install gnu-sed
you can read a little bit more about the above utils in this article if you want.
-
Install Rust
-
Install Node JS
-
Install Deno
-
Install Neovim
- please install the nightly version of Neovim and install LuaJit.
-
Install
Cascadia Code,Hack NerdandAdobe Arabicfonts -
Install Meslo Nerd Font patched
- Manual Meslo font installation:
- Download these four ttf files:
- Double-click on each file and click "Install". This will make
MesloLGS NFfont available to all applications on your system.
- Manual Meslo font installation:
-
If you decide to use the
luffywindlineconfig, installFira Code iCursive S12. -
Installing the Formatter
The major problem regarding the performance of IDE or IDE-Like is owing to the process of formatting documents. So we aim to speed up this process as much as possible.
We are trying to format documents with utils written in rust
RUST-
Install
dprintand set it to your$PATH(Pluggable and configurable code formatting platform written in Rust.) -
It's my
dprint.jsonfile, you should put it in$HOME/.config/dotfiles/dprint/dprint.json -
Install
styluaand set it to your$PATH(An opinionated Lua code formatter written in rust) -
It's my
stylua.tomlfile, you should put it in$HOME/.config/dotfiles/stylua.toml -
Install
prettierglobally:npm i -g prettier(Sorry for using this poorly performing package, however, we need it just for a few filetypes)
-
-
Install LSPs
DenoandRustLSPs are installed and attached to the relevant buffer when you execute thenvimcommand on your proper root project. if you want to usedenolspjust create adeno.jsonfile in the root of you project, and run thenvimcommand on the root working directory.-
For installing
tsserverLSP just run:npm install -g typescript typescript-language-server. You can read the rest of its doc here -
For installing
csslsLSP just run:npm i -g vscode-langservers-extracted. You can read the rest of its doc here -
For installing
emmet-lsLSP just run:npm install -g emmet-ls. You can read the rest of its doc here -
For installing
sumneko_luaLSP read this doc and this docbriefly i used this way for mac and linux:
- Install ninja
- Make sure you have C++17
- Execute these commands line by line in terminal
To be noticed your executables bin PATH of sumneko should be placed at
git clone https://github.com/sumneko/lua-language-server ~/.config/sumneko cd ~/.config/sumneko git submodule update --init --recursive cd 3rd/luamake ./compile/install.sh cd ../.. ./3rd/luamake/luamake rebuild~/.config/sumneko/bin/lua-language-server
-
-
Copy or clone this repo to
.config/nvim:git clone https://github.com/MiaadTeam/lesvim.git ~/.config/nvim -
Install plugins :
-
:Lazy install -
:Lazy checkPlease quit and reopen Neovim and execute
:Lazy updateand:Lazy syncagain
-
-
After launching Neovim, install these
TreeSitterlib with:TSInstall::TSInstall comment css fish graphql javascript typescript markdown lua regex scss toml tsx vim http json dockerfile -
And any other you want
-
Tabs and Pane's creation deletion
command + shift + Norsuper + shift + Nshortcut to create a new terminal window.command + ctrl + forsuper + ctrl + ftoggle full screen windows.command + shift + Lorsuper + shift + Lshow launcher.command + torsuper + tshortcut to create a new terminal tab.command + worsuper + wshortcut to close the current terminal tab.command + 'orsuper + 'shortcut to create a new vertical terminal split pane.command + /orsuper + /shortcut to create new horizontal terminal split pane.command + xorsuper + xshortcut to close the current terminal pane.command + zorsuper + zshortcut to toggle the current terminal pane zoom.
-
Tabs navigation
command + ,orsuper + ,goes to the right available tab.command + morsuper + mgoes to the left available tab.command shift + Torsuper + shift + Tshow tabs navigator menu.
-
Pane navigation
command + ctrl + horsuper + ctrl + hgoes to the left available pane.command + ctrl + lorsuper + ctrl + lgoes to the right available pane.command + ctrl + korsuper + ctrl + kgoes to the top available pane.command + ctrl + jorsuper + ctrl + jgoes to the bottom available pane.
-
Pane cycles
command + [orsuper + [goes to the next available pane.command + ]orsuper + ]goes to the prev available pane.
-
Pane resizing
command + shift + Horsuper + shift + Hincrease right available pane to left.command + shift + Lorsuper + shift + Lincrease left available pane to right.command + shift + Korsuper + shift + Kincrease the bottom available pane to the top.command + shift + Jorsuper + shift + Jincrease the top available pane to the bottom.
-
Searching
command + shift + Forsuper + shift + Fsearch for the string "hash" matches regardless of case.command + shift + spaceorsuper + shift + spacego to quick search tools.
You might have already noticed that all the shortcuts here begin with command or super key except the ctrl + tab which is switched between available tabs, so we try not to use command or super key in vim shortkey.
-
Core:
-
Relative Neovim number is set to true.
For instance, you can easily jump between lines with a glance by pressing
<number>j|k. -
As mentioned in the setup section, we manage plugins with Lazy.
A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
-
We used
tokyonightas a theme.π A clean, dark Neovim theme written in Lua, with support for LSP, treesitter, and lots of plugins. It includes additional themes for Kitty, Alacrity, iTerm, and Fish
-
-
Keybinding:
If you press any key which has something bound to it and waits for a few seconds,
which-keyshows you an awesome hint for continuing press-related keys. -
Scrolling
- Smooth scrolling for window movement commands (mappings optional):
<C-u>,<C-d>,<C-b>,<C-f>,<C-y>,<C-e>,zt,zz,zb.
- Smooth scrolling for window movement commands (mappings optional):
-
Leader Key:
The
leaderis often set tospacekey, so when you pressspaceand wait for a few secondwhich-keyshow all grouped and singleton of its binding keys. The following section briefly introduces a few of them:leader + etoggleNvim Treeexplorer and immediately find the currently active buffer file in the tree.leader + /comment just one line inNormal and Visualmode. (commenting keybinding has been explained below)leader + cclose current active buffer.ctrl + wmanipulate splited buffers in the current window.(create and modify the slipt window explained below)leader + fopen Telescope and find any file fuzzy in CWD.leader + hjump to any word with the help of the HOP plugin (like sneak but much better)leader + qquit nvimleader + tshow lsp action menuleader + rformat and regex thingsfformat current bufferrdisplay regex pattern in popupsdisplay regex pattern in split window
leader + HHTTP request thingsrrun the request under the cursor.ppreview the request cURL command.lre-run the last request.
leader + ssearching sections:bsearching branch and checkout to it.csearching color schema and set it.Csearching command and execute it.ffind a file in this CWD.hsearching in all help.ksearching in all keymaps.Mfinding in all MAN pages and open itpsearching all color schemes with previewRsearching in registersropen recent files with the telescopetsearch text in all files in the current CWDgsearch and replace text with ripgrep in current CWDwsearch and replace word under the cursor with ripgrep in current CWDlsearch and replace text in active with ripgrep
leader + bbuffer things:jpick buffer by the first characterffind buffer in the telescopewwipe buffer except for the current onerclose all buffer to the rightlclose all buffer to leftdsort all buffer by directorynsort all buffer by languagetsort all buffer by tabs
leader + gis for git stuff:bcheckout branch with the telescopeccheckout commit with the telescopeCcheckout commit for the current file with the telescopejjump to the next hunkkjump to the previous hunklshow git blame of current lineoopen changed files in the telescopeppreview hunkrreset current hunkRreset the current buffersstage current hunkuunstage hunk
leader + lfor lsp things:ashow code action for the word is under the cursor if it is availabledshow document diagnosticsffor format document with attached LSPsishow configured and attached LSPsjjump to the next diagnostic in the documentkjump to the previous diagnostic in the documentqselect first actions in code actions (quick fixed)rrename word with referenced with LSP (just like F2 in vscode)Sshows workspace symbols with the telescopesshow document symbols with the telescopetfind document or project troubleswshow workspace diagnostics
leader + pis for Lazy Plugins :iinstall the package if a new package is availableccheck plugins for available updatesllog plugins last release notesrrestore plugins to prior commitspplugins profileddebugging pluginsssync packages with git reposuupdate packagesxclean unused packagehlazy plugin help
leader + zfor spell stuff:pa special command that fixed a spell and jumps to the next misspelled wordttoggle spell checker to on and off
leader + mfor markdown toolspstart/stop the live server to preview the current markdown file in the default browsertpreview markdown directly in a modal window in the terminal
-
Insert MODEkeybinds:press
jk | kjin either Insert or Visual mode to enter Normal mode (Can be changed in /lua/keymap/escape.lua)
- Press
gdto jump to the definition word under the cursor. - Press
gito jump to the implementation word under the cursor. - Press
grto show where this word is referenced and used. - Press
K(CAPITAL K orshift + k) to show declarations of the word under the cursor. - Press
ctrl + kto show the signature of the word is available. - Press
[dto jump to the next diagnostic of the opened buffers. - Press
]dto jump to the previous diagnostic of the opened buffers.
- to setup
copilotjust enter: Copilot setupin the command line. everything should work fine if you have an invite to GitHub Copilot project. - to accept it suggest just press
<C-j>orctrl + j.
We tried to use Lua plugins as much as possible
Some of the plugins have a unique configuration, some of them just copied configuration from its readme file, and some others we want's to add the best config we can piece by piece in the future
-
lazyfor manage plugins:π€ A modern plugin manager for Neovim
-
plenaryas dependencies for many plugins and Lua utils:plenary: full; complete; entire; absolute; unqualified. All the Lua functions I don't want to write twice.
-
popupas a Popup tools :[WIP] An implementation of the Popup API from vim in Neovim. Hope to upstream when complete
-
windlinefor the status line:Animation status line, floating window status line. Using lua + luv would make some wind.
-
Telescopeas a finder modal:Find, Filter, Preview, Pick. All Lua, all the time.
-
which-key.nvimfor amazing keybinding:π₯ Create key bindings that stick. WhichKey is a Lua plugin for Neovim 0.5 that displays a popup with possible keybindings of the command you started typing.
-
alpha-nvimfor Dashboard like things:a Lua powered greeter like vim-startify / dashboard-nvim
-
format.nvimfor formatting document:Neovim Lua plugin to format the current buffer with external executables
-
fugitiveas a git ui for vim:fugitive.vim: A Git wrapper so awesome, it should be illegal
-
nvim-cursorlinefor the highlighted word:A plugin for neovim that highlights cursor words and lines
-
renamerfor search and rename a variable|method and etc:VS Code-like renaming UI for Neovim, written in Lua.
-
nvim-spectrefor search and with ripgrep:Find the enemy and replace them with dark power.
-
braceyfor HTTP live server:live edit HTML, CSS, and javascript in vim
-
markdown-previewfor preview markdown in browser:markdown preview plugin for (neo)vim
-
nvim-ts-autotagfor close and rename HTML tags:Use treesitter to auto-close and auto-rename HTML tag
-
vim-surroundfor manage word inside parentheses/quotes/XML-tags etc :surround.vim: Delete/change/add parentheses/quotes/XML-tags/much more with ease
-
hop.nvimfor motion beetween words:Neovim motions on speed!
-
nvim-ts-rainbowfor coloring matches parentheses/braces and etc in variety of rainbow color:Rainbow parentheses for neovim using tree-sitter. Also at https://sr.ht/~p00f/nvim-ts-rainbow
-
indent-blankline.nvimfor coloring indent blankline:Indent guides for Neovim
-
winshift.nvimfor managing Windows:Rearrange your windows with ease.
-
gitsigns.nvimfor git integration:Git integration for buffers
-
nvim-treesitterHighlight, edit, and navigate code using a fast incremental parsing library:Nvim Treesitter configurations and abstraction layer
-
nvim-treesitter-textobjectsAdditional textobjects for treesitter:Syntax aware text-objects, select, move, swap, and peek support.
-
nvim-treesitter-contextShow code context in the above:Lightweight alternative to context.vim implemented with nvim-treesitter.
-
nvim-lspconfigCollection of configurations for built-in LSP client:Quickstart configurations for the Nvim LSP client
-
lspkind-nvimPictograms for built-in LSP client:vscode-like pictograms for neovim LSP completion items
-
lspsaga.nvima lsp plugin:A light-weight LSP plugin based on neovim built-in LSP with highly a performant UI.
-
trouble.nvima diagnostics tools:π¦ A pretty diagnostics, references, telescope results, quick-fix and location list to help you solve all the trouble your code is causing.
-
nvim-cmpCompletion plugin :A completion plugin for neovim coded in Lua.
-
cmp-nvim-lspCompletion plugin for LSP:nvim-cmp source for neovim builtin LSP client
-
cmp-bufferCompletion plugin for buffer:nvim-cmp source for buffer words
-
cmp-pathCompletion plugin for PATH:nvim-cmp source for path
-
cmp-cmdlineCompletion plugin for command-line:nvim-cmp source for vim's cmdline
-
nvim-snippyfor handling Snippets:Snippet plugin for Neovim
-
cmp-snippyfor handling nvim-snippy in nvim-cmp:nvim-snippy completion source for nvim-cmp.
-
registers.nvimfor handling vim registers:π Neovim plugin to preview the contents of the registers
-
nvim-autopairsfor handling autopairs:autopairs for neovim written by lua
-
nvim-toggleterm.luafor managing multiple terminal:A neovim lua plugin to help easily manage multiple terminal windows
-
consolation.nvima built-in neovim terminal:A general-purpose terminal wrapper and management plugin for neovim, written in lua
-
nvim-code-action-menua better code action:Pop-up menu for code actions to show meta-information and diff preview
-
nvim-bufferline.luaa buffer line to show nice data in the buffer header:A snazzy π buffer line (with tabpage integration) for Neovim built using lua.
-
nvim-tree.luaa tree like file explorer:A file explorer tree for neovim written in Lua
-
project.nvima project management:ποΈ project.nvim is an all-in-one neovim plugin written in Lua that provides superior project management.
-
filetype.nvimspeed up neovim startup:Easily speed up your neovim startup time!
-
twilight.nvimdims inactive portions of the code you're editing:π Twilight is a Lua plugin for Neovim 0.5 that dims inactive portions of the code you're editing using TreeSitter.
-
formatter.nvimfor format documents:A format runner for neovim, written in Lua.
-
nvim-ts-context-commentstringfor correctly handling code commenting:Neovim treesitter plugin for setting the commentstring based on the cursor location in a file.
-
Comment.nvimfor code commenting:π§ πͺ // Smart and powerful comment plugin for neovim. Supports treesitter, dot repeat, left-right/up-down motions, hooks, and more
-
stabilize.nvimfor fixing a little jump when a modal open/close from the bottom or top:Neovim plugin to stabilize buffer content on window open/close events.
-
glow.nvimfor preview markdown directly in neovim:A markdown preview directly in your neovim.
-
rest.nvimfor sending http request:A fast Neovim HTTP client written in Lua
-
nvim-hlslensfor better search highlights in buffer:nvim-hlslens helps you better glance at matched information, and seamlessly jump between matched instances.
-
rust-tools.nvimrust development utils:Extra rust tools for writing applications in neovim using the native LSP. This plugin adds extra functionality to rust analyzer.
-
crates.nvimfor getting information on cargo crates in toml files:A neovim plugin that helps manage crates.io dependencies
-
nvim-dapa debugging tools:Debug Adapter Protocol client implementation for Neovim (>= 0.5)
-
nvim-colorizer.luaa color highlighter:A high-performance color highlighter for Neovim which has no external dependencies! Written in performant Luajit.
-
nvim_context_vextra virtual text:Shows the virtual text of the current context after functions, methods, statements, etc.
-
vim-yin-yanglow contrast theme:Yin-Yang is a black and white color scheme for Vim and is heavily inspired by preto and base16-grayscale.
-
better-escape.nvimfor better escape withjkorkj:Escape from insert mode without delay when typing
-
numb.nvimfor peeking lines just when you intend :numb.nvim is a Neovim plugin that peeks lines of the buffer in a non-obtrusive way.
-
nvim-regexplainerfor display regex pattern :Describe the regexp under the cursor
-
folke/noice.nvimfor replaces the UI formessages,cmdlineand thepopupmenu:π₯ Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu.
-
cbochs/portal.nvimfor veiw jumplist in modal :Look at you, sailing through the [jumplist] majestically, like an eagle... piloting a blimp.
-
copilot.vimfor AI code suggestion :GitHub Copilot is an AI pair programmer which suggests line completions and entire function bodies as you type.
Give a βοΈ if this project helped you!


