Update dotfiles

This commit is contained in:
hok7z 2023-04-03 16:19:12 +03:00
parent 380504ab98
commit ba7f94b82a
17 changed files with 509 additions and 344 deletions

View File

@ -0,0 +1,40 @@
{
"Comment.nvim": { "branch": "master", "commit": "8d3aa5c22c2d45e788c7a5fe13ad77368b783c20" },
"DAPInstall.nvim": { "branch": "main", "commit": "1da66b6015bdec638a3bf903506646544f8fbe25" },
"LuaSnip": { "branch": "master", "commit": "bc8ec05022743d3f08bda7a76c6bb5e9a9024581" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-calc": { "branch": "main", "commit": "50792f34a628ea6eb31d2c90e8df174671e4e7a0" },
"cmp-cmdline": { "branch": "main", "commit": "8fcc934a52af96120fe26358985c10c035984b53" },
"cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
"cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
"friendly-snippets": { "branch": "main", "commit": "8d91ba2dc2421a54981115f61b914974f938fa77" },
"gitsigns.nvim": { "branch": "main", "commit": "f412f51d0eaf0905a2759c8087090071689bb8fb" },
"impatient.nvim": { "branch": "main", "commit": "c90e273f7b8c50a02f956c24ce4804a47f18162e" },
"indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" },
"lazy.nvim": { "branch": "main", "commit": "57cce98dfdb2f2dd05a0567d89811e6d0505e13b" },
"lsp_signature.nvim": { "branch": "master", "commit": "1882019270be445a8cad4353f1530574f2b2d02d" },
"lspkind-nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "b64fdede85fd5e0b720ce722919e0a9b95ed6547" },
"mason.nvim": { "branch": "main", "commit": "baee73f710fda10d3f946dc98f14b6923f38e3f1" },
"nord.nvim": { "branch": "main", "commit": "e7d7135a1c5034deea72a5d8d42a25fdb93c85c1" },
"null-ls.nvim": { "branch": "main", "commit": "defa0518762abb32279d601443344fb9773f9330" },
"nvim-autopairs": { "branch": "master", "commit": "0fd6519d44eac3a6736aafdb3fe9da916c3701d4" },
"nvim-cmp": { "branch": "main", "commit": "777450fd0ae289463a14481673e26246b5e38bf2" },
"nvim-dap": { "branch": "master", "commit": "1dd02e82c77d558e30ba831db4c2e7ed534e874f" },
"nvim-dap-ui": { "branch": "master", "commit": "56a2df0e96bfa64ebd6967e7cad877a1530633d5" },
"nvim-lspconfig": { "branch": "master", "commit": "94291c924f0efdbc16ac625cf77ae7d3a7fa5821" },
"nvim-navic": { "branch": "master", "commit": "5b37ffc213f37acb529eda2b319deee4c5b8c55b" },
"nvim-notify": { "branch": "master", "commit": "50d037041ada0895aeba4c0215cde6d11b7729c4" },
"nvim-tree.lua": { "branch": "master", "commit": "45400cd7e02027937cd5e49845545e606ecf5a1f" },
"nvim-treesitter": { "branch": "master", "commit": "2f3113ff6d554e3fe4da3610135c2f404f7aa270" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "b55fe6175f0001347a433c9df358c8cbf8a4e90f" },
"nvim-web-devicons": { "branch": "master", "commit": "d92b3f4275f4774c0cb23b8b094a41d1dbb3e78c" },
"playground": { "branch": "master", "commit": "4044b53c4d4fcd7a78eae20b8627f78ce7dc6f56" },
"plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" },
"telescope.nvim": { "branch": "master", "commit": "942fe5faef47b21241e970551eba407bc10d9547" },
"todo-comments.nvim": { "branch": "main", "commit": "8febc60a76feefd8203077ef78b6a262ea1a41f9" },
"which-key.nvim": { "branch": "main", "commit": "4b73390eec680b4c061ea175eb32c0ff3412271d" }
}

View File

@ -12,7 +12,6 @@ local ok, err = pcall(function()
-- vim.cmd('colorscheme catppuccin-macchiato') -- vim.cmd('colorscheme catppuccin-macchiato')
-- vim.cmd('colorscheme aquarium') -- vim.cmd('colorscheme aquarium')
opt.termguicolors = true opt.termguicolors = true
vim.cmd('colorscheme nord')
end) end)
if not ok then if not ok then

View File

@ -1,28 +1,32 @@
local ok, packer = pcall(require,"packer") local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not ok then if not vim.loop.fs_stat(lazypath) then
vim.notify("Failed to load packer\n\n") vim.fn.system({
return "git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end end
vim.opt.rtp:prepend(lazypath)
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "*/core/plugins.lua",
callback = function(arg)
vim.cmd("source "..arg.file)
vim.cmd("PackerInstall")
end,
})
packer.startup{ require("lazy").setup({
function(use) {
use {"wbthomason/packer.nvim"}
use {
"lewis6991/impatient.nvim", "lewis6991/impatient.nvim",
opts = {}
config = function() require('impatient') end config = function() require('impatient') end
} },
-- Colorchemes -- Colorchemes
use 'gbprod/nord.nvim' {
"gbprod/nord.nvim",
priority = 1000,
config = function()
vim.cmd.colorscheme "nord"
end
},
-- use {"catppuccin/nvim", as = "catppuccin"} -- use {"catppuccin/nvim", as = "catppuccin"}
-- use {"tiagovla/tokyodark.nvim"} -- use {"tiagovla/tokyodark.nvim"}
-- use {'Everblush/everblush.nvim',as = 'everblush'} -- use {'Everblush/everblush.nvim',as = 'everblush'}
@ -31,15 +35,13 @@ packer.startup{
-- use {"projekt0n/github-nvim-theme"} -- use {"projekt0n/github-nvim-theme"}
-- use {"Mofiqul/vscode.nvim"} -- use {"Mofiqul/vscode.nvim"}
use {"dstein64/vim-startuptime"} {
use {
"kyazdani42/nvim-tree.lua", "kyazdani42/nvim-tree.lua",
requires = { "kyazdani42/nvim-web-devicons" }, dependencies = { "kyazdani42/nvim-web-devicons" },
config = function() require("plugins.nvim-tree") end config = function() require("plugins.nvim-tree") end
} },
use { {
"rcarriga/nvim-notify", "rcarriga/nvim-notify",
config = function() config = function()
require("notify").setup({ require("notify").setup({
@ -47,75 +49,76 @@ packer.startup{
vim.api.nvim_win_set_config(win,{focusable = false}) vim.api.nvim_win_set_config(win,{focusable = false})
end, end,
}) })
end,
}
use {
"lewis6991/gitsigns.nvim",
config = function() require("gitsigns").setup{keymaps = {}} end
}
use {
"akinsho/toggleterm.nvim", tag = 'v2.*',
config = function() require("toggleterm").setup() end
}
use {
"windwp/nvim-autopairs",
config = function() require("nvim-autopairs").setup() end
}
use {
"lukas-reineke/indent-blankline.nvim",
config = function()
require("indent_blankline").setup{
show_end_of_line = true,
space_char_blankline = " ",
}
end end
} },
use { {
"lewis6991/gitsigns.nvim",
opts = {
signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
},
}
},
{ "windwp/nvim-autopairs", opts = {} },
{
"lukas-reineke/indent-blankline.nvim",
opts = {
char = '',
show_trailing_blankline_indent = false,
}
},
{
"numToStr/Comment.nvim", "numToStr/Comment.nvim",
config = function() require('Comment').setup() end opts = {}
} },
use { {
"folke/todo-comments.nvim", "folke/todo-comments.nvim",
requires = "nvim-lua/plenary.nvim", dependencies = "nvim-lua/plenary.nvim",
config = function() require("todo-comments").setup() end opts = {}
} },
use { {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
requires = { dependencies = {
"nvim-treesitter/playground", "nvim-treesitter/playground",
"nvim-treesitter/nvim-treesitter-textobjects", "nvim-treesitter/nvim-treesitter-textobjects",
}, },
run = function() vim.cmd("TSUpdate") end, build = function() vim.cmd("TSUpdate") end,
config = function() require("plugins.treesitter") end config = function() require("plugins.treesitter") end
} },
use { {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
requires = {"nvim-lua/plenary.nvim"}, dependencies = {"nvim-lua/plenary.nvim"},
config = function() require("plugins.telescope") end config = function() require("plugins.telescope") end
} },
-- Language Server Protocol -- Language Server Protocol
use { {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
requires = { "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim" }, dependencies = {
{"williamboman/mason.nvim", opts},
"williamboman/mason-lspconfig.nvim",
{"j-hui/fidget.nvim", opts = {}}
},
config = function() config = function()
require("lsp") require("lsp")
require("mason").setup() require("mason").setup()
end end
} },
use { {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
requires = { dependencies = {
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-path", "hrsh7th/cmp-path",
"hrsh7th/cmp-buffer", "hrsh7th/cmp-buffer",
@ -125,13 +128,12 @@ packer.startup{
"hrsh7th/cmp-cmdline", "hrsh7th/cmp-cmdline",
}, },
config = function() require("plugins.cmp") end config = function() require("plugins.cmp") end
} },
use { {
"onsails/lspkind-nvim", "onsails/lspkind-nvim",
config = function() config = function()
local lspkind = require("lspkind") require("lspkind").init{
lspkind.init{
mode = 'symbol_text', mode = 'symbol_text',
preset = 'codicons', preset = 'codicons',
@ -164,22 +166,24 @@ packer.startup{
} }
} }
end end
} },
use { {"folke/which-key.nvim", opts = {}, lazy = true},
{
"L3MON4D3/LuaSnip", "L3MON4D3/LuaSnip",
requires = {"rafamadriz/friendly-snippets"}, dependencies = {"rafamadriz/friendly-snippets"},
config = function() require("plugins.luasnip") end config = function() require("plugins.luasnip") end
} },
use { {
"jose-elias-alvarez/null-ls.nvim", "jose-elias-alvarez/null-ls.nvim",
config = function() require("plugins.null-ls") end config = function() require("plugins.null-ls") end
} },
use { {
"SmiteshP/nvim-navic", "SmiteshP/nvim-navic",
requires = {"neovim/nvim-lspconfig"}, dependencies = {"neovim/nvim-lspconfig"},
config = function() config = function()
local navic = require("nvim-navic") local navic = require("nvim-navic")
navic.setup { navic.setup {
@ -190,9 +194,9 @@ packer.startup{
safe_output = true safe_output = true
} }
end, end,
} },
use { {
"ray-x/lsp_signature.nvim", "ray-x/lsp_signature.nvim",
config = function() config = function()
local lsp_signature = require("lsp_signature") local lsp_signature = require("lsp_signature")
@ -203,58 +207,15 @@ packer.startup{
} }
end end
} },
use {
"j-hui/fidget.nvim",
config = function() require("fidget").setup() end
}
-- Debug Adapter Protocol -- Debug Adapter Protocol
use { {
"mfussenegger/nvim-dap", "mfussenegger/nvim-dap",
requires = { dependencies = {
"arywz11/DAPInstall.nvim", "arywz11/DAPInstall.nvim",
"rcarriga/nvim-dap-ui" "rcarriga/nvim-dap-ui"
}, },
config = function() require("plugins.dap") end, config = function() require("plugins.dap") end,
} }
})
end,
config = {
display = {
open_fn = function()
return require("packer.util").float{border = "rounded"}
end
}
}
}
local function bootstrap()
local fn = vim.fn
local packer_install_path =
fn.stdpath("data").."/site/pack/packer/opt/packer.nvim"
local not_installed = fn.empty(fn.glob(packer_install_path)) == 1
if not_installed then
print("`packer.nvim` is not installed, installing...")
local repo = "https://github.com/wbthomason/packer.nvim"
vim.cmd(("!git clone %s %s"):format(repo, packer_install_path))
end
vim.cmd("packadd packer.nvim")
require("packer").startup {
load,
config = {
git = {clone_timeout = 240},
},
}
if not_installed then
vim.cmd("PackerSync")
end
end
return bootstrap

View File

@ -32,12 +32,10 @@ capabilities.textDocument.foldingRange = {
lineFoldingOnly = true, lineFoldingOnly = true,
} }
local navic = require("nvim-navic") local navic = require("nvim-navic")
vim.g.lsp_capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) vim.g.lsp_capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
vim.g.lsp_on_attach = function(client,bufnr) vim.g.lsp_on_attach = function(client,bufnr)
print("Attaching to:",client.name) print("Attaching to:",client.name)
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr,...) end local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr,...) end

View File

@ -0,0 +1,19 @@
return {
cmd = {vim.g.lsp_path .. "pylsp"},
filetypes = {"python"},
on_attach = vim.g.lsp_on_attach,
handlers = vim.g.lsp_handlers,
capabilities = vim.g.lsp_capabilities,
settings = {
pylsp = {
plugins = {
pycodestyle = {
ignore = {'W391','W293'},
maxLineLength = 90
}
}
}
},
}

View File

@ -1,8 +0,0 @@
return {
cmd = {vim.g.lsp_path .. "pyright-langserver", "--stdio"},
filetypes = {"python"},
on_attach = vim.g.lsp_on_attach,
handlers = vim.g.lsp_handlers,
capabilities = vim.g.lsp_capabilities,
}

View File

@ -0,0 +1,71 @@
local ok, ls = pcall(require,"luasnip")
if not ok then
vim.notify("Failed load luasnip\n")
end
local s = ls.s
local fmt = require("luasnip.extras.fmt").fmt
local i = ls.insert_node
local rep = require("luasnip.extras").rep
ls.setup({
history = true,
update_events = "TextChanged,TextChangedI",
enable_autosnippets = true,
})
ls.add_snippets("lua", {
s(
"reqm",
fmt(
[[
local ok, {} = pcall(require,"{}")
if not ok then
vim.notify("Failed load {}\n")
end
]], {
i(1, "mod"),
i(2),
rep(2),
}
)
)
})
-- Configuring keybinds
local mapopts = { silent = true, expr = true }
-- c-k is expansion key
vim.keymap.set({ "s", "i" }, "<C-k>", function()
if ls.expand_or_jumpable() then
ls.expand_or_jump()
else
return "<C-k>"
end
end, mapopt)
-- c-j is jump backwards key
vim.keymap.set({ "s", "i" }, "<C-j>", function()
if ls.jumpable(-1) then
ls.jump(-1)
else
return "<C-j>"
end
end, mapopt)
-- c-l is selecting withing a list of options
vim.keymap.set({ "s", "i" }, "<C-l>", function()
if ls.choice_active() then
ls.change_choice(1)
else
return "<C-l"
end
end, mapopt)
require("luasnip/loaders/from_vscode").lazy_load()

View File

@ -0,0 +1,35 @@
local ok, ls = pcall(require,"luasnip")
if not ok then
vim.notify("Failed load luasnip\n")
return
end
local s = ls.s
local fmt = require("luasnip.extras.fmt").fmt
local i = ls.insert_node
local rep = require("luasnip.extras").rep
return {
}
-- ls.add_snippets("lua", {
-- s(
-- "reqm",
-- fmt(
-- [[
-- local ok, {} = pcall(require,"{}")
-- if not ok then
-- vim.notify("Failed load {}\n")
-- end
-- ]], {
-- i(1, "mod"),
-- i(2),
-- rep(2),
-- }
-- )
-- )
-- })

View File

@ -0,0 +1,16 @@
local ok, ls = pcall(require,"luasnip")
if not ok then
vim.notify("Failed load luasnip\n")
end
local s = ls.s
local fmt = require("luasnip.extras.fmt").fmt
local i = ls.insert_node
local rep = require("luasnip.extras").rep
return {
-- Golang snippets
}

View File

@ -0,0 +1,30 @@
local ok, ls = pcall(require,"luasnip")
if not ok then
vim.notify("Failed load luasnip\n")
end
local s = ls.s
local fmt = require("luasnip.extras.fmt").fmt
local i = ls.insert_node
local rep = require("luasnip.extras").rep
return {
s(
"reqm",
fmt([[
local ok, {} = pcall(require,"{}")
if not ok then
vim.notify("Failed load {}\n")
end
]], {
i(1, "mod"),
i(2),
rep(2),
}
)
)
}

View File

@ -0,0 +1,6 @@
local ok, ls = pcall(require, "luasnip")
if not ok then
vim.notify("Failed load luasnip\n")
end

View File

@ -33,9 +33,7 @@ keymap("n","<leader>b",builtin.buffers)
keymap("n","<leader>e",function() keymap("n","<leader>e",function()
builtin.diagnostics{bufnr = 0,severity_limit = "WARN"} builtin.diagnostics{bufnr = 0,severity_limit = "WARN"}
end) end)
keymap("n","<leader>E",function() keymap("n","<leader>E",function()
builtin.diagnostics{severity_limit = "WARN"} builtin.diagnostics{severity_limit = "WARN"}
end) end)