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
Linux
orMac
as your operating system. -
Using
Wezterm
as 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 SHELL
as your default Shell.It is a user-friendly command-line shell.
-
Using
starship
as you 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
lazygit
orGitUI
for interacting with GIT it's is:Simple terminal UI for git commands,
Blazing π₯ fast terminal-UI for git written in rust π¦
It's my
GitUI
VIM Like
keybinding, you should put it in$HOME/.config/gitui/key_bindings.ron
-
Using
exa
as als
command in terminal:A modern replacement for βlsβ.
I personally set
ll
alias toexa --tree --level=2 -a --long --header --accessed
with this functions infish
shell:function ll --wraps=ls --wraps=exa --description 'List contents of directory using exa tree' exa --tree --level=2 -a --long --header --accessed --git $argv end
-
Using
zoxide
as acd
command in terminal:A smarter cd command. Supports all major shells.
-
Using
RipGrep
as a replacement forgrep
:ripgrep recursively searches directories for a regex pattern while respecting your gitignore
-
Using
Bat
as a replacement forcat
:A cat(1) clone with wings.
-
Using
fd
as a replacement forfind
:A simple, fast, and user-friendly alternative to 'find'
-
Install Rust
-
Install Node JS
-
Install Deno
-
Install Neovim
- please install the nightly version of Neovim and install LuaJit.
-
Install
Cascadia Code
,Hack Nerd
andAdobe Arabic
fonts -
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 NF
font available to all applications on your system.
- Manual Meslo font installation:
-
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
dprint
and set it to your$PATH
(Pluggable and configurable code formatting platform written in Rust.) -
It's my
dprint.json
file, you should put it in$HOME/.config/dotfiles/dprint/dprint.json
-
Install
stylua
and set it to your$PATH
(An opinionated Lua code formatter written in rust) -
It's my
stylua.toml
file, you should put it in$HOME/.config/dotfiles/stylua.toml
-
Install
prettier
globally:npm i -g prettier
(Sorry for using this poorly performing package, however, we need it just for a few filetypes)
-
-
Install LSPs
Deno
andRust
LSPs are installed and attached to the relevant buffer when you execute thenvim
command on your proper root project;-
For installing
tsserver
LSP just run:npm install -g typescript typescript-language-server
. You can read the rest of its doc here -
For installing
sumneko_lua
LSP 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/" .. system_name .. "/lua-language-server" (your system_name is macOS or Linux or Windows)
-
-
Copy or clone this repo to
.config/nvim
:git clone https://github.com/MiaadTeam/lesvim.git ~/.config/nvim
-
Install plugins :
-
:PackerInstall
-
:PackerCompile
Please quit and reopen Neovim and execute
:PackerUpdate
and:PackerCompile
again
-
-
After launching Neovim, install these
TreeSitter
lib with:TSInstall
::TSInstall comment css fish graphql javascript lua regex scss toml tsx vim http json
-
And any other you want
-
Tabs and Pane's creation deletion
command + shift + N
orsuper + shift + N
shortcut to create a new terminal window.command + shift + Z
orsuper + shift + Z
toggle full screen windows.command + t
orsuper + t
shortcut to create a new terminal tab.command + w
orsuper + w
shortcut 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 + x
orsuper + x
shortcut to close the current terminal pane.command + z
orsuper + z
shortcut to toggle the current terminal pane zoom.
-
Tabs navigation
command + ,
orsuper + ,
goes to the right available tab.command + m
orsuper + m
goes to the left available tab.command shift + T
orsuper + shift + T
show tabs navigator menu.
-
Pane navigation
command + ctrl + h
orsuper + ctrl + h
goes to the left available pane.command + ctrl + l
orsuper + ctrl + l
goes to the right available pane.command + ctrl + k
orsuper + ctrl + k
goes to the top available pane.command + ctrl + j
orsuper + ctrl + j
goes to the bottom available pane.command + shift + T
orsuper + shift + T
shows tab navigator options.
-
Pane cycles
command + ctrl + n
orsuper + ctrl + n
goes to the next available pane.command + ctrl + p
orsuper + ctrl + p
goes to the prev available pane.
-
Pane resizing
command + shift + H
orsuper + shift + H
increase right available pane to left.command + shift + L
orsuper + shift + L
increase left available pane to right.command + shift + K
orsuper + shift + K
increase the bottom available pane to the top.command + shift + J
orsuper + shift + J
increase the top available pane to the bottom.
-
Searching
command + shift + F
orsuper + shift + F
search for the string "hash" matches regardless of case.command + shift + space
orsuper + shift + space
go 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 quick glance by pressing
<number>j|k
. -
As mentioned in the setup section, we manage plugins with Packer.
A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
-
We used
tokyonight
as 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 wait for a few seconds,
which-key
shows you an awesome hint for continuing press-related keys. -
Leader Key:
The
leader
is often set tospace
key, so when you pressspace
and wait for a few secondwhich-key
show all grouped and singleton of its binding keys. The following section briefly introduces a few of them:leader + e
toggleNvim Tree
explorer and immediately find the current active buffer file in the tree.leader + /
comment just one line inNormal and Visual
mode.(commenting keybinding has been explained below)leader + c
close current active buffer.leader + w
manipulate splited buffers in current window.(create and modify slipt window explained below)leader + f
open Telescope and find any file fuzzy in cwd.leader + h
jump to any word with the help of HOP plugin (like sneak but much better)leader + q
quit nvimleader + t
show lsp action menuleader + r
format current buffer.leader + H
HTTP request thingsr
run the request under the cursor.p
preview the request cURL command.l
re-run the last request.
leader + s
searching sections:b
searching branch and checkout to it.c
searching color schema and set it.C
searching command and execute it.f
find file in this cwd.h
searching in all help.k
searching in all keymaps.M
finding in all MAN pages and open itp
searching all color schemes with previewR
searching in registersr
open recent files with telescopet
search text in all files in current cwdg
search and replace text with ripgrep in current cwdw
search and replace word under cursor with ripgrep in current cwdl
search and replace text in active with ripgrep
leader + b
buffer things:j
pick buffer by first characterf
find buffer in telescopew
wipe buffer except the current oner
close all buffer to rightl
close all buffer to leftd
sort all buffer by directoryn
sort all buffer by languaget
sort all buffer by tabs
leader + g
is for git stuff:b
checkout branch with telescopec
checkout commit with telescopeC
checkout commit for current file with telescopej
jump to the next hunkk
jump to the previous hunkl
show git blame of current lineo
open changed files in telescopep
preview hunkr
reset current hunkR
reset current buffers
stage current hunku
unstage hunk
leader + l
for lsp things:a
show code action for the word is under cursor if it availabled
show document diagnosticsf
for format document with attached lsp'si
show configured and attached lspsj
jump to next diagnostic in documentk
jump to previous diagnostic in documentq
select first actions in code actions (quick fixed)r
rename word with referenced with lsp (just like F2 in vscode)S
show workspace symbols with telescopes
show document symbols with telescopet
find document or project troublesw
show workspace diagnostics
leader + p
is for packer things:i
install package if new package availablec
compile packer and createplugin/packer_compiled.lua
files
sysnc packages with git reposu
update packagesr
clean unused packageS
packer status
leader + z
for spell stuff:p
an special command that fixed spell and jump to the next misspelled wordt
toggle spell checker to on and off
leader + m
for markdown toolsp
start/stop the live server for preview current markdown file in the default browsert
preview markdown directly in a modal window in the terminal
-
Insert MODE
keybinds:press
jk | kj
in either Insert or Visual mode to enter Normal mode (Can be changed in /lua/keymap/escape.lua)
- Press
gd
to jump to the definition word under the cursor. - Press
gi
to jump to the implementation word under the cursor. - Press
gr
to 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 + k
to show the signature of the word is available. - Press
[d
to jump to the next diagnostic of the opened buffers. - Press
]d
to jump to the previous diagnostic of the opened buffers.
- to setup
copilot
jus enter:Copilot setup
in the command line. everything should worked fine if you have 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 plugin have the uniq configuration, some of them just copied configuration from it's readme file, and some other we want's to add best config we can piece by piece in the future
-
packer
for manage plugins:A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
-
plenary
as dependencies for many plugins and Lua utils:plenary: full; complete; entire; absolute; unqualified. All the Lua functions I don't want to write twice.
-
popup
as a Popup tools :[WIP] An implementation of the Popup API from vim in Neovim. Hope to upstream when complete
-
windline
for the status line:Animation status line, floating window status line. Using lua + luv would make some wind.
-
Telescope
as a finder modal:Find, Filter, Preview, Pick. All Lua, all the time.
-
which-key.nvim
for 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-nvim
for Dashboard like things:a Lua powered greeter like vim-startify / dashboard-nvim
-
format.nvim
for formatting document:Neovim Lua plugin to format the current buffer with external executables
-
fugitive
as a git ui for vim:fugitive.vim: A Git wrapper so awesome, it should be illegal
-
nvim-cursorline
for the highlighted word:A plugin for neovim that highlights cursor words and lines
-
renamer
for search and rename a variable|method and etc:VS Code-like renaming UI for Neovim, written in Lua.
-
nvim-spectre
for search and with ripgrep:Find the enemy and replace them with dark power.
-
bracey
for HTTP live server:live edit HTML, CSS, and javascript in vim
-
markdown-preview
for preview markdown in browser:markdown preview plugin for (neo)vim
-
nvim-ts-autotag
for close and rename HTML tags:Use treesitter to auto-close and auto-rename HTML tag
-
vim-surround
for manage word inside parentheses/quotes/XML-tags etc :surround.vim: Delete/change/add parentheses/quotes/XML-tags/much more with ease
-
hop.nvim
for motion beetween words:Neovim motions on speed!
-
nvim-ts-rainbow
for 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
-
alpha-nvim
for greeter page:a lua powered greeter like vim-startify / dashboard-nvim
-
indent-blankline.nvim
for coloring indent blankline:Indent guides for Neovim
-
winshift.nvim
for managing Windows:Rearrange your windows with ease.
-
gitsigns.nvim
for git integration:Git integration for buffers
-
nvim-treesitter
Highlight, edit, and navigate code using a fast incremental parsing library:Nvim Treesitter configurations and abstraction layer
-
nvim-treesitter-textobjects
Additional textobjects for treesitter:Syntax aware text-objects, select, move, swap, and peek support.
-
nvim-treesitter-context
Show code context in the above:Lightweight alternative to context.vim implemented with nvim-treesitter.
-
nvim-lspconfig
Collection of configurations for built-in LSP client:Quickstart configurations for the Nvim LSP client
-
lspkind-nvim
Pictograms for built-in LSP client:vscode-like pictograms for neovim lsp completion items
-
lspsaga.nvim
a lsp plugin:A light-weight lsp plugin based on neovim built-in lsp with highly a performant UI.
-
trouble.nvim
a diagnostics tools:π¦ A pretty diagnostics, references, telescope results, quickfix and location list to help you solve all the trouble your code is causing.
-
nvim-cmp
Completion plugin :A completion plugin for neovim coded in Lua.
-
cmp-nvim-lsp
Completion plugin for LSP:nvim-cmp source for neovim builtin LSP client
-
cmp-buffer
Completion plugin for buffer:nvim-cmp source for buffer words
-
cmp-path
Completion plugin for PATH:nvim-cmp source for path
-
cmp-cmdline
Completion plugin for command-line:nvim-cmp source for vim's cmdline
-
nvim-snippy
for handling Snippets:Snippet plugin for Neovim
-
cmp-snippy
for handling nvim-snippy in nvim-cmp:nvim-snippy completion source for nvim-cmp.
-
registers.nvim
for handling vim registers:π Neovim plugin to preview the contents of the registers
-
nvim-autopairs
for handling autopairs:autopairs for neovim written by lua
-
nvim-toggleterm.lua
for managing multiple terminal:A neovim lua plugin to help easily manage multiple terminal windows
-
consolation.nvim
a built-in neovim terminal:A general-purpose terminal wrapper and management plugin for neovim, written in lua
-
nvim-code-action-menu
a better code action:Pop-up menu for code actions to show meta-information and diff preview
-
nvim-bufferline.lua
a buffer line to show nice data in buffer header:A snazzy π buffer line (with tabpage integration) for Neovim built using lua.
-
nvim-tree.lua
a tree like file explorer:A file explorer tree for neovim written in lua
-
project.nvim
a project management:ποΈ project.nvim is an all in one neovim plugin written in lua that provides superior project management.
-
filetype.nvim
speed up neovim startup:Easily speed up your neovim startup time!
-
twilight.nvim
dims 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.nvim
for format documents:A format runner for neovim, written in lua.
-
nvim-ts-context-commentstring
for correctly handling code commenting:Neovim treesitter plugin for setting the commentstring based on the cursor location in a file.
-
Comment.nvim
for code commenting:π§ πͺ // Smart and powerful comment plugin for neovim. Supports treesitter, dot repeat, left-right/up-down motions, hooks, and more
-
stabilize.nvim
for fixing little jump when a modal open/close from bottom or top:Neovim plugin to stabilize buffer content on window open/close events.
-
glow.nvim
for preview markdown directly in neovim:A markdown preview directly in your neovim.
-
rest.nvim
for sending http request:A fast Neovim http client written in Lua
-
nvim-hlslens
for better search highlights in buffer:nvim-hlslens helps you better glance at matched information, seamlessly jump between matched instances.
-
rust-tools.nvim
rust development utils:Extra rust tools for writing applications in neovim using the native lsp. This plugin adds extra functionality over rust analyzer.
-
crates.nvim
for getting information of cargo crates in toml files:A neovim plugin that helps managing crates.io dependencies
-
nvim-dap
a debugging tools:Debug Adapter Protocol client implementation for Neovim (>= 0.5)
-
nvim-colorizer.lua
a color highlighter:A high-performance color highlighter for Neovim which has no external dependencies! Written in performant Luajit.
-
yode-nvim
for focus on some part of code:Focus on the important parts of the code. Hide the rest, literally.
-
nvim_context_v
extra virtual text:Shows virtual text of the current context after functions, methods, statements, etc.
-
vim-yin-yang
low contrast theme:Yin-Yang is a black and white color scheme for Vim and is heavily inspired by preto and base16-grayscale.
-
better-escape.nvim
for better escape withjk
orkj
:Escape from insert mode without delay when typing
-
numb.nvim
for peek lines just when you intend :numb.nvim is a Neovim plugin that peeks lines of the buffer in non-obtrusive way.
-
copilot.vim
for 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!