mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-24 00:29:43 -04:00
wip
This commit is contained in:
parent
528964b3e7
commit
af8389dab7
9 changed files with 153 additions and 88 deletions
|
|
@ -1,7 +1,9 @@
|
||||||
{
|
{
|
||||||
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
|
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
|
||||||
"base16-vim": { "branch": "master", "commit": "3be3cd82cd31acfcab9a41bad853d9c68d30478d" },
|
"base16-vim": { "branch": "master", "commit": "3be3cd82cd31acfcab9a41bad853d9c68d30478d" },
|
||||||
"bufferline.nvim": { "branch": "main", "commit": "0b2fd861eee7595015b6561dade52fb060be10c4" },
|
"bufferline.nvim": { "branch": "main", "commit": "2e3c8cc5a57ddd32f1edd2ffd2ccb10c09421f6c" },
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||||
|
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "562dc47189ad3c8696dbf460d38603a74d544849" },
|
"gitsigns.nvim": { "branch": "main", "commit": "562dc47189ad3c8696dbf460d38603a74d544849" },
|
||||||
"indent-blankline.nvim": { "branch": "master", "commit": "db926997af951da38e5004ec7b9fbdc480b48f5d" },
|
"indent-blankline.nvim": { "branch": "master", "commit": "db926997af951da38e5004ec7b9fbdc480b48f5d" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
|
"lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
|
||||||
|
|
@ -11,9 +13,9 @@
|
||||||
"neo-tree.nvim": { "branch": "main", "commit": "206241e451c12f78969ff5ae53af45616ffc9b72" },
|
"neo-tree.nvim": { "branch": "main", "commit": "206241e451c12f78969ff5ae53af45616ffc9b72" },
|
||||||
"nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" },
|
"nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
|
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "b21c166bbf337734f2a39734a905c1c3e298205c" },
|
"nvim-lspconfig": { "branch": "master", "commit": "a7f0f9c18baa70a3970ea18f9984e03b6f6c2e8a" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "0b8b78f9d08dc338a146eb4cd4bcbed8dd36a783" },
|
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
|
||||||
"nvim-treesitter-context": { "branch": "master", "commit": "0f3332788e0bd37716fbd25f39120dcfd557c90f" },
|
"nvim-treesitter": { "branch": "master", "commit": "8724e7d028ba11604dde94dc4be63f70cccf16e0" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" },
|
"nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" },
|
"plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "5972437de807c3bc101565175da66a1aa4f8707a" },
|
"telescope.nvim": { "branch": "master", "commit": "5972437de807c3bc101565175da66a1aa4f8707a" },
|
||||||
|
|
|
||||||
|
|
@ -19,3 +19,5 @@ vim.keymap.set('n', '<S-l>', ':bnext<CR>', { noremap = true, silent = true })
|
||||||
|
|
||||||
vim.keymap.set("v", "<", "<gv")
|
vim.keymap.set("v", "<", "<gv")
|
||||||
vim.keymap.set("v", ">", ">gv")
|
vim.keymap.set("v", ">", ">gv")
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<Esc>", ':nohlsearch<Bar>let @/=""<CR>', { noremap = true, silent = true})
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ return {
|
||||||
config = function()
|
config = function()
|
||||||
vim.cmd("colorscheme base16-onedark")
|
vim.cmd("colorscheme base16-onedark")
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
hi Normal guibg=NONE ctermbg=NONE
|
hi Normal guibg=NONE ctermbg=NONE guifg=#FFFFFF
|
||||||
hi NonText guibg=NONE ctermbg=NONE
|
hi NonText guibg=NONE ctermbg=NONE
|
||||||
hi LineNr guibg=NONE ctermbg=NONE
|
hi LineNr guibg=NONE ctermbg=NONE
|
||||||
hi CursorLine guibg=NONE ctermbg=NONE
|
hi CursorLine guibg=NONE ctermbg=NONE
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,7 @@ return {
|
||||||
--indent = { char = "⎸" },
|
--indent = { char = "⎸" },
|
||||||
indent = { char = "┆" },
|
indent = { char = "┆" },
|
||||||
scope = {
|
scope = {
|
||||||
show_start = false,
|
enabled = false
|
||||||
show_end = false
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ return {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
config = function()
|
config = function()
|
||||||
require('nvim-treesitter.configs').setup {
|
require('nvim-treesitter.configs').setup ({
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"lua",
|
"lua",
|
||||||
"c",
|
"c",
|
||||||
|
|
@ -27,41 +27,34 @@ return {
|
||||||
},
|
},
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
sync_install = true,
|
sync_install = true,
|
||||||
}
|
highlight = {
|
||||||
end
|
enable = true,
|
||||||
},
|
}
|
||||||
|
|
||||||
{
|
|
||||||
"nvim-treesitter/nvim-treesitter-context",
|
|
||||||
config = function()
|
|
||||||
require("treesitter-context").setup({
|
|
||||||
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
|
|
||||||
max_lines = 3, -- How many lines the window should span. Values <= 0 mean no limit.
|
|
||||||
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
|
|
||||||
line_numbers = false,
|
|
||||||
multiline_threshold = 20, -- Maximum number of lines to collapse for a single context line
|
|
||||||
trim_scope = "outer", -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
|
|
||||||
mode = "cursor", -- Line used to calculate context. Choices: 'cursor', 'topline'
|
|
||||||
-- Separator between context and content. Should be a single character string, like '-'.
|
|
||||||
-- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
|
|
||||||
separator = "=",
|
|
||||||
zindex = 20, -- The Z-index of the context window
|
|
||||||
on_attach = nil, -- (fun(buf: integer): boolean) rurn false to disable attaching
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
config = function()
|
|
||||||
local lsp = require('lspconfig')
|
|
||||||
lsp.lua_ls.setup{}
|
|
||||||
require("which-key").add({
|
|
||||||
{ "<leader>cl", ":LspInfo<CR>", desc = "LSP Info" },
|
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
|
--{
|
||||||
|
-- "nvim-treesitter/nvim-treesitter-context",
|
||||||
|
-- dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||||
|
-- config = function()
|
||||||
|
-- require("treesitter-context").setup({
|
||||||
|
-- enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
|
||||||
|
-- max_lines = 3, -- How many lines the window should span. Values <= 0 mean no limit.
|
||||||
|
-- min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
|
||||||
|
-- line_numbers = false,
|
||||||
|
-- multiline_threshold = 20, -- Maximum number of lines to collapse for a single context line
|
||||||
|
-- trim_scope = "outer", -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
|
||||||
|
-- mode = "cursor", -- Line used to calculate context. Choices: 'cursor', 'topline'
|
||||||
|
-- -- Separator between context and content. Should be a single character string, like '-'.
|
||||||
|
-- -- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
|
||||||
|
-- separator = "=",
|
||||||
|
-- zindex = 20, -- The Z-index of the context window
|
||||||
|
-- on_attach = nil, -- (fun(buf: integer): boolean) rurn false to disable attaching
|
||||||
|
-- })
|
||||||
|
-- end,
|
||||||
|
--},
|
||||||
|
|
||||||
{
|
{
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
|
|
@ -71,43 +64,95 @@ return {
|
||||||
|
|
||||||
{
|
{
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
dependencies = { "williamboman/mason.nvim" },
|
||||||
config = function()
|
config = function()
|
||||||
require("mason-lspconfig").setup{}
|
require("mason-lspconfig").setup{}
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{
|
{
|
||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
version = "v2.*",
|
version = "v2.*",
|
||||||
build = "make install_jsregexp",
|
build = "make install_jsregexp",
|
||||||
}
|
},
|
||||||
|
"saadparwaiz1/cmp_luasnip",
|
||||||
|
"hrsh7th/cmp-nvim-lsp"
|
||||||
|
},
|
||||||
|
|
||||||
|
config = function()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
cmp.setup({
|
||||||
|
enabled = function()
|
||||||
|
local context = require("cmp.config.context")
|
||||||
|
if vim.api.nvim_get_mode().mode == "c" then
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return not context.in_treesitter_capture("comment") and not context.in_syntax_group("comment")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require('luasnip').lsp_expand(args.body)
|
||||||
|
|
||||||
|
end
|
||||||
|
},
|
||||||
|
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||||
|
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||||
|
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||||
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
|
["<C-e>"] = cmp.mapping.abort(),
|
||||||
|
["<C-y>"] = cmp.mapping.confirm(),
|
||||||
|
["<CR>"] = cmp.mapping(function(fallback)
|
||||||
|
fallback()
|
||||||
|
end, { "i", "s" }),
|
||||||
|
}),
|
||||||
|
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'nvim_lsp' },
|
||||||
|
{ name = 'luasnip' },
|
||||||
|
}, {
|
||||||
|
{ name = 'buffer' }
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
end
|
||||||
},
|
},
|
||||||
config = function()
|
|
||||||
local cmp = require("cmp")
|
{
|
||||||
cmp.setup({
|
"neovim/nvim-lspconfig",
|
||||||
enabled = function()
|
config = function()
|
||||||
local context = require("cmp.config.context")
|
local lsp = require('lspconfig')
|
||||||
if vim.api.nvim_get_mode().mode == "c" then
|
local navic = require('nvim-navic')
|
||||||
return true
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
else
|
local servers = require('mason-lspconfig').get_installed_servers()
|
||||||
return not context.in_treesitter_capture("comment") and not context.in_syntax_group("comment")
|
|
||||||
end
|
for _, server in ipairs(servers) do
|
||||||
end,
|
lsp[server].setup {
|
||||||
mapping = {
|
capabilities = capabilities,
|
||||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
on_attach = function(client, bufnr)
|
||||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
if client.server_capabilities.documentSymbolProvider then
|
||||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
navic.attach(client,bufnr)
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
end
|
||||||
["<C-e>"] = cmp.mapping.abort(),
|
end,
|
||||||
["<C-y>"] = cmp.mapping.confirm(),
|
}
|
||||||
["<CR>"] = cmp.mapping(function(fallback)
|
end
|
||||||
fallback()
|
lsp.lua_ls.setup{
|
||||||
end, { "i", "s" }),
|
settings = {
|
||||||
}
|
Lua = {
|
||||||
})
|
diagnostics = {
|
||||||
end
|
globals = { 'vim' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
require("which-key").add({
|
||||||
|
{ "<leader>cl", ":LspInfo<CR>", desc = "LSP Info" },
|
||||||
|
})
|
||||||
|
end
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,18 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
dependencies = {
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
"SmiteshP/nvim-navic"
|
||||||
|
},
|
||||||
config = function()
|
config = function()
|
||||||
|
local navic = require('nvim-navic')
|
||||||
require("lualine").setup ({
|
require("lualine").setup ({
|
||||||
options = {
|
options = {
|
||||||
icons_enabled = true,
|
icons_enabled = true,
|
||||||
theme = 'material',
|
theme = 'material',
|
||||||
component_separators = { left = '>', right = '|'},
|
component_separators = { left = '>', right = '|'},
|
||||||
section_separators = { left = '', right = ''},
|
section_separators = { left = '', right = ''},
|
||||||
disabled_filetypes = {
|
disabled_filetypes = {
|
||||||
statusline = {},
|
statusline = {},
|
||||||
winbar = {},
|
winbar = {},
|
||||||
|
|
@ -25,23 +29,32 @@ return {
|
||||||
sections = {
|
sections = {
|
||||||
lualine_a = {'mode'},
|
lualine_a = {'mode'},
|
||||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||||
lualine_c = {'filename'},
|
lualine_c = {
|
||||||
lualine_x = {'encoding', 'fileformat', 'filetype'},
|
{'filename'},
|
||||||
|
{ function() return require("nvim-navic").get_location() end, cond = function()
|
||||||
|
return require("nvim-navic").is_available()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lualine_x = {'filetype'},
|
||||||
lualine_y = {'progress'},
|
lualine_y = {'progress'},
|
||||||
lualine_z = {'location'}
|
lualine_z = {'location'}
|
||||||
},
|
},
|
||||||
inactive_sections = {
|
inactive_sections = {
|
||||||
lualine_a = {},
|
lualine_a = {},
|
||||||
lualine_b = {},
|
lualine_b = {},
|
||||||
lualine_c = {'filename'},
|
lualine_c = {},
|
||||||
lualine_x = {'location'},
|
lualine_x = {},
|
||||||
lualine_y = {},
|
lualine_y = {},
|
||||||
lualine_z = {}
|
lualine_z = {}
|
||||||
},
|
},
|
||||||
tabline = {},
|
tabline = {},
|
||||||
winbar = {},
|
winbar = {},
|
||||||
inactive_winbar = {},
|
inactive_winbar = {},
|
||||||
extensions = {}
|
extensions = {
|
||||||
|
'lazy',
|
||||||
|
'neo-tree',
|
||||||
|
}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ return {
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require("neo-tree").setup({
|
require("neo-tree").setup({
|
||||||
|
enable_diagnostics = false,
|
||||||
window = {
|
window = {
|
||||||
position = "left",
|
position = "left",
|
||||||
width = 20,
|
width = 20,
|
||||||
|
|
@ -19,7 +20,6 @@ return {
|
||||||
|
|
||||||
local function toggle_neotree()
|
local function toggle_neotree()
|
||||||
local api = vim.api
|
local api = vim.api
|
||||||
local win = api.nvim_get_current_win()
|
|
||||||
local bufs = api.nvim_list_bufs()
|
local bufs = api.nvim_list_bufs()
|
||||||
|
|
||||||
for _, buf in ipairs(bufs) do
|
for _, buf in ipairs(bufs) do
|
||||||
|
|
@ -37,14 +37,14 @@ return {
|
||||||
{ "<leader>e", toggle_neotree, desc = "File Explorer" }
|
{ "<leader>e", toggle_neotree, desc = "File Explorer" }
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.fn.sign_define("DiagnosticSignError",
|
--vim.fn.sign_define("DiagnosticSignError",
|
||||||
{text = " ", texthl = "DiagnosticSignError"})
|
-- {text = " ", texthl = "DiagnosticSignError"})
|
||||||
vim.fn.sign_define("DiagnosticSignWarn",
|
--vim.fn.sign_define("DiagnosticSignWarn",
|
||||||
{text = " ", texthl = "DiagnosticSignWarn"})
|
-- {text = " ", texthl = "DiagnosticSignWarn"})
|
||||||
vim.fn.sign_define("DiagnosticSignInfo",
|
--vim.fn.sign_define("DiagnosticSignInfo",
|
||||||
{text = " ", texthl = "DiagnosticSignInfo"})
|
-- {text = " ", texthl = "DiagnosticSignInfo"})
|
||||||
vim.fn.sign_define("DiagnosticSignHint",
|
--vim.fn.sign_define("DiagnosticSignHint",
|
||||||
{text = "", texthl = "DiagnosticSignHint"})
|
-- {text = "", texthl = "DiagnosticSignHint"})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,10 +34,11 @@ return {
|
||||||
|
|
||||||
-- Code
|
-- Code
|
||||||
{ "<leader>gd", ":Telescope lsp_definitions<CR>", desc = "Go to Definition" },
|
{ "<leader>gd", ":Telescope lsp_definitions<CR>", desc = "Go to Definition" },
|
||||||
|
{ "<leader>gr", ":Telescope lsp_references", desc = "Goto References" },
|
||||||
{ "<leader>gi", ":Telescope lsp_implementations<CR>", desc = "Go to Implementations" },
|
{ "<leader>gi", ":Telescope lsp_implementations<CR>", desc = "Go to Implementations" },
|
||||||
{ "<leader>gt", ":Telescope lsp_type_definitions<CR>", desc = "Go to Type Definition" },
|
{ "<leader>gt", ":Telescope lsp_type_definitions<CR>", desc = "Go to Type Definition" },
|
||||||
{ "<leader>cv", ":Telescope treesitter<CR>", desc = "List function names & variables" },
|
{ "<leader>cv", ":Telescope treesitter<CR>", desc = "Function Names & Variables" },
|
||||||
{ "<leader>cd", ":Telescope diagnostics<CR>", desc = "Code diagnostics" },
|
{ "<leader>cd", ":Telescope diagnostics<CR>", desc = "Code Diagnostics" },
|
||||||
|
|
||||||
-- Git
|
-- Git
|
||||||
{ "<leader>Gt", ":Telescope git_branches<CR>", desc = "Git Branches" },
|
{ "<leader>Gt", ":Telescope git_branches<CR>", desc = "Git Branches" },
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,9 @@ return {
|
||||||
{ "<leader>bd", ":bd<CR>", desc = "Delete Buffer" },
|
{ "<leader>bd", ":bd<CR>", desc = "Delete Buffer" },
|
||||||
{ "<leader>bD", "execute 'close'<CR> | <cmd>execute 'bd!'", desc = "Delete Window & Buffer" },
|
{ "<leader>bD", "execute 'close'<CR> | <cmd>execute 'bd!'", desc = "Delete Window & Buffer" },
|
||||||
|
|
||||||
|
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code Action" },
|
||||||
|
{ "<leader>cr", vim.lsp.buf.rename, desc = "Rename Variable" },
|
||||||
|
|
||||||
{ "<leader>G", group = "Git"},
|
{ "<leader>G", group = "Git"},
|
||||||
{ "<leader>f", group = "Files"},
|
{ "<leader>f", group = "Files"},
|
||||||
{ "<leader>c", group = "Code"},
|
{ "<leader>c", group = "Code"},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue