kekl
This commit is contained in:
@ -1,125 +1,125 @@
|
||||
_:
|
||||
let
|
||||
get_bufnrs.__raw = ''
|
||||
function()
|
||||
local buf_size_limit = 1024 * 1024 -- 1MB size limit
|
||||
local bufs = vim.api.nvim_list_bufs()
|
||||
local valid_bufs = {}
|
||||
for _, buf in ipairs(bufs) do
|
||||
if vim.api.nvim_buf_is_loaded(buf) and vim.api.nvim_buf_get_offset(buf, vim.api.nvim_buf_line_count(buf)) < buf_size_limit then
|
||||
table.insert(valid_bufs, buf)
|
||||
end
|
||||
get_bufnrs.__raw = ''
|
||||
function()
|
||||
local buf_size_limit = 1024 * 1024 -- 1MB size limit
|
||||
local bufs = vim.api.nvim_list_bufs()
|
||||
local valid_bufs = {}
|
||||
for _, buf in ipairs(bufs) do
|
||||
if vim.api.nvim_buf_is_loaded(buf) and vim.api.nvim_buf_get_offset(buf, vim.api.nvim_buf_line_count(buf)) < buf_size_limit then
|
||||
table.insert(valid_bufs, buf)
|
||||
end
|
||||
return valid_bufs
|
||||
end
|
||||
'';
|
||||
return valid_bufs
|
||||
end
|
||||
'';
|
||||
in
|
||||
{
|
||||
programs.nixvim.plugins = {
|
||||
cmp = {
|
||||
enable = true;
|
||||
autoEnableSources = true;
|
||||
settings = {
|
||||
mapping = {
|
||||
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
|
||||
"<C-f>" = "cmp.mapping.scroll_docs(4)";
|
||||
"<C-Space>" = "cmp.mapping.complete()";
|
||||
"<C-e>" = "cmp.mapping.abort()";
|
||||
"<C-Left>" = "cmp.mapping.abort()";
|
||||
"<CR>" = "cmp.mapping.confirm({ select = false })";
|
||||
};
|
||||
|
||||
preselect = "cmp.PreselectMode.None";
|
||||
|
||||
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
|
||||
|
||||
sources = [
|
||||
{
|
||||
name = "nvim_lsp";
|
||||
priority = 1000;
|
||||
option = {
|
||||
inherit get_bufnrs;
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "nvim_lsp_signature_help";
|
||||
priority = 1000;
|
||||
option = {
|
||||
inherit get_bufnrs;
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "nvim_lsp_document_symbol";
|
||||
priority = 1000;
|
||||
option = {
|
||||
inherit get_bufnrs;
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "treesitter";
|
||||
priority = 850;
|
||||
option = {
|
||||
inherit get_bufnrs;
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "luasnip";
|
||||
priority = 750;
|
||||
}
|
||||
{
|
||||
name = "buffer";
|
||||
priority = 500;
|
||||
option = {
|
||||
inherit get_bufnrs;
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "path";
|
||||
priority = 300;
|
||||
}
|
||||
{
|
||||
name = "cmdline";
|
||||
priority = 300;
|
||||
}
|
||||
{
|
||||
name = "git";
|
||||
priority = 250;
|
||||
}
|
||||
{
|
||||
name = "calc";
|
||||
priority = 150;
|
||||
}
|
||||
{
|
||||
name = "emoji";
|
||||
priority = 100;
|
||||
}
|
||||
];
|
||||
};
|
||||
programs.nixvim.plugins = {
|
||||
cmp = {
|
||||
enable = true;
|
||||
autoEnableSources = true;
|
||||
settings = {
|
||||
mapping = {
|
||||
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
|
||||
"<C-f>" = "cmp.mapping.scroll_docs(4)";
|
||||
"<C-Space>" = "cmp.mapping.complete()";
|
||||
"<C-e>" = "cmp.mapping.abort()";
|
||||
"<C-Left>" = "cmp.mapping.abort()";
|
||||
"<CR>" = "cmp.mapping.confirm({ select = false })";
|
||||
};
|
||||
|
||||
friendly-snippets.enable = true;
|
||||
luasnip.enable = true;
|
||||
preselect = "cmp.PreselectMode.None";
|
||||
|
||||
lspkind = {
|
||||
enable = true;
|
||||
cmp = {
|
||||
enable = true;
|
||||
menu = {
|
||||
buffer = "";
|
||||
calc = "";
|
||||
cmdline = "";
|
||||
codeium = "";
|
||||
emoji = "";
|
||||
git = "";
|
||||
luasnip = "";
|
||||
neorg = "";
|
||||
nvim_lsp = "";
|
||||
nvim_lua = "";
|
||||
path = "";
|
||||
spell = "";
|
||||
treesitter = "";
|
||||
};
|
||||
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
|
||||
|
||||
sources = [
|
||||
{
|
||||
name = "nvim_lsp";
|
||||
priority = 1000;
|
||||
option = {
|
||||
inherit get_bufnrs;
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "nvim_lsp_signature_help";
|
||||
priority = 1000;
|
||||
option = {
|
||||
inherit get_bufnrs;
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "nvim_lsp_document_symbol";
|
||||
priority = 1000;
|
||||
option = {
|
||||
inherit get_bufnrs;
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "treesitter";
|
||||
priority = 850;
|
||||
option = {
|
||||
inherit get_bufnrs;
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "luasnip";
|
||||
priority = 750;
|
||||
}
|
||||
{
|
||||
name = "buffer";
|
||||
priority = 500;
|
||||
option = {
|
||||
inherit get_bufnrs;
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "path";
|
||||
priority = 300;
|
||||
}
|
||||
{
|
||||
name = "cmdline";
|
||||
priority = 300;
|
||||
}
|
||||
{
|
||||
name = "git";
|
||||
priority = 250;
|
||||
}
|
||||
{
|
||||
name = "calc";
|
||||
priority = 150;
|
||||
}
|
||||
{
|
||||
name = "emoji";
|
||||
priority = 100;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
friendly-snippets.enable = true;
|
||||
luasnip.enable = true;
|
||||
|
||||
lspkind = {
|
||||
enable = true;
|
||||
cmp = {
|
||||
enable = true;
|
||||
menu = {
|
||||
buffer = "";
|
||||
calc = "";
|
||||
cmdline = "";
|
||||
codeium = "";
|
||||
emoji = "";
|
||||
git = "";
|
||||
luasnip = "";
|
||||
neorg = "";
|
||||
nvim_lsp = "";
|
||||
nvim_lua = "";
|
||||
path = "";
|
||||
spell = "";
|
||||
treesitter = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -1,19 +1,23 @@
|
||||
{ config, pkgs, nixvim, ... }:
|
||||
{
|
||||
imports = [
|
||||
nixvim.homeManagerModules.nixvim
|
||||
./cmp.nix
|
||||
./lsp.nix
|
||||
./neotree.nix
|
||||
./opts.nix
|
||||
./lualine.nix
|
||||
./alpha.nix
|
||||
./dev.nix
|
||||
./nonels.nix
|
||||
];
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
colorschemes.oxocarbon.enable = true;
|
||||
};
|
||||
config,
|
||||
pkgs,
|
||||
nixvim,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
nixvim.homeManagerModules.nixvim
|
||||
./cmp.nix
|
||||
./lsp.nix
|
||||
./neotree.nix
|
||||
./opts.nix
|
||||
./lualine.nix
|
||||
./alpha.nix
|
||||
./dev.nix
|
||||
./nonels.nix
|
||||
];
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
colorschemes.oxocarbon.enable = true;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1,71 +1,71 @@
|
||||
{
|
||||
programs.nixvim.plugins = {
|
||||
lsp-format = {
|
||||
enable = true;
|
||||
};
|
||||
lsp = {
|
||||
enable = true;
|
||||
inlayHints = true;
|
||||
servers = {
|
||||
html = {
|
||||
enable = true;
|
||||
};
|
||||
lua_ls = {
|
||||
enable = true;
|
||||
};
|
||||
nixd = {
|
||||
enable = true;
|
||||
extraOptions = {
|
||||
nixos = {
|
||||
expr = "(builtins.getFlake \"/etc/nixos\").nixosConfigurations.aurelionite.options";
|
||||
};
|
||||
home_manager = {
|
||||
expr = "(builtins.getFlake \"/etc/nixos\").homeConfigurations.aurelionite.options";
|
||||
};
|
||||
};
|
||||
};
|
||||
marksman = {
|
||||
enable = true;
|
||||
};
|
||||
pyright = {
|
||||
enable = true;
|
||||
};
|
||||
gopls = {
|
||||
enable = true;
|
||||
};
|
||||
yamlls = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
keymaps = {
|
||||
silent = true;
|
||||
lspBuf = {
|
||||
gd = {
|
||||
action = "definition";
|
||||
desc = "Goto Definition";
|
||||
};
|
||||
gr = {
|
||||
action = "references";
|
||||
desc = "Goto References";
|
||||
};
|
||||
gD = {
|
||||
action = "declaration";
|
||||
desc = "Goto Declaration";
|
||||
};
|
||||
gI = {
|
||||
action = "implementation";
|
||||
desc = "Goto Implementation";
|
||||
};
|
||||
gT = {
|
||||
action = "type_definition";
|
||||
desc = "Type Definition";
|
||||
};
|
||||
"<leader>cr" = {
|
||||
action = "rename";
|
||||
desc = "Rename";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
programs.nixvim.plugins = {
|
||||
lsp-format = {
|
||||
enable = true;
|
||||
};
|
||||
lsp = {
|
||||
enable = false;
|
||||
inlayHints = true;
|
||||
servers = {
|
||||
html = {
|
||||
enable = true;
|
||||
};
|
||||
lua_ls = {
|
||||
enable = true;
|
||||
};
|
||||
nixd = {
|
||||
enable = true;
|
||||
extraOptions = {
|
||||
nixos = {
|
||||
expr = "(builtins.getFlake \"/etc/nixos\").nixosConfigurations.aurelionite.options";
|
||||
};
|
||||
home_manager = {
|
||||
expr = "(builtins.getFlake \"/etc/nixos\").homeConfigurations.aurelionite.options";
|
||||
};
|
||||
};
|
||||
};
|
||||
marksman = {
|
||||
enable = true;
|
||||
};
|
||||
pyright = {
|
||||
enable = true;
|
||||
};
|
||||
gopls = {
|
||||
enable = true;
|
||||
};
|
||||
yamlls = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
keymaps = {
|
||||
silent = true;
|
||||
lspBuf = {
|
||||
gd = {
|
||||
action = "definition";
|
||||
desc = "Goto Definition";
|
||||
};
|
||||
gr = {
|
||||
action = "references";
|
||||
desc = "Goto References";
|
||||
};
|
||||
gD = {
|
||||
action = "declaration";
|
||||
desc = "Goto Declaration";
|
||||
};
|
||||
gI = {
|
||||
action = "implementation";
|
||||
desc = "Goto Implementation";
|
||||
};
|
||||
gT = {
|
||||
action = "type_definition";
|
||||
desc = "Type Definition";
|
||||
};
|
||||
"<leader>cr" = {
|
||||
action = "rename";
|
||||
desc = "Rename";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -1,58 +1,63 @@
|
||||
{ config, pkgs, nixvim, ... }:
|
||||
{
|
||||
programs.nixvim = {
|
||||
extraConfigLua = ''
|
||||
local map = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
config,
|
||||
pkgs,
|
||||
nixvim,
|
||||
...
|
||||
}:
|
||||
{
|
||||
programs.nixvim = {
|
||||
extraConfigLua = ''
|
||||
local map = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
vim.g.mapleader = " "
|
||||
map('n', '<c-t>', ":ToggleTerm size=40 direction=float<CR>", opts)
|
||||
map('n', '<c-n>', ":Neotree filesystem reveal right toggle<CR>", opts)
|
||||
vim.g.mapleader = " "
|
||||
map('n', '<c-t>', ":ToggleTerm size=40 direction=float<CR>", opts)
|
||||
map('n', '<c-n>', ":Neotree filesystem reveal right toggle<CR>", opts)
|
||||
|
||||
map('v', '<Tab>', '>gv', opts)
|
||||
map('v', '<S-Tab>', '<gv', opts)
|
||||
map('v', '<Tab>', '>gv', opts)
|
||||
map('v', '<S-Tab>', '<gv', opts)
|
||||
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.autoindent = true
|
||||
vim.opt.smartindent = true
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.number = true;
|
||||
vim.cmd [[
|
||||
cnoreabbrev W! w!
|
||||
cnoreabbrev Q! q!
|
||||
cnoreabbrev Qall! qall!
|
||||
cnoreabbrev Wq wq
|
||||
cnoreabbrev Wa wa
|
||||
cnoreabbrev wQ wq
|
||||
cnoreabbrev WQ wq
|
||||
cnoreabbrev W w
|
||||
cnoreabbrev Q q
|
||||
cnoreabbrev Qall qall
|
||||
]]
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.autoindent = true
|
||||
vim.opt.smartindent = true
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.number = true;
|
||||
vim.cmd [[
|
||||
cnoreabbrev W! w!
|
||||
cnoreabbrev Q! q!
|
||||
cnoreabbrev Qall! qall!
|
||||
cnoreabbrev Wq wq
|
||||
cnoreabbrev Wa wa
|
||||
cnoreabbrev wQ wq
|
||||
cnoreabbrev WQ wq
|
||||
cnoreabbrev W w
|
||||
cnoreabbrev Q q
|
||||
cnoreabbrev Qall qall
|
||||
]]
|
||||
|
||||
local _border = "rounded"
|
||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
|
||||
vim.lsp.handlers.hover, {
|
||||
border = _border
|
||||
}
|
||||
)
|
||||
local _border = "rounded"
|
||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
|
||||
vim.lsp.handlers.hover, {
|
||||
border = _border
|
||||
}
|
||||
)
|
||||
|
||||
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
|
||||
vim.lsp.handlers.signature_help, {
|
||||
border = _border
|
||||
}
|
||||
)
|
||||
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
|
||||
vim.lsp.handlers.signature_help, {
|
||||
border = _border
|
||||
}
|
||||
)
|
||||
|
||||
vim.diagnostic.config{
|
||||
float={border=_border}
|
||||
};
|
||||
vim.diagnostic.config{
|
||||
float={border=_border}
|
||||
};
|
||||
|
||||
require('lspconfig.ui.windows').default_options = {
|
||||
border = _border
|
||||
}
|
||||
'';
|
||||
};
|
||||
require('lspconfig.ui.windows').default_options = {
|
||||
border = _border
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user