This commit is contained in:
DACHXY 2024-12-12 10:57:27 +08:00
parent 3728ac496d
commit 53395d3971
81 changed files with 723 additions and 1543 deletions

View file

@ -1,5 +1,6 @@
$mainMod = SUPER
bind = $mainMod, T, exec, kitty
bind = $mainMod, Return, exec, kitty
bind = $mainMod, Q, killactive,
bind = $mainMod, M, exec, wlogout --protocol layer-shell
@ -48,8 +49,7 @@ bind = $mainMod SHIFT, h, movewindow, l
bind = $mainMod SHIFT, k, movewindow, u
bind = $mainMod SHIFT, j, movewindow, d
bind = $mainMod, b, exec, firefox
bind = $mainMod, c, exec, telegram-desktop
bind = $mainMod, f, exec, firefox
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow

View file

@ -5,7 +5,3 @@ exec-once = waybar & hyprpaper
exec-once = swayidle -w
exec-once = nwg-look -a
exec-once = [workspace 2 silent] firefox
exec-once = [workspace 10 silent] telegram-desktop
exec-once = [workspace 10 silent] vesktop
exec-once = [workspace 3 silent] thunderbird
exec-once = [workspace 5 silent] steam

View file

@ -1,3 +1,3 @@
preload = ~/.config/wallpapers/wall.png
wallpaper = HDMI-A-1, ~/.config/wallpapers/wall.png
# wallpaper = HDMI-A-1, ~/.config/wallpapers/wall.png
splash = false

View file

@ -1,9 +1,8 @@
input {
kb_layout = us, ru, ge
kb_layout = us
kb_variant =
kb_model =
kb_options = grp:alt_shift_toggle, caps:swapescape
kb_rules =
follow_mouse = 1

10
home/config/nvim/.gitignore vendored Normal file
View file

@ -0,0 +1,10 @@
tt.*
.tests
doc/tags
debug
.repro
foo.*
*.log
data
lazy-lock.json
lazyvim.json

View file

@ -0,0 +1,15 @@
{
"neodev": {
"library": {
"enabled": true,
"plugins": true
}
},
"neoconf": {
"plugins": {
"lua_ls": {
"enabled": true
}
}
}
}

View file

@ -0,0 +1,3 @@
{
"stylelint.enable": false
}

View file

@ -1,2 +1,2 @@
require("gpskwlkr.core")
require("gpskwlkr.lazy")
-- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy")

View file

@ -1,41 +0,0 @@
{
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"LuaSnip": { "branch": "master", "commit": "2463d687fe704b76eb0aa3bb34e95f69a5bb0362" },
"bufferline.nvim": { "branch": "main", "commit": "6c456b888823d9e4832aa91c482bccd19445c009" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"conform.nvim": { "branch": "master", "commit": "ad2b5ecd907128ed1b66b1cf4bed57902ef836ee" },
"dressing.nvim": { "branch": "master", "commit": "94b0d24483d56f3777ee0c8dc51675f21709318c" },
"friendly-snippets": { "branch": "main", "commit": "53d3df271d031c405255e99410628c26a8f0d2b0" },
"gitsigns.nvim": { "branch": "main", "commit": "d195f0c35ced5174d3ecce1c4c8ebb3b5bc23fa9" },
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
"lspkind.nvim": { "branch": "master", "commit": "7f26cf5e27e2bd910ce0ea00c514da2bf97423b8" },
"lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "56e435e09f8729af2d41973e81a0db440f8fe9c9" },
"mason-null-ls.nvim": { "branch": "main", "commit": "d1f7258f80867f718d643d88eee66959671a4bef" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "8b70e7f1e0a4119c1234c3bde4a01c241cabcc74" },
"mason.nvim": { "branch": "main", "commit": "a09da6ac634926a299dd439da08bdb547a8ca011" },
"move.nvim": { "branch": "main", "commit": "d663b74b4e38f257aae757541c9076b8047844d6" },
"none-ls.nvim": { "branch": "main", "commit": "e7382de51b4cf629e56f1fa18192e716e5ba8145" },
"nvim-autopairs": { "branch": "master", "commit": "9fd41181693dd4106b3e414a822bb6569924de81" },
"nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" },
"nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
"nvim-lint": { "branch": "master", "commit": "3ffa176628fe49e74f47992757016b7371a9b86b" },
"nvim-lsp-file-operations": { "branch": "master", "commit": "8e7223e138590c1bd9d86d3de810e65939d8b12f" },
"nvim-lspconfig": { "branch": "master", "commit": "0d9e870d01894c592d7ea93cfe0fa451916d9a7f" },
"nvim-surround": { "branch": "main", "commit": "703ec63aa798e5e07d309b35e42def34bebe0174" },
"nvim-tree.lua": { "branch": "master", "commit": "50f30bcd8c62ac4a83d133d738f268279f2c2ce2" },
"nvim-treesitter": { "branch": "master", "commit": "362ebd3a210f20aab80be05557f216cbaf4531e6" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "0e2d5bd4cbe75849a013901555d436a48c6680cb" },
"nvim-ts-autotag": { "branch": "main", "commit": "8515e48a277a2f4947d91004d9aa92c29fdc5e18" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1277b4a1f451b0f18c0790e1a7f12e1e5fdebfee" },
"nvim-web-devicons": { "branch": "master", "commit": "808627b8d412b2a6b6fc6eed816fec3557198b01" },
"plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
"telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
"vim-ReplaceWithRegister": { "branch": "master", "commit": "aad1e8fa31cb4722f20fe40679caa56e25120032" },
"vim-nightfly-guicolors": { "branch": "master", "commit": "90d85c8a094266122fb1fd173e7bcc0cd0efdd49" },
"vim-tmux-navigator": { "branch": "master", "commit": "38b1d0402c4600543281dc85b3f51884205674b6" }
}

View file

@ -0,0 +1,15 @@
-- Autocmds are automatically loaded on the VeryLazy event
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
-- Add any additional autocmds here
vim.api.nvim_create_autocmd("VimEnter", {
desc = "Auto select virtualenv Nvim open",
pattern = "*.py",
callback = function()
local venv = vim.fn.findfile("pyproject.toml", vim.fn.getcwd() .. ";")
if venv ~= "" then
require("venv-selector").retrieve_from_cache()
end
end,
once = true,
})

View file

@ -0,0 +1,3 @@
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here

View file

@ -0,0 +1,77 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
-- bootstrap lazy.nvim
-- stylua: ignore
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
require("lazy").setup({
spec = {
-- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- import any extras modules here
{ import = "lazyvim.plugins.extras.coding.luasnip" },
{ import = "lazyvim.plugins.extras.coding.mini-surround" },
{ import = "lazyvim.plugins.extras.coding.yanky" },
{ import = "lazyvim.plugins.extras.dap.core" },
{ import = "lazyvim.plugins.extras.dap.nlua" },
{ import = "lazyvim.plugins.extras.editor.dial" },
{ import = "lazyvim.plugins.extras.formatting.biome" },
{ import = "lazyvim.plugins.extras.formatting.black" },
{ import = "lazyvim.plugins.extras.formatting.prettier" },
{ import = "lazyvim.plugins.extras.lang.cmake" },
{ import = "lazyvim.plugins.extras.lang.docker" },
{ import = "lazyvim.plugins.extras.lang.git" },
{ import = "lazyvim.plugins.extras.lang.json" },
{ import = "lazyvim.plugins.extras.lang.markdown" },
{ import = "lazyvim.plugins.extras.lang.nushell" },
{ import = "lazyvim.plugins.extras.lang.omnisharp" },
{ import = "lazyvim.plugins.extras.lang.python" },
{ import = "lazyvim.plugins.extras.lang.rust" },
{ import = "lazyvim.plugins.extras.lang.tailwind" },
{ import = "lazyvim.plugins.extras.lang.toml" },
{ import = "lazyvim.plugins.extras.lang.yaml" },
{ import = "lazyvim.plugins.extras.linting.eslint" },
{ import = "lazyvim.plugins.extras.ui.alpha" },
{ import = "lazyvim.plugins.extras.ui.dashboard-nvim" },
{ import = "lazyvim.plugins.extras.ui.edgy" },
{ import = "lazyvim.plugins.extras.ui.mini-animate" },
{ import = "lazyvim.plugins.extras.ui.mini-indentscope" },
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
{ import = "lazyvim.plugins.extras.ui.smear-cursor" },
{ import = "lazyvim.plugins.extras.ui.treesitter-context" },
{ import = "lazyvim.plugins.extras.util.dot" },
{ import = "lazyvim.plugins.extras.util.mini-hipatterns" },
{ import = "lazyvim.plugins.extras.util.project" },
{ import = "lazyvim.plugins.extras.vscode" },
-- import/override with your plugins
{ import = "plugins" },
},
defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
lazy = false,
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- have outdated releases, which may break your Neovim install.
version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
},
install = { colorscheme = { "tokyonight", "habamax" } },
checker = { enabled = true }, -- automatically check for plugin updates
performance = {
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
-- "matchit",
-- "matchparen",
-- "netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})

View file

@ -0,0 +1,21 @@
-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here
function GetAvailableWindowsShell()
local shellList = { "nu", "pwsh-preview", "pwsh", "powershell", "cmd" }
local length = #shellList
for i = 1, length do
local commandToCheck = "where " .. shellList[i]
local exitCode = os.execute(commandToCheck)
if exitCode == 0 then
return shellList[i]
end
end
return shellList[length - 1]
end
if package.config:sub(1, 1) == "\\" then
vim.o.shell = GetAvailableWindowsShell()
end

View file

@ -1,2 +0,0 @@
require("gpskwlkr.core.options")
require("gpskwlkr.core.keymaps")

View file

@ -1,37 +0,0 @@
vim.g.mapleader = " "
local keymap = vim.keymap
keymap.set("n", "<leader>pv", vim.cmd.Ex)
keymap.set("n", "x", '"_x')
keymap.set("n", "<C-s>", ":w<CR>")
-- increment/decrement numbers
keymap.set("n", "<leader>+", "<C-a>") -- increment
keymap.set("n", "<leader>-", "<C-x>") -- decrement
-- window management
keymap.set("n", "<leader>sv", "<C-w>v") -- split window vertically
keymap.set("n", "<leader>sh", "<C-w>s") -- split window horizontally
keymap.set("n", "<leader>se", "<C-w>=") -- make split windows equal width & height
keymap.set("n", "<leader>sx", ":close<CR>") -- close current split window
keymap.set("n", "<leader>to", ":tabnew<CR>") -- open new tab
keymap.set("n", "<leader>tx", ":tabclose<CR>") -- close current tab
keymap.set("n", "<leader>tn", ":tabn<CR>") -- go to next tab
keymap.set("n", "<leader>tp", ":tabp<CR>") -- go to previous tab
keymap.set("n", "<leader>ff", ":Format<CR>") -- fix indentations in the current file
opts = { noremap = true, silent = true }
-- Normal-mode commands
vim.keymap.set("n", "<A-j>", ":MoveLine(1)<CR>", opts)
vim.keymap.set("n", "<A-k>", ":MoveLine(-1)<CR>", opts)
vim.keymap.set("n", "<A-h>", ":MoveHChar(-1)<CR>", opts)
vim.keymap.set("n", "<A-l>", ":MoveHChar(1)<CR>", opts)
-- Visual-mode commands
vim.keymap.set("v", "<A-j>", ":MoveBlock(1)<CR>", opts)
vim.keymap.set("v", "<A-k>", ":MoveBlock(-1)<CR>", opts)
vim.keymap.set("v", "<A-h>", ":MoveHBlock(-1)<CR>", opts)
vim.keymap.set("v", "<A-l>", ":MoveHBlock(1)<CR>", opts)

View file

@ -1,34 +0,0 @@
local opt = vim.opt
opt.nu = true
opt.relativenumber = true
opt.tabstop = 4
opt.softtabstop = 4
opt.shiftwidth = 4
opt.expandtab = true
opt.smartindent = true
opt.wrap = false
opt.hlsearch = false
opt.incsearch = true
opt.ignorecase = true
opt.smartcase = true
opt.termguicolors = true
opt.scrolloff = 8
opt.signcolumn = "yes"
opt.updatetime = 50
-- opt.colorcolumn = "80"
opt.cursorline = true
opt.clipboard:append("unnamedplus")
opt.backspace = "indent,eol,start"
opt.splitright = true
opt.splitbelow = true
opt.iskeyword:append("-")

View file

@ -1,25 +0,0 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({ { import = "gpskwlkr.plugins" }, { import = "gpskwlkr.plugins.lsp" } }, {
install = {
colorscheme = { "nightfly" },
},
checker = {
enabled = true,
notify = false,
},
change_detection = {
notify = false,
},
})

View file

@ -1,11 +0,0 @@
return {
"akinsho/bufferline.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
version = "*",
opts = {
options = {
mode = "tabs",
separator_style = "slant",
},
},
}

View file

@ -1,5 +0,0 @@
return {
"NvChad/nvim-colorizer.lua",
event = { "BufReadPre", "BufNewFile" },
config = true,
}

View file

@ -1,14 +0,0 @@
return {
{
"catppuccin/nvim",
priority = 1000, -- make sure to load this before all the other start plugins
config = function()
local catppuccin = require("catppuccin")
catppuccin.setup({
flavour = "macchiato"
})
-- load the colorscheme here
vim.cmd([[colorscheme catppuccin]])
end,
}
}

View file

@ -1,19 +0,0 @@
return {
"numToStr/Comment.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"JoosepAlviste/nvim-ts-context-commentstring",
},
config = function()
-- import comment plugin safely
local comment = require("Comment")
local ts_context_commentstring = require("ts_context_commentstring.integrations.comment_nvim")
-- enable comment
comment.setup({
-- for commenting tsx and jsx files
pre_hook = ts_context_commentstring.create_pre_hook(),
})
end,
}

View file

@ -1,4 +0,0 @@
return {
"stevearc/dressing.nvim",
event = "VeryLazy",
}

View file

@ -1,39 +0,0 @@
return {
"stevearc/conform.nvim",
lazy = true,
event = { "BufReadPre", "BufNewFile" }, -- to disable, comment this out
config = function()
local conform = require("conform")
conform.setup({
formatters_by_ft = {
javascript = { "prettier" },
typescript = { "prettier" },
javascriptreact = { "prettier" },
typescriptreact = { "prettier" },
svelte = { "prettier" },
css = { "prettier" },
html = { "prettier" },
json = { "prettier" },
yaml = { "prettier" },
markdown = { "prettier" },
graphql = { "prettier" },
lua = { "stylua" },
python = { "isort", "black" },
},
format_on_save = {
lsp_fallback = true,
async = false,
timeout_ms = 1000,
},
})
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
conform.format({
lsp_fallback = true,
async = false,
timeout_ms = 1000,
})
end, { desc = "Format file or range (in visual mode)" })
end,
}

View file

@ -1,5 +0,0 @@
return {
"lewis6991/gitsigns.nvim",
event = { "BufReadPre", "BufNewFile" },
config = true,
}

View file

@ -1,8 +0,0 @@
return {
"christoomey/vim-tmux-navigator",
"nvim-lua/plenary.nvim", -- lua functions that many plugins use
"christoomey/vim-tmux-navigator", -- tmux & split window navigation
"inkarkat/vim-ReplaceWithRegister",
"fedepujol/move.nvim",
"xiyaowong/transparent.nvim"
}

View file

@ -1,30 +0,0 @@
return {
"mfussenegger/nvim-lint",
lazy = true,
event = { "BufReadPre", "BufNewFile" }, -- to disable, comment this out
config = function()
local lint = require("lint")
lint.linters_by_ft = {
javascript = { "eslint_d" },
typescript = { "eslint_d" },
javascriptreact = { "eslint_d" },
typescriptreact = { "eslint_d" },
svelte = { "eslint_d" },
python = { "pylint" },
}
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
group = lint_augroup,
callback = function()
lint.try_lint()
end,
})
vim.keymap.set("n", "<leader>l", function()
lint.try_lint()
end, { desc = "Trigger linting for current file" })
end,
}

View file

@ -1,166 +0,0 @@
return {
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"hrsh7th/cmp-nvim-lsp",
{ "antosha417/nvim-lsp-file-operations", config = true },
},
config = function()
-- import lspconfig plugin
local lspconfig = require("lspconfig")
-- import cmp-nvim-lsp plugin
local cmp_nvim_lsp = require("cmp_nvim_lsp")
local keymap = vim.keymap -- for conciseness
local opts = { noremap = true, silent = true }
local on_attach = function(client, bufnr)
opts.buffer = bufnr
-- set keybinds
opts.desc = "Show LSP references"
keymap.set("n", "gR", "<cmd>Telescope lsp_references<CR>", opts) -- show definition, references
opts.desc = "Go to declaration"
keymap.set("n", "gD", vim.lsp.buf.declaration, opts) -- go to declaration
opts.desc = "Show LSP definitions"
keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts) -- show lsp definitions
opts.desc = "Show LSP implementations"
keymap.set("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts) -- show lsp implementations
opts.desc = "Show LSP type definitions"
keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts) -- show lsp type definitions
opts.desc = "See available code actions"
keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection
opts.desc = "Smart rename"
keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts) -- smart rename
opts.desc = "Show buffer diagnostics"
keymap.set("n", "<leader>D", "<cmd>Telescope diagnostics bufnr=0<CR>", opts) -- show diagnostics for file
opts.desc = "Show line diagnostics"
keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts) -- show diagnostics for line
opts.desc = "Go to previous diagnostic"
keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer
opts.desc = "Go to next diagnostic"
keymap.set("n", "]d", vim.diagnostic.goto_next, opts) -- jump to next diagnostic in buffer
opts.desc = "Show documentation for what is under cursor"
keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor
opts.desc = "Restart LSP"
keymap.set("n", "<leader>rs", ":LspRestart<CR>", opts) -- mapping to restart lsp if necessary
end
-- used to enable autocompletion (assign to every lsp server config)
local capabilities = cmp_nvim_lsp.default_capabilities()
-- Change the Diagnostic symbols in the sign column (gutter)
-- (not in youtube nvim video)
local signs = { Error = "", Warn = "", Hint = "󰠠 ", Info = "" }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
end
-- configure html server
lspconfig["html"].setup({
capabilities = capabilities,
on_attach = on_attach,
})
-- configure typescript server with plugin
lspconfig["tsserver"].setup({
capabilities = capabilities,
on_attach = on_attach,
})
-- configure css server
lspconfig["cssls"].setup({
capabilities = capabilities,
on_attach = on_attach,
})
-- configure tailwindcss server
lspconfig["tailwindcss"].setup({
capabilities = capabilities,
on_attach = on_attach,
})
-- configure svelte server
lspconfig["svelte"].setup({
capabilities = capabilities,
on_attach = function(client, bufnr)
on_attach(client, bufnr)
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = { "*.js", "*.ts" },
callback = function(ctx)
if client.name == "svelte" then
client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.file })
end
end,
})
end,
})
lspconfig["csharp_ls"].setup({
capabilities = capabilities,
on_attach = on_attach,
})
-- configure prisma orm server
lspconfig["prismals"].setup({
capabilities = capabilities,
on_attach = on_attach,
})
-- configure graphql language server
lspconfig["graphql"].setup({
capabilities = capabilities,
on_attach = on_attach,
filetypes = { "graphql", "gql", "svelte", "typescriptreact", "javascriptreact" },
})
-- configure emmet language server
lspconfig["emmet_ls"].setup({
capabilities = capabilities,
on_attach = on_attach,
filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" },
})
-- configure python server
lspconfig["pyright"].setup({
capabilities = capabilities,
on_attach = on_attach,
})
-- configure lua server (with special settings)
lspconfig["lua_ls"].setup({
capabilities = capabilities,
on_attach = on_attach,
settings = { -- custom settings for lua
Lua = {
-- make the language server recognize "vim" global
diagnostics = {
globals = { "vim" },
},
workspace = {
-- make language server aware of runtime files
library = {
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
[vim.fn.stdpath("config") .. "/lua"] = true,
},
},
},
},
})
end,
}

View file

@ -1,57 +0,0 @@
return {
"williamboman/mason.nvim",
dependencies = {
"williamboman/mason-lspconfig.nvim",
"WhoIsSethDaniel/mason-tool-installer.nvim",
},
config = function()
-- import mason
local mason = require("mason")
-- import mason-lspconfig
local mason_lspconfig = require("mason-lspconfig")
local mason_tool_installer = require("mason-tool-installer")
-- enable mason and configure icons
mason.setup({
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = "",
},
},
})
mason_lspconfig.setup({
-- list of servers for mason to install
ensure_installed = {
"tsserver",
"html",
"cssls",
"tailwindcss",
"svelte",
"lua_ls",
"graphql",
"emmet_ls",
"prismals",
"pyright",
"csharp_ls"
},
-- auto-install configured servers (with lspconfig)
automatic_installation = true, -- not the same as ensure_installed
})
mason_tool_installer.setup({
ensure_installed = {
"prettier", -- prettier formatter
"stylua", -- lua formatter
"isort", -- python formatter
"black", -- python formatter
"pylint", -- python linter
"eslint_d", -- js linter
},
})
end,
}

View file

@ -1,74 +0,0 @@
return {
"nvimtools/none-ls.nvim", -- configure formatters & linters
lazy = true,
-- event = { "BufReadPre", "BufNewFile" }, -- to enable uncomment this
dependencies = {
"jay-babu/mason-null-ls.nvim",
},
config = function()
local mason_null_ls = require("mason-null-ls")
local null_ls = require("null-ls")
local null_ls_utils = require("null-ls.utils")
mason_null_ls.setup({
ensure_installed = {
"prettier", -- prettier formatter
"stylua", -- lua formatter
"black", -- python formatter
"pylint", -- python linter
"eslint_d", -- js linter
},
})
-- for conciseness
local formatting = null_ls.builtins.formatting -- to setup formatters
local diagnostics = null_ls.builtins.diagnostics -- to setup linters
-- to setup format on save
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
-- configure null_ls
null_ls.setup({
-- add package.json as identifier for root (for typescript monorepos)
root_dir = null_ls_utils.root_pattern(".null-ls-root", "Makefile", ".git", "package.json"),
-- setup formatters & linters
sources = {
-- to disable file types use
-- "formatting.prettier.with({disabled_filetypes: {}})" (see null-ls docs)
formatting.prettier.with({
extra_filetypes = { "svelte" },
}), -- js/ts formatter
formatting.stylua, -- lua formatter
formatting.isort,
formatting.black,
diagnostics.pylint,
diagnostics.eslint_d.with({ -- js/ts linter
condition = function(utils)
return utils.root_has_file({ ".eslintrc.js", ".eslintrc.cjs" }) -- only enable if root has .eslintrc.js or .eslintrc.cjs
end,
}),
},
-- configure format on save
on_attach = function(current_client, bufnr)
if current_client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format({
filter = function(client)
-- only use null-ls for formatting instead of lsp server
return client.name == "null-ls"
end,
bufnr = bufnr,
})
end,
})
end
end,
})
end,
}

View file

@ -1,18 +0,0 @@
return {
{
"simrat39/rust-tools.nvim",
config = function()
local rt = require("rust-tools")
rt.setup({
server = {
on_attach = function(_, bufnr)
-- Hover actions
vim.keymap.set("n", "<C-space>", rt.hover_actions.hover_actions, { buffer = bufnr })
-- Code action groups
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
end
},
})
end,
}
}

View file

@ -1,71 +0,0 @@
return {
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
local lualine = require("lualine")
local lazy_status = require("lazy.status") -- to configure lazy pending updates count
local colors = {
blue = "#65D1FF",
green = "#3EFFDC",
violet = "#FF61EF",
yellow = "#FFDA7B",
red = "#FF4A4A",
fg = "#c3ccdc",
bg = "#112638",
inactive_bg = "#2c3043",
}
local my_lualine_theme = {
normal = {
a = { bg = colors.blue, fg = colors.bg, gui = "bold" },
b = { bg = colors.bg, fg = colors.fg },
c = { bg = colors.bg, fg = colors.fg },
},
insert = {
a = { bg = colors.green, fg = colors.bg, gui = "bold" },
b = { bg = colors.bg, fg = colors.fg },
c = { bg = colors.bg, fg = colors.fg },
},
visual = {
a = { bg = colors.violet, fg = colors.bg, gui = "bold" },
b = { bg = colors.bg, fg = colors.fg },
c = { bg = colors.bg, fg = colors.fg },
},
command = {
a = { bg = colors.yellow, fg = colors.bg, gui = "bold" },
b = { bg = colors.bg, fg = colors.fg },
c = { bg = colors.bg, fg = colors.fg },
},
replace = {
a = { bg = colors.red, fg = colors.bg, gui = "bold" },
b = { bg = colors.bg, fg = colors.fg },
c = { bg = colors.bg, fg = colors.fg },
},
inactive = {
a = { bg = colors.inactive_bg, fg = colors.semilightgray, gui = "bold" },
b = { bg = colors.inactive_bg, fg = colors.semilightgray },
c = { bg = colors.inactive_bg, fg = colors.semilightgray },
},
}
-- configure lualine with modified theme
lualine.setup({
options = {
theme = my_lualine_theme,
},
sections = {
lualine_x = {
{
lazy_status.updates,
cond = lazy_status.has_updates,
color = { fg = "#ff9e64" },
},
{ "encoding" },
{ "fileformat" },
{ "filetype" },
},
},
})
end,
}

View file

@ -1,30 +0,0 @@
return {
"windwp/nvim-autopairs",
event = { "InsertEnter" },
dependencies = {
"hrsh7th/nvim-cmp",
},
config = function()
-- import nvim-autopairs
local autopairs = require("nvim-autopairs")
-- configure autopairs
autopairs.setup({
check_ts = true, -- enable treesitter
ts_config = {
lua = { "string" }, -- don't add pairs in lua string treesitter nodes
javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes
java = false, -- don't check treesitter on java
},
})
-- import nvim-autopairs completion functionality
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
-- import nvim-cmp plugin (completions plugin)
local cmp = require("cmp")
-- make autopairs and completion work together
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
end,
}

View file

@ -1,56 +0,0 @@
return {
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-buffer", -- source for text in buffer
"hrsh7th/cmp-path", -- source for file system paths
"L3MON4D3/LuaSnip", -- snippet engine
"saadparwaiz1/cmp_luasnip", -- for autocompletion
"rafamadriz/friendly-snippets", -- useful snippets
"onsails/lspkind.nvim", -- vs-code like pictograms
},
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
local lspkind = require("lspkind")
-- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
require("luasnip.loaders.from_vscode").lazy_load()
cmp.setup({
completion = {
completeopt = "menu,menuone,preview,noselect",
},
snippet = { -- configure how nvim-cmp interacts with snippet engine
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
["<C-e>"] = cmp.mapping.abort(), -- close completion window
["<CR>"] = cmp.mapping.confirm({ select = false }),
}),
-- sources for autocompletion
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" }, -- snippets
{ name = "buffer" }, -- text within current buffer
{ name = "path" }, -- file system paths
}),
-- configure lspkind for vs-code like pictograms in completion menu
formatting = {
format = lspkind.cmp_format({
maxwidth = 50,
ellipsis_char = "...",
}),
},
})
end,
}

View file

@ -1,6 +0,0 @@
return {
"kylechui/nvim-surround",
event = { "BufReadPre", "BufNewFile" },
version = "*", -- Use for stability; omit to use `main` branch for the latest features
config = true,
}

View file

@ -1,61 +0,0 @@
return {
"nvim-tree/nvim-tree.lua",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
local nvimtree = require("nvim-tree")
-- recommended settings from nvim-tree documentation
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- change color for arrows in tree to light blue
vim.cmd([[ highlight NvimTreeFolderArrowClosed guifg=#3FC5FF ]])
vim.cmd([[ highlight NvimTreeFolderArrowOpen guifg=#3FC5FF ]])
-- configure nvim-tree
nvimtree.setup({
view = {
width = 35,
relativenumber = true,
},
-- change folder arrow icons
renderer = {
indent_markers = {
enable = true,
},
icons = {
glyphs = {
folder = {
arrow_closed = "", -- arrow when folder is closed
arrow_open = "", -- arrow when folder is open
},
},
},
},
-- disable window_picker for
-- explorer to work well with
-- window splits
actions = {
open_file = {
window_picker = {
enable = false,
},
},
},
filters = {
custom = { ".DS_Store" },
},
git = {
ignore = false,
},
})
-- set keymaps
local keymap = vim.keymap -- for conciseness
keymap.set("n", "<leader>ee", "<cmd>NvimTreeToggle<CR>", { desc = "Toggle file explorer" }) -- toggle file explorer
keymap.set("n", "<leader>ef", "<cmd>NvimTreeFindFileToggle<CR>", { desc = "Toggle file explorer on current file" }) -- toggle file explorer on current file
keymap.set("n", "<leader>ec", "<cmd>NvimTreeCollapse<CR>", { desc = "Collapse file explorer" }) -- collapse file explorer
keymap.set("n", "<leader>er", "<cmd>NvimTreeRefresh<CR>", { desc = "Refresh file explorer" }) -- refresh file explorer
end,
}

View file

@ -1,59 +0,0 @@
return {
{
"nvim-treesitter/nvim-treesitter",
event = { "BufReadPre", "BufNewFile" },
build = ":TSUpdate",
dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects",
"windwp/nvim-ts-autotag",
},
config = function()
-- import nvim-treesitter plugin
local treesitter = require("nvim-treesitter.configs")
-- configure treesitter
treesitter.setup({ -- enable syntax highlighting
highlight = {
enable = true,
},
-- enable indentation
indent = { enable = true },
-- enable autotagging (w/ nvim-ts-autotag plugin)
autotag = {
enable = true,
},
-- ensure these language parsers are installed
ensure_installed = {
"json",
"javascript",
"typescript",
"tsx",
"yaml",
"html",
"css",
"prisma",
"markdown",
"markdown_inline",
"svelte",
"graphql",
"bash",
"lua",
"vim",
"dockerfile",
"gitignore",
"query",
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = false,
node_decremental = "<bs>",
},
},
enable_autocmd = false,
})
end,
},
}

View file

@ -1,39 +0,0 @@
return {
"nvim-telescope/telescope.nvim",
branch = "0.1.x",
dependencies = {
"nvim-lua/plenary.nvim",
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
"nvim-tree/nvim-web-devicons",
},
config = function()
local telescope = require("telescope")
local actions = require("telescope.actions")
local builtin = require("telescope.builtin")
telescope.setup({
defaults = {
path_display = { "truncate " },
mappings = {
i = {
["<C-k>"] = actions.move_selection_previous, -- move to prev result
["<C-j>"] = actions.move_selection_next, -- move to next result
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
},
},
},
})
telescope.load_extension("fzf")
-- set keymaps
local keymap = vim.keymap -- for conciseness
keymap.set("n", "<leader>pf", builtin.find_files, {})
keymap.set("n", "<C-p>", builtin.git_files, {})
keymap.set("n", "<leader>ps", function()
builtin.grep_string({ search = vim.fn.input("Grep > ") })
end)
keymap.set("n", "<leader>vh", builtin.help_tags, {})
end,
}

View file

@ -0,0 +1,4 @@
return {
{ "neoclide/coc.nvim", branch = "release" },
{ "yaegassy/coc-volar", dependencies = "neoclide/coc.nvim", build = "yarn install --frozen-lockfile" },
}

View file

@ -0,0 +1,66 @@
return {
{
"catppuccin/nvim",
name = "catppuccin",
opts = {
flavour = "macchiato",
background = {
light = "latte",
dark = "macchiato",
},
transparent_background = true,
integrations = {
aerial = true,
alpha = true,
cmp = true,
dashboard = true,
flash = true,
gitsigns = true,
headlines = true,
illuminate = true,
indent_blankline = { enabled = true },
leap = true,
lsp_trouble = true,
mason = true,
markdown = true,
mini = true,
native_lsp = {
enabled = true,
underlines = {
errors = { "undercurl" },
hints = { "undercurl" },
warnings = { "undercurl" },
information = { "undercurl" },
},
},
navic = { enabled = true, custom_bg = "lualine" },
neotest = true,
neotree = true,
noice = true,
notify = true,
semantic_tokens = true,
telescope = true,
treesitter = true,
treesitter_context = true,
which_key = true,
},
},
priority = 1000,
},
{
"folke/tokyonight.nvim",
opts = {
transparent = true,
styles = {
sidebars = "transparent",
floats = "transparent",
},
},
},
{
"LazyVim/LazyVim",
opts = {
colorscheme = "catppuccin",
},
},
}

View file

@ -0,0 +1,20 @@
local util = require("lspconfig.util")
return {
{
"neovim/nvim-lspconfig",
opts = {
servers = {
biome = {
root_dir = function(fname)
return util.root_pattern("biome.json", "biome.jsonc")(fname)
or util.find_package_json_ancestor(fname)
or vim.fs.find("node_modules", { path = fname, upward = true })[1]
or util.find_node_modules_ancestor(fname)
or util.find_git_ancestor(fname)
end,
},
},
},
},
}

View file

@ -0,0 +1,13 @@
return {
{
"rcarriga/nvim-notify",
opts = {
stages = "slide",
render = "wrapped-compact",
timeout = 2000,
top_down = false,
fps = 40,
background_colour = "#000000",
},
},
}

View file

@ -0,0 +1,92 @@
local handler = function(virtText, lnum, endLnum, width, truncate)
local newVirtText = {}
local suffix = (" 󰁂 %d "):format(endLnum - lnum)
local sufWidth = vim.fn.strdisplaywidth(suffix)
local targetWidth = width - sufWidth
local curWidth = 0
for _, chunk in ipairs(virtText) do
local chunkText = chunk[1]
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
if targetWidth > curWidth + chunkWidth then
table.insert(newVirtText, chunk)
else
chunkText = truncate(chunkText, targetWidth - curWidth)
local hlGroup = chunk[2]
table.insert(newVirtText, { chunkText, hlGroup })
chunkWidth = vim.fn.strdisplaywidth(chunkText)
-- str width returned from truncate() may less than 2nd argument, need padding
if curWidth + chunkWidth < targetWidth then
suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth)
end
break
end
curWidth = curWidth + chunkWidth
end
table.insert(newVirtText, { suffix, "MoreMsg" })
return newVirtText
end
return {
{
"kevinhwang91/nvim-ufo",
dependencies = { "kevinhwang91/promise-async" },
opts = {
provider_selector = function()
return { "lsp", "indent" }
end,
fold_virt_text_handler = handler,
filetype_exclude = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason" },
},
config = function(_, opts)
vim.api.nvim_create_autocmd("FileType", {
group = vim.api.nvim_create_augroup("local_detach_ufo", { clear = true }),
pattern = opts.filetype_exclude,
callback = function()
require("ufo").detach()
end,
})
vim.o.foldcolumn = "1"
vim.o.foldlevel = 99
vim.o.foldlevelstart = 99
vim.o.foldenable = true
require("ufo").setup(opts)
end,
keys = {
{
"zR",
mode = { "n" },
function()
require("ufo").openAllFolds()
end,
{ desc = "Open all folds" },
},
{
"zM",
mode = { "n" },
function()
require("ufo").closeAllFolds()
end,
{ desc = "Close all folds" },
},
{
"zK",
function()
local winid = require("ufo").peekFoldedLinesUnderCursor()
if not winid then
vim.lsp.buf.hover()
end
end,
{ desc = "Peek Fold" },
},
{
"zr",
mode = { "n" },
function()
require("ufo").openFoldsExceptKinds()
end,
{ desc = "Open fold" },
},
},
},
}

View file

@ -0,0 +1,16 @@
return {
{
"mfussenegger/nvim-dap",
config = function() end,
},
{
"linux-cultist/venv-selector.nvim",
dependencies = { "neovim/nvim-lspconfig", "nvim-telescope/telescope.nvim", "mfussenegger/nvim-dap" },
opts = {
name = { "venv", ".venv" },
parents = 2,
auto_refresh = true,
},
event = "VeryLazy",
},
}

View file

@ -0,0 +1,4 @@
indent_type = "Spaces"
indent_width = 2
column_width = 120