update. Split neovim config into several files
This commit is contained in:
parent
2e523322c0
commit
ee0b50aa44
|
@ -68,7 +68,7 @@
|
||||||
keyMap = "us-acentos";
|
keyMap = "us-acentos";
|
||||||
};
|
};
|
||||||
|
|
||||||
chaotic.mesa-git.enable = true; # requires --impure for now
|
#chaotic.mesa-git.enable = true; # requires --impure for now
|
||||||
|
|
||||||
hardware.opengl = {
|
hardware.opengl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -128,11 +128,6 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
chaotic.gamescope = {
|
|
||||||
enable = true;
|
|
||||||
package = pkgs.gamescope_git;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
dconf.enable = true;
|
dconf.enable = true;
|
||||||
hyprland.enable = true;
|
hyprland.enable = true;
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
overlays = [
|
overlays = [
|
||||||
self.overlays.default
|
self.overlays.default
|
||||||
inputs.chaotic-nyx.overlays.default
|
inputs.chaotic-nyx.overlays.default
|
||||||
inputs.hyprland.overlays.default
|
|
||||||
inputs.hyprland-contrib.overlays.default
|
inputs.hyprland-contrib.overlays.default
|
||||||
inputs.hyprpicker.overlays.default
|
inputs.hyprpicker.overlays.default
|
||||||
];
|
];
|
||||||
|
@ -67,8 +66,9 @@
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
inputs.chaotic-nyx.nixosModules.default
|
|
||||||
inputs.grub2-themes.nixosModules.default
|
inputs.grub2-themes.nixosModules.default
|
||||||
|
inputs.chaotic-nyx.nixosModules.default
|
||||||
|
inputs.hyprland.nixosModules.default
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
require("settings")
|
||||||
|
require("plugins")
|
||||||
|
require("remaps")
|
|
@ -0,0 +1 @@
|
||||||
|
require("nvim-autopairs").setup({})
|
|
@ -0,0 +1,16 @@
|
||||||
|
require("bufferline").setup({
|
||||||
|
options = {
|
||||||
|
show_tab_indicators = true,
|
||||||
|
-- separator_style = { "", "" },
|
||||||
|
indicator = { style = "icon", icon = "" },
|
||||||
|
color_icons = true,
|
||||||
|
offsets = {
|
||||||
|
{
|
||||||
|
filetype = "neo-tree",
|
||||||
|
text = "File Explorer",
|
||||||
|
text_align = "center",
|
||||||
|
separator = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
|
@ -0,0 +1,122 @@
|
||||||
|
local cmp = require("cmp")
|
||||||
|
|
||||||
|
local lspkind = require("lspkind")
|
||||||
|
local luasnip = require("luasnip")
|
||||||
|
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
|
||||||
|
local has_words_before = function()
|
||||||
|
unpack = unpack or table.unpack
|
||||||
|
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||||
|
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
preselect = cmp.PreselectMode.None,
|
||||||
|
formatting = {
|
||||||
|
format = lspkind.cmp_format({
|
||||||
|
mode = "symbol_text",
|
||||||
|
|
||||||
|
symbol_map = {
|
||||||
|
Text = "",
|
||||||
|
Method = "",
|
||||||
|
Function = "",
|
||||||
|
Constructor = "",
|
||||||
|
Field = "",
|
||||||
|
Variable = "",
|
||||||
|
Class = "",
|
||||||
|
Interface = "",
|
||||||
|
Module = "",
|
||||||
|
Property = "",
|
||||||
|
Unit = "",
|
||||||
|
Value = "",
|
||||||
|
Enum = "",
|
||||||
|
Keyword = "",
|
||||||
|
Snippet = "",
|
||||||
|
Color = "",
|
||||||
|
File = "",
|
||||||
|
Reference = "",
|
||||||
|
Folder = "",
|
||||||
|
EnumMember = "",
|
||||||
|
Constant = "",
|
||||||
|
Struct = "",
|
||||||
|
Event = "",
|
||||||
|
Operator = "",
|
||||||
|
TypeParameter = ""
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require('luasnip').lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
window = {
|
||||||
|
completion = cmp.config.window.bordered(),
|
||||||
|
documentation = cmp.config.window.bordered(),
|
||||||
|
},
|
||||||
|
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = "buffer" },
|
||||||
|
{ name = "path" },
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "nvim_lsp_signature_help"},
|
||||||
|
{ name = "luasnip" },
|
||||||
|
}),
|
||||||
|
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||||
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||||
|
['<C-Space>'] = cmp.mapping.complete(),
|
||||||
|
['<C-e>'] = cmp.mapping.abort(),
|
||||||
|
['<CR>'] = cmp.mapping.confirm({ select = false }),
|
||||||
|
|
||||||
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
|
||||||
|
-- they way you will only jump inside the snippet region
|
||||||
|
elseif luasnip.expand_or_locally_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
elseif has_words_before() then
|
||||||
|
cmp.complete()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
|
||||||
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
elseif luasnip.jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
|
||||||
|
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||||
|
cmp.event:on(
|
||||||
|
'confirm_done',
|
||||||
|
cmp_autopairs.on_confirm_done()
|
||||||
|
)
|
||||||
|
|
||||||
|
cmp.setup.cmdline(":", {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = "path" },
|
||||||
|
{ name = "cmdline" },
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
cmp.setup.cmdline("/", {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = "buffer" },
|
||||||
|
})
|
||||||
|
})
|
|
@ -0,0 +1 @@
|
||||||
|
require("colorizer").setup({})
|
|
@ -0,0 +1,6 @@
|
||||||
|
require("gruvbox").setup({
|
||||||
|
--transparent_mode = true
|
||||||
|
})
|
||||||
|
vim.cmd("colorscheme gruvbox")
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
require("Comment").setup({})
|
|
@ -0,0 +1 @@
|
||||||
|
require("dressing").setup()
|
|
@ -0,0 +1,14 @@
|
||||||
|
require("plugins.colorscheme")
|
||||||
|
require("plugins.lualine")
|
||||||
|
require("plugins.bufferline")
|
||||||
|
require("plugins.treesitter")
|
||||||
|
require("plugins.lspconfig")
|
||||||
|
require("plugins.cmp")
|
||||||
|
require("plugins.telescope")
|
||||||
|
require("plugins.colorizer")
|
||||||
|
require("plugins.dressing")
|
||||||
|
require("plugins.autopairs")
|
||||||
|
require("plugins.comment")
|
||||||
|
require("plugins.smartsplits")
|
||||||
|
require("plugins.trouble")
|
||||||
|
require("plugins.which-key")
|
|
@ -0,0 +1,35 @@
|
||||||
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||||
|
|
||||||
|
local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
|
lspconfig.rnix.setup { capabilities = capabilities }
|
||||||
|
|
||||||
|
lspconfig.lua_ls.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
runtime = { version = "LuaJIT" },
|
||||||
|
diagnostics = { globals = { "vim" } },
|
||||||
|
workspace = {
|
||||||
|
library = vim.api.nvim_get_runtime_file("", true),
|
||||||
|
checkThirdParty = false
|
||||||
|
},
|
||||||
|
telemetry = { enable = false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
lspconfig.clangd.setup { capabilities = capabilities }
|
||||||
|
lspconfig.rust_analyzer.setup { capabilities = capabilities }
|
||||||
|
lspconfig.zls.setup { capabilities = capabilities }
|
||||||
|
lspconfig.jedi_language_server.setup { capabilities = capabilities }
|
||||||
|
lspconfig.bashls.setup { capabilities = capabilities }
|
||||||
|
|
||||||
|
lspconfig.cssls.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
cmd = { "css-languageserver", "--stdio" },
|
||||||
|
settings = {
|
||||||
|
css = { validate = false },
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
require("lualine").setup({
|
||||||
|
options = {
|
||||||
|
theme = "gruvbox_dark",
|
||||||
|
}
|
||||||
|
})
|
|
@ -0,0 +1,36 @@
|
||||||
|
require("neo-tree").setup({
|
||||||
|
default_component_configs = {
|
||||||
|
icon = {
|
||||||
|
folder_empty = "",
|
||||||
|
folder_empty_open = "",
|
||||||
|
},
|
||||||
|
git_status = {
|
||||||
|
symbols = {
|
||||||
|
renamed = "",
|
||||||
|
unstaged = "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
document_symbols = {
|
||||||
|
kinds = {
|
||||||
|
File = { icon = "", hl = "Tag" },
|
||||||
|
Namespace = { icon = "", hl = "Include" },
|
||||||
|
Package = { icon = "", hl = "Label" },
|
||||||
|
Class = { icon = "", hl = "Include" },
|
||||||
|
Property = { icon = "", hl = "@property" },
|
||||||
|
Enum = { icon = "", hl = "@number" },
|
||||||
|
Function = { icon = "", hl = "Function" },
|
||||||
|
String = { icon = "", hl = "String" },
|
||||||
|
Number = { icon = "", hl = "Number" },
|
||||||
|
Array = { icon = "", hl = "Type" },
|
||||||
|
Object = { icon = "", hl = "Type" },
|
||||||
|
Key = { icon = "", hl = "" },
|
||||||
|
Struct = { icon = "", hl = "Type" },
|
||||||
|
Operator = { icon = "", hl = "Operator" },
|
||||||
|
TypeParameter = { icon = "", hl = "Type" },
|
||||||
|
StaticMethod = { icon = ' ', hl = 'Function' },
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
require("smart-splits").setup()
|
|
@ -0,0 +1 @@
|
||||||
|
require('nvim-surround').setup()
|
|
@ -0,0 +1,13 @@
|
||||||
|
local telescope = require("telescope")
|
||||||
|
telescope.setup({
|
||||||
|
extensions = {
|
||||||
|
["ui-select"] = {
|
||||||
|
require("telescope.themes").get_dropdown {}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
telescope.load_extension("fzf")
|
||||||
|
telescope.load_extension("ui-select")
|
||||||
|
telescope.load_extension("undo")
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
require("nvim-treesitter.configs").setup({
|
||||||
|
highlight = { enable = true },
|
||||||
|
})
|
|
@ -0,0 +1 @@
|
||||||
|
require("trouble").setup()
|
|
@ -0,0 +1,3 @@
|
||||||
|
vim.o.timeoutlen = 100
|
||||||
|
|
||||||
|
require("which-key").setup()
|
|
@ -0,0 +1,12 @@
|
||||||
|
local telescope_builtin = require("telescope.builtin")
|
||||||
|
local map = vim.keymap.set
|
||||||
|
|
||||||
|
map( "n", "<S-h>", "<cmd>BufferLineCyclePrev<CR>", { desc = "Prev buffer" })
|
||||||
|
map( "n", "<S-l>", "<cmd>BufferLineCycleNext<CR>", { desc = "Next buffer" })
|
||||||
|
map( {"n", "i" }, "<ESC>", "<cmd>noh<CR><ESC>",{ desc = "Escape and clear hlsearch"})
|
||||||
|
map( "n", "<Leader>ff", telescope_builtin.find_files, { desc = "Find Files" })
|
||||||
|
map( "n", "<Leader>fb", telescope_builtin.buffers, { desc = "List Buffers" })
|
||||||
|
map( "n", "<Leader>fh", telescope_builtin.help_tags, { desc = "Help Tags" })
|
||||||
|
map( "n", "<Leader>fp", telescope_builtin.git_files, { desc = "Find Files (Git)" })
|
||||||
|
map( "n", "<C-n>", "<cmd>NeoTreeFocusToggle<CR>", { desc = "Open NeoTree" })
|
||||||
|
map( {"n", "x"}, "ga", ":EasyAlign", { desc = "Align text" })
|
|
@ -0,0 +1,24 @@
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
|
-- 4 space tabs
|
||||||
|
vim.o.expandtab = true
|
||||||
|
vim.o.shiftwidth = 2
|
||||||
|
vim.o.tabstop = 2
|
||||||
|
vim.o.smartindent = true
|
||||||
|
|
||||||
|
vim.o.background = "dark"
|
||||||
|
vim.o.clipboard = "unnamedplus"
|
||||||
|
vim.o.termguicolors = true
|
||||||
|
vim.o.ignorecase = true
|
||||||
|
vim.o.smartcase = true
|
||||||
|
vim.o.lazyredraw = true
|
||||||
|
vim.o.wrap = false
|
||||||
|
vim.o.scrolloff = 8
|
||||||
|
|
||||||
|
vim.o.swapfile = false
|
||||||
|
vim.o.backup = false
|
||||||
|
vim.o.undodir = os.getenv("HOME") .. "/.local/share/nvim/undodir"
|
||||||
|
vim.o.undofile = true
|
||||||
|
|
||||||
|
vim.wo.number = true
|
||||||
|
vim.wo.relativenumber = true
|
|
@ -19,12 +19,14 @@
|
||||||
which-key-nvim
|
which-key-nvim
|
||||||
smart-splits-nvim
|
smart-splits-nvim
|
||||||
legendary-nvim
|
legendary-nvim
|
||||||
|
vim-easy-align
|
||||||
|
|
||||||
vim-fugitive
|
vim-fugitive
|
||||||
|
|
||||||
telescope-nvim
|
telescope-nvim
|
||||||
telescope-fzf-native-nvim
|
telescope-fzf-native-nvim
|
||||||
telescope-ui-select-nvim
|
telescope-ui-select-nvim
|
||||||
|
telescope-undo-nvim
|
||||||
|
|
||||||
nvim-lspconfig
|
nvim-lspconfig
|
||||||
nvim-treesitter.withAllGrammars
|
nvim-treesitter.withAllGrammars
|
||||||
|
@ -36,20 +38,26 @@
|
||||||
cmp-nvim-lsp
|
cmp-nvim-lsp
|
||||||
cmp-path
|
cmp-path
|
||||||
cmp_luasnip
|
cmp_luasnip
|
||||||
|
cmp-nvim-lsp-signature-help
|
||||||
friendly-snippets
|
friendly-snippets
|
||||||
lspkind-nvim
|
lspkind-nvim
|
||||||
];
|
];
|
||||||
|
|
||||||
extraLuaConfig = builtins.readFile ./init.lua;
|
|
||||||
|
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
|
nodePackages.bash-language-server
|
||||||
clang-tools
|
clang-tools
|
||||||
lua-language-server
|
lua-language-server
|
||||||
|
python3Packages.jedi-language-server
|
||||||
rnix-lsp
|
rnix-lsp
|
||||||
rust-analyzer
|
rust-analyzer
|
||||||
nodePackages.vscode-css-languageserver-bin
|
nodePackages.vscode-css-languageserver-bin
|
||||||
zls
|
zls
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
xdg.configFile.nvim = {
|
||||||
|
source = ./config;
|
||||||
|
recursive = true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,284 +0,0 @@
|
||||||
vim.g.mapleader = " "
|
|
||||||
|
|
||||||
-- 4 space tabs
|
|
||||||
vim.o.expandtab = true
|
|
||||||
vim.o.shiftwidth = 2
|
|
||||||
vim.o.tabstop = 2
|
|
||||||
vim.o.smartindent = true
|
|
||||||
|
|
||||||
vim.o.background = "dark"
|
|
||||||
vim.o.clipboard = "unnamedplus"
|
|
||||||
vim.o.termguicolors = true
|
|
||||||
vim.o.ignorecase = true
|
|
||||||
vim.o.smartcase = true
|
|
||||||
vim.o.lazyredraw = true
|
|
||||||
vim.o.timeoutlen = 100
|
|
||||||
|
|
||||||
vim.wo.number = true
|
|
||||||
vim.wo.relativenumber = true
|
|
||||||
|
|
||||||
require("gruvbox").setup({
|
|
||||||
transparent_mode = true
|
|
||||||
})
|
|
||||||
vim.cmd("colorscheme gruvbox")
|
|
||||||
|
|
||||||
require("lualine").setup({
|
|
||||||
options = {
|
|
||||||
theme = "gruvbox_dark",
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
require("dressing").setup()
|
|
||||||
|
|
||||||
require("bufferline").setup({
|
|
||||||
options = {
|
|
||||||
show_tab_indicators = true,
|
|
||||||
-- separator_style = { "", "" },
|
|
||||||
indicator = { style = "icon", icon = "▎" },
|
|
||||||
color_icons = true,
|
|
||||||
offsets = {
|
|
||||||
{
|
|
||||||
filetype = "neo-tree",
|
|
||||||
text = "File Explorer",
|
|
||||||
text_align = "center",
|
|
||||||
separator = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
require("colorizer").setup({})
|
|
||||||
require("nvim-autopairs").setup({})
|
|
||||||
require("Comment").setup({})
|
|
||||||
|
|
||||||
require("neo-tree").setup({
|
|
||||||
default_component_configs = {
|
|
||||||
icon = {
|
|
||||||
folder_empty = "",
|
|
||||||
folder_empty_open = "",
|
|
||||||
},
|
|
||||||
git_status = {
|
|
||||||
symbols = {
|
|
||||||
renamed = "",
|
|
||||||
unstaged = "",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
document_symbols = {
|
|
||||||
kinds = {
|
|
||||||
File = { icon = "", hl = "Tag" },
|
|
||||||
Namespace = { icon = "", hl = "Include" },
|
|
||||||
Package = { icon = "", hl = "Label" },
|
|
||||||
Class = { icon = "", hl = "Include" },
|
|
||||||
Property = { icon = "", hl = "@property" },
|
|
||||||
Enum = { icon = "", hl = "@number" },
|
|
||||||
Function = { icon = "", hl = "Function" },
|
|
||||||
String = { icon = "", hl = "String" },
|
|
||||||
Number = { icon = "", hl = "Number" },
|
|
||||||
Array = { icon = "", hl = "Type" },
|
|
||||||
Object = { icon = "", hl = "Type" },
|
|
||||||
Key = { icon = "", hl = "" },
|
|
||||||
Struct = { icon = "", hl = "Type" },
|
|
||||||
Operator = { icon = "", hl = "Operator" },
|
|
||||||
TypeParameter = { icon = "", hl = "Type" },
|
|
||||||
StaticMethod = { icon = ' ', hl = 'Function' },
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
require("nvim-treesitter.configs").setup({
|
|
||||||
highlight = { enable = true, },
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
require("smart-splits").setup()
|
|
||||||
|
|
||||||
require("trouble").setup()
|
|
||||||
|
|
||||||
local telescope = require("telescope")
|
|
||||||
telescope.setup({
|
|
||||||
extensions = {
|
|
||||||
["ui-select"] = {
|
|
||||||
require("telescope.themes").get_dropdown {}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
local telescope_builtin = require("telescope.builtin")
|
|
||||||
telescope.load_extension("fzf")
|
|
||||||
telescope.load_extension("ui-select")
|
|
||||||
|
|
||||||
require('nvim-surround').setup()
|
|
||||||
|
|
||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
|
||||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
|
||||||
|
|
||||||
local lspconfig = require("lspconfig")
|
|
||||||
|
|
||||||
lspconfig.rnix.setup { capabilities = capabilities }
|
|
||||||
|
|
||||||
lspconfig.lua_ls.setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
runtime = { version = "LuaJIT" },
|
|
||||||
diagnostics = { globals = { "vim" } },
|
|
||||||
workspace = {
|
|
||||||
library = vim.api.nvim_get_runtime_file("", true),
|
|
||||||
checkThirdParty = false
|
|
||||||
},
|
|
||||||
telemetry = { enable = false },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
lspconfig.clangd.setup { capabilities = capabilities }
|
|
||||||
lspconfig.rust_analyzer.setup { capabilities = capabilities }
|
|
||||||
lspconfig.zls.setup { capabilities = capabilities }
|
|
||||||
|
|
||||||
lspconfig.cssls.setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
cmd = { "css-languageserver", "--stdio" },
|
|
||||||
settings = {
|
|
||||||
css = { validate = false },
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
|
||||||
|
|
||||||
local has_words_before = function()
|
|
||||||
unpack = unpack or table.unpack
|
|
||||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
|
||||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
|
||||||
end
|
|
||||||
|
|
||||||
local cmp = require("cmp")
|
|
||||||
|
|
||||||
local lspkind = require("lspkind")
|
|
||||||
local luasnip = require("luasnip")
|
|
||||||
cmp.setup({
|
|
||||||
preselect = cmp.PreselectMode.None,
|
|
||||||
formatting = {
|
|
||||||
format = lspkind.cmp_format({
|
|
||||||
mode = "symbol_text",
|
|
||||||
|
|
||||||
symbol_map = {
|
|
||||||
Text = "",
|
|
||||||
Method = "",
|
|
||||||
Function = "",
|
|
||||||
Constructor = "",
|
|
||||||
Field = "",
|
|
||||||
Variable = "",
|
|
||||||
Class = "",
|
|
||||||
Interface = "",
|
|
||||||
Module = "",
|
|
||||||
Property = "",
|
|
||||||
Unit = "",
|
|
||||||
Value = "",
|
|
||||||
Enum = "",
|
|
||||||
Keyword = "",
|
|
||||||
Snippet = "",
|
|
||||||
Color = "",
|
|
||||||
File = "",
|
|
||||||
Reference = "",
|
|
||||||
Folder = "",
|
|
||||||
EnumMember = "",
|
|
||||||
Constant = "",
|
|
||||||
Struct = "",
|
|
||||||
Event = "",
|
|
||||||
Operator = "",
|
|
||||||
TypeParameter = ""
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
require('luasnip').lsp_expand(args.body)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
window = {
|
|
||||||
completion = cmp.config.window.bordered(),
|
|
||||||
documentation = cmp.config.window.bordered(),
|
|
||||||
},
|
|
||||||
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = "buffer" },
|
|
||||||
{ name = "path" },
|
|
||||||
{ name = "nvim_lsp" },
|
|
||||||
{ name = "luasnip" },
|
|
||||||
}),
|
|
||||||
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
|
||||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
|
||||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
|
||||||
['<C-e>'] = cmp.mapping.abort(),
|
|
||||||
['<CR>'] = cmp.mapping.confirm({ select = false }),
|
|
||||||
|
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_next_item()
|
|
||||||
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
|
|
||||||
-- they way you will only jump inside the snippet region
|
|
||||||
elseif luasnip.expand_or_locally_jumpable() then
|
|
||||||
luasnip.expand_or_jump()
|
|
||||||
elseif has_words_before() then
|
|
||||||
cmp.complete()
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, { "i", "s" }),
|
|
||||||
|
|
||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_prev_item()
|
|
||||||
elseif luasnip.jumpable(-1) then
|
|
||||||
luasnip.jump(-1)
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, { "i", "s" }),
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
|
|
||||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
|
||||||
cmp.event:on(
|
|
||||||
'confirm_done',
|
|
||||||
cmp_autopairs.on_confirm_done()
|
|
||||||
)
|
|
||||||
|
|
||||||
cmp.setup.cmdline(":", {
|
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = "path" },
|
|
||||||
{ name = "cmdline" },
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
cmp.setup.cmdline("/", {
|
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = "buffer" },
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
-- keymaps
|
|
||||||
require("which-key").setup()
|
|
||||||
require("legendary").setup({
|
|
||||||
keymaps = {
|
|
||||||
{ "<S-h>", "<cmd>BufferLineCyclePrev<CR>", description = "Prev buffer" },
|
|
||||||
{ "<S-l>", "<cmd>BufferLineCycleNext<CR>", description = "Next buffer" },
|
|
||||||
{ "<ESC>", "<cmd>noh<CR><ESC>", description = "Escape and clear hlsearch", mode = { "n", "i" } },
|
|
||||||
{ "<Leader>ff", telescope_builtin.find_files, description = "Find Files" },
|
|
||||||
{ "<Leader>fg", telescope_builtin.live_grep, description = "Live Grep" },
|
|
||||||
{ "<Leader>fb", telescope_builtin.buffers, description = "List Buffers" },
|
|
||||||
{ "<Leader>fh", telescope_builtin.help_tags, description = "Help Tags" },
|
|
||||||
{ "<Leader>fc", telescope_builtin.git_files, description = "Find Files (Git)" },
|
|
||||||
{ "<C-n>", "<cmd>NeoTreeFocusToggle<CR>", description = "Open NeoTree" },
|
|
||||||
},
|
|
||||||
|
|
||||||
extensions = {
|
|
||||||
smart_splits = {},
|
|
||||||
}
|
|
||||||
})
|
|
|
@ -137,7 +137,7 @@ in
|
||||||
exec-once = ${xwaylandSetPrimary}/bin/xwayland-setprimary.sh
|
exec-once = ${xwaylandSetPrimary}/bin/xwayland-setprimary.sh
|
||||||
exec-once = ${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1
|
exec-once = ${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1
|
||||||
exec-once = ${pkgs.swww}/bin/swww-daemon
|
exec-once = ${pkgs.swww}/bin/swww-daemon
|
||||||
exec-once = ${pkgs.arrpc}/bin/arRPC
|
exec-once = $pkgs.arrpc}/bin/arRPC
|
||||||
|
|
||||||
exec = ${wob-voldaemon}/bin/wob-volumeindicator.sh;
|
exec = ${wob-voldaemon}/bin/wob-volumeindicator.sh;
|
||||||
exec = pkill waybar; ${pkgs.waybar_hyprland}/bin/waybar
|
exec = pkill waybar; ${pkgs.waybar_hyprland}/bin/waybar
|
||||||
|
@ -171,7 +171,7 @@ in
|
||||||
bind = ${modKey}, F, fullscreen
|
bind = ${modKey}, F, fullscreen
|
||||||
|
|
||||||
bind = ${modKey} SHIFT, Q, killactive
|
bind = ${modKey} SHIFT, Q, killactive
|
||||||
bind = ${modKey}, D, exec, ${pkgs.rofi-wayland}/bin/rofi -show drun -show-icons
|
bind = ${modKey}, D, exec, ${pkgs.rofi-wayland}/bin/rofi -show drun -p Applications -show-icons
|
||||||
|
|
||||||
bind = ${modKey}, Q, exec, ${pkgs.firefox}/bin/firefox
|
bind = ${modKey}, Q, exec, ${pkgs.firefox}/bin/firefox
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, inputs, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./configs/beets
|
./configs/beets
|
||||||
|
|
Reference in New Issue