Refactor directory structure
This commit is contained in:
9
modules/home/cli/common/default.nix
Normal file
9
modules/home/cli/common/default.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./git.nix
|
||||
./shell.nix
|
||||
./helix.nix
|
||||
];
|
||||
}
|
23
modules/home/cli/common/git.nix
Normal file
23
modules/home/cli/common/git.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.lazygit = {
|
||||
enable = true;
|
||||
settings = {
|
||||
services = {
|
||||
"gitea.xeovalyte.dev" = "gitea:gitea.xeovalyte.dev";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userEmail = "me+gitea@xeovalyte.dev";
|
||||
userName = "xeovalyte";
|
||||
extraConfig = {
|
||||
commit.gpgsign = true;
|
||||
gpg.format = "ssh";
|
||||
user.signingkey = "~/.ssh/gitea.pub";
|
||||
};
|
||||
};
|
||||
}
|
113
modules/home/cli/common/helix.nix
Normal file
113
modules/home/cli/common/helix.nix
Normal file
@@ -0,0 +1,113 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.helix = {
|
||||
enable = true;
|
||||
package = pkgs.unstable.helix;
|
||||
defaultEditor = true;
|
||||
settings = {
|
||||
theme = "base16";
|
||||
editor.cursor-shape = {
|
||||
insert = "bar";
|
||||
};
|
||||
};
|
||||
languages = {
|
||||
language-server.rust-analyzer.config = {
|
||||
cargo = {
|
||||
features = "all";
|
||||
};
|
||||
};
|
||||
};
|
||||
themes = {
|
||||
base16 = let
|
||||
base00 = "#${config.colorScheme.palette.base00}";
|
||||
base01 = "#${config.colorScheme.palette.base01}";
|
||||
base02 = "#${config.colorScheme.palette.base02}";
|
||||
base03 = "#${config.colorScheme.palette.base03}";
|
||||
base04 = "#${config.colorScheme.palette.base04}";
|
||||
base05 = "#${config.colorScheme.palette.base05}";
|
||||
base06 = "#${config.colorScheme.palette.base06}";
|
||||
base07 = "#${config.colorScheme.palette.base07}";
|
||||
base08 = "#${config.colorScheme.palette.base08}";
|
||||
base09 = "#${config.colorScheme.palette.base09}";
|
||||
base0A = "#${config.colorScheme.palette.base0A}";
|
||||
base0B = "#${config.colorScheme.palette.base0B}";
|
||||
base0C = "#${config.colorScheme.palette.base0C}";
|
||||
base0D = "#${config.colorScheme.palette.base0D}";
|
||||
base0E = "#${config.colorScheme.palette.base0E}";
|
||||
base0F = "#${config.colorScheme.palette.base0F}";
|
||||
in {
|
||||
"attributes" = base09;
|
||||
"comment" = { fg = base03; modifiers = ["italic"]; };
|
||||
"constant" = base09;
|
||||
"constant.character.escape" = base0C;
|
||||
"constant.numeric" = base09;
|
||||
"constructor" = base0D;
|
||||
"debug" = base03;
|
||||
"diagnostic" = { modifiers = ["underlined"]; };
|
||||
"diff.delta" = base09;
|
||||
"diff.minus" = base08;
|
||||
"diff.plus" = base0B;
|
||||
"error" = base08;
|
||||
"function" = base0D;
|
||||
"hint" = base03;
|
||||
"info" = base0D;
|
||||
"keyword" = base0E;
|
||||
"label" = base0E;
|
||||
"namespace" = base0E;
|
||||
"operator" = base05;
|
||||
"special" = base0D;
|
||||
"string" = base0B;
|
||||
"type" = base0A;
|
||||
"variable" = base08;
|
||||
"variable.other.member" = base0B;
|
||||
"warning" = base09;
|
||||
|
||||
"markup.bold" = { fg = base0A; modifiers = ["bold"]; };
|
||||
"markup.heading" = base0D;
|
||||
"markup.italic" = { fg = base0E; modifiers = ["italic"]; };
|
||||
"markup.link.text" = base08;
|
||||
"markup.link.url" = { fg = base09; modifiers = ["underlined"]; };
|
||||
"markup.list" = base08;
|
||||
"markup.quote" = base0C;
|
||||
"markup.raw" = base0B;
|
||||
"markup.strikethrough" = { modifiers = ["crossed_out"]; };
|
||||
|
||||
"diagnostic.hint" = { underline = { style = "curl"; }; };
|
||||
"diagnostic.info" = { underline = { style = "curl"; }; };
|
||||
"diagnostic.warning" = { underline = { style = "curl"; }; };
|
||||
"diagnostic.error" = { underline = { style = "curl"; }; };
|
||||
|
||||
# "ui.background" = { bg = base00; };
|
||||
"ui.bufferline.active" = { fg = base00; bg = base03; modifiers = ["bold"]; };
|
||||
"ui.bufferline" = { fg = base04; bg = base00; };
|
||||
"ui.cursor" = { fg = base0A; modifiers = ["reversed"]; };
|
||||
"ui.cursor.insert" = { fg = base0A; modifiers = ["reversed"]; };
|
||||
"ui.cursorline.primary" = { fg = base05; bg = base01; };
|
||||
"ui.cursor.match" = { fg = base0A; modifiers = ["reversed"]; };
|
||||
"ui.cursor.select" = { fg = base0A; modifiers = ["reversed"]; };
|
||||
"ui.gutter" = { bg = base00; };
|
||||
"ui.help" = { fg = base06; bg = base01; };
|
||||
"ui.linenr" = { fg = base03; bg = base00; };
|
||||
"ui.linenr.selected" = { fg = base04; bg = base01; modifiers = ["bold"]; };
|
||||
"ui.menu" = { fg = base05; bg = base01; };
|
||||
"ui.menu.scroll" = { fg = base03; bg = base01; };
|
||||
"ui.menu.selected" = { fg = base01; bg = base04; };
|
||||
"ui.popup" = { bg = base01; };
|
||||
"ui.selection" = { bg = base02; };
|
||||
"ui.selection.primary" = { bg = base02; };
|
||||
"ui.statusline" = { fg = base04; bg = base01; };
|
||||
"ui.statusline.inactive" = { bg = base01; fg = base03; };
|
||||
"ui.statusline.insert" = { fg = base00; bg = base0B; };
|
||||
"ui.statusline.normal" = { fg = base00; bg = base03; };
|
||||
"ui.statusline.select" = { fg = base00; bg = base0F; };
|
||||
"ui.text" = base05;
|
||||
"ui.text.focus" = base05;
|
||||
"ui.virtual.indent-guide" = { fg = base03; };
|
||||
"ui.virtual.inlay-hint" = { fg = base01; };
|
||||
"ui.virtual.ruler" = { bg = base01; };
|
||||
"ui.window" = { bg = base01; };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
40
modules/home/cli/common/shell.nix
Normal file
40
modules/home/cli/common/shell.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
eza
|
||||
bat
|
||||
];
|
||||
|
||||
home.shellAliases = {
|
||||
ls = "eza";
|
||||
};
|
||||
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
};
|
||||
|
||||
programs.zellij = {
|
||||
enable = true;
|
||||
# enableBashIntegration = true;
|
||||
};
|
||||
|
||||
home.file.zellij = {
|
||||
target = ".config/zellij/config.kdl";
|
||||
text = ''
|
||||
pane_frames false
|
||||
default_layout "compact"
|
||||
keybinds {
|
||||
normal {
|
||||
bind "Ctrl e" { ToggleFloatingPanes; SwitchToMode "normal"; }
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
24
modules/home/cli/neovim/autocmd.lua
Normal file
24
modules/home/cli/neovim/autocmd.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
local api = vim.api
|
||||
|
||||
api.nvim_create_autocmd(
|
||||
"FileType",
|
||||
{ pattern = "markdown", command = "setlocal spell" }
|
||||
)
|
||||
|
||||
api.nvim_create_autocmd(
|
||||
"FileType",
|
||||
{ pattern = "markdown", command = "setlocal complete+=kspell" }
|
||||
)
|
||||
|
||||
api.nvim_create_autocmd({
|
||||
"BufNewFile", "BufRead"
|
||||
},
|
||||
{ pattern = "*.mcfunction", command = "set filetype=mcfunction" }
|
||||
)
|
||||
|
||||
api.nvim_create_autocmd({
|
||||
|
||||
"VimEnter"
|
||||
},
|
||||
{ callback = require('lualine').setup }
|
||||
)
|
4
modules/home/cli/neovim/colorscheme.lua
Normal file
4
modules/home/cli/neovim/colorscheme.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
require('onedark').setup {
|
||||
style = 'deep'
|
||||
}
|
||||
require('onedark').load()
|
132
modules/home/cli/neovim/default.nix
Normal file
132
modules/home/cli/neovim/default.nix
Normal file
@@ -0,0 +1,132 @@
|
||||
{
|
||||
inputs,
|
||||
outputs,
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
ripgrep
|
||||
marksman
|
||||
wl-clipboard
|
||||
nodejs_20
|
||||
];
|
||||
|
||||
programs.neovim =
|
||||
let
|
||||
toLua = str: "lua << EOF\n${str}\nEOF\n";
|
||||
toLuaFile = file: "lua << EOF\n${builtins.readFile file}\nEOF\n";
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
coc = {
|
||||
enable = false;
|
||||
settings = {
|
||||
languageserver = {
|
||||
arduino = {
|
||||
command = ["steam-run" "arduino-language-server"];
|
||||
rootPatterns = ["*.ino"];
|
||||
filetypes = ["arduino"];
|
||||
args = ["-cli" "steam-run" "arduino-cli" "-clangd" "steam-run" "clangd" "-cli-config" "/home/xeovalyte/.arduino15/arduino-cli.yaml"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
vimdiffAlias = true;
|
||||
|
||||
extraLuaConfig = ''
|
||||
${builtins.readFile ./options.lua}
|
||||
${builtins.readFile ./keymaps.lua}
|
||||
${builtins.readFile ./autocmd.lua}
|
||||
'';
|
||||
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
nvim-web-devicons
|
||||
|
||||
{
|
||||
plugin = nvim-autopairs;
|
||||
config = toLua "require(\"nvim-autopairs\").setup{}";
|
||||
}
|
||||
|
||||
{
|
||||
plugin = telescope-nvim;
|
||||
}
|
||||
plenary-nvim
|
||||
|
||||
{
|
||||
plugin = nvim-lspconfig;
|
||||
config = toLuaFile ./plugins/lsp.lua;
|
||||
}
|
||||
neodev-nvim
|
||||
mason-nvim
|
||||
mason-lspconfig-nvim
|
||||
which-key-nvim
|
||||
rustaceanvim
|
||||
lsp-inlayhints-nvim
|
||||
nvim-dap
|
||||
|
||||
{
|
||||
plugin = markdown-preview-nvim;
|
||||
config = toLuaFile ./plugins/markdown-preview.lua;
|
||||
}
|
||||
|
||||
{
|
||||
plugin = nvim-cmp;
|
||||
config = toLuaFile ./plugins/cmp.lua;
|
||||
}
|
||||
cmp_luasnip
|
||||
cmp-nvim-lsp
|
||||
luasnip
|
||||
friendly-snippets
|
||||
|
||||
{
|
||||
plugin = nvim-tree-lua;
|
||||
config = toLuaFile ./plugins/nvim-tree.lua;
|
||||
}
|
||||
|
||||
{
|
||||
plugin = toggleterm-nvim;
|
||||
config = toLuaFile ./plugins/toggleterm.lua;
|
||||
}
|
||||
|
||||
{
|
||||
plugin = (nvim-treesitter.withPlugins (p: [
|
||||
p.tree-sitter-nix
|
||||
p.tree-sitter-bash
|
||||
p.tree-sitter-json
|
||||
p.tree-sitter-rust
|
||||
p.tree-sitter-vue
|
||||
p.tree-sitter-arduino
|
||||
p.tree-sitter-html
|
||||
p.tree-sitter-css
|
||||
p.tree-sitter-javascript
|
||||
]));
|
||||
config = toLuaFile ./plugins/treesitter.lua;
|
||||
}
|
||||
|
||||
{
|
||||
plugin = onedark-nvim;
|
||||
config = toLuaFile ./colorscheme.lua;
|
||||
}
|
||||
|
||||
{
|
||||
plugin = presence-nvim;
|
||||
config = toLua "require(\"presence\").setup()";
|
||||
}
|
||||
|
||||
{
|
||||
plugin = lualine-nvim;
|
||||
config = toLuaFile ./plugins/lualine.lua;
|
||||
}
|
||||
|
||||
{
|
||||
plugin =harpoon;
|
||||
config = toLuaFile ./plugins/harpoon.lua;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
90
modules/home/cli/neovim/keymaps.lua
Normal file
90
modules/home/cli/neovim/keymaps.lua
Normal file
@@ -0,0 +1,90 @@
|
||||
local function map(mode, lhs, rhs, opts)
|
||||
opts = opts or {}
|
||||
opts.silent = opts.silent ~= false
|
||||
if opts.remap and not vim.g.vscode then
|
||||
opts.remap = nil
|
||||
end
|
||||
vim.keymap.set(mode, lhs, rhs, opts)
|
||||
end
|
||||
|
||||
-- better up/down
|
||||
map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
|
||||
-- Move to window using the <ctrl> hjkl keys
|
||||
map("n", "<C-h>", "<C-w>h", { desc = "Go to left window", remap = true })
|
||||
map("n", "<C-j>", "<C-w>j", { desc = "Go to lower window", remap = true })
|
||||
map("n", "<C-k>", "<C-w>k", { desc = "Go to upper window", remap = true })
|
||||
map("n", "<C-l>", "<C-w>l", { desc = "Go to right window", remap = true })
|
||||
|
||||
-- Resize window using <ctrl> arrow keys
|
||||
map("n", "<C-Up>", "<cmd>resize +2<cr>", { desc = "Increase window height" })
|
||||
map("n", "<C-Down>", "<cmd>resize -2<cr>", { desc = "Decrease window height" })
|
||||
map("n", "<C-Left>", "<cmd>vertical resize -2<cr>", { desc = "Decrease window width" })
|
||||
map("n", "<C-Right>", "<cmd>vertical resize +2<cr>", { desc = "Increase window width" })
|
||||
|
||||
-- Move Lines
|
||||
map("n", "<A-j>", "<cmd>m .+1<cr>==", { desc = "Move down" })
|
||||
map("n", "<A-k>", "<cmd>m .-2<cr>==", { desc = "Move up" })
|
||||
map("i", "<A-j>", "<esc><cmd>m .+1<cr>==gi", { desc = "Move down" })
|
||||
map("i", "<A-k>", "<esc><cmd>m .-2<cr>==gi", { desc = "Move up" })
|
||||
map("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move down" })
|
||||
map("v", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move up" })
|
||||
|
||||
-- Clear search with <esc>
|
||||
map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and clear hlsearch" })
|
||||
|
||||
-- Clear search, diff update and redraw
|
||||
-- taken from runtime/lua/_editor.lua
|
||||
map(
|
||||
"n",
|
||||
"<leader>ur",
|
||||
"<Cmd>nohlsearch<Bar>diffupdate<Bar>normal! <C-L><CR>",
|
||||
{ desc = "Redraw / clear hlsearch / diff update" }
|
||||
)
|
||||
|
||||
-- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n
|
||||
map("n", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
|
||||
map("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
|
||||
map("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
|
||||
map("n", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
|
||||
map("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
|
||||
map("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
|
||||
|
||||
-- Add undo break-points
|
||||
map("i", ",", ",<c-g>u")
|
||||
map("i", ".", ".<c-g>u")
|
||||
map("i", ";", ";<c-g>u")
|
||||
|
||||
-- save file
|
||||
map({ "i", "x", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" })
|
||||
|
||||
--keywordprg
|
||||
map("n", "<leader>K", "<cmd>norm! K<cr>", { desc = "Keywordprg" })
|
||||
|
||||
-- better indenting
|
||||
map("v", "<", "<gv")
|
||||
map("v", ">", ">gv")
|
||||
|
||||
-- new file
|
||||
map("n", "<leader>fn", "<cmd>enew<cr>", { desc = "New File" })
|
||||
|
||||
-- Toggle NeoTree
|
||||
map("n", "<leader>e", "<cmd>NvimTreeToggle<cr>", { desc = "Toggle file explorer" })
|
||||
|
||||
-- Telescope
|
||||
map("n", "<leader>ff", "<cmd>Telescope find_files<cr>", { desc = "Telescope find files" })
|
||||
map("n", "<leader>fg", "<cmd>Telescope live_grep<cr>", { desc = "Telescope find files" })
|
||||
map("n", "<leader>fb", "<cmd>Telescope buffers<cr>", { desc = "Telescope find files" })
|
||||
|
||||
-- LSP
|
||||
map("n", "gl", "<cmd>lua vim.diagnostic.open_float()<cr>", { desc = "Show diagnostics" })
|
||||
map("n", "gd", "<cmd>lua vim.lsp.buf.definition()<cr>", { desc = "Show diagnostics" })
|
||||
map("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<cr>", { desc = "Show diagnostics" })
|
||||
map("n", "K", "<cmd>lua vim.lsp.buf.hover()<cr>", { desc = "Show diagnostics" })
|
||||
|
||||
-- Buffers
|
||||
map("n", "<Tab>", "<cmd>bn<cr>", { desc = "Cycle to next buffer" })
|
||||
map("n", "<S-Tab>", "<cmd>bp<cr>", { desc = "Cycle to previous buffer" })
|
||||
map("n", "bq", "<cmd>b#|bd#<cr>", { desc = "Close current buffer" })
|
||||
map("n", "<leader>bq", "<cmd>BufferLineCloseOthers<cr>", { desc = "Close all other buffers" })
|
57
modules/home/cli/neovim/options.lua
Normal file
57
modules/home/cli/neovim/options.lua
Normal file
@@ -0,0 +1,57 @@
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
|
||||
local opt = vim.opt
|
||||
|
||||
opt.autowrite = true -- Enable auto write
|
||||
opt.clipboard = "unnamedplus" -- Sync with system clipboard
|
||||
opt.completeopt = "menu,menuone,noselect"
|
||||
opt.conceallevel = 3 -- Hide * markup for bold and italic
|
||||
opt.confirm = true -- Confirm to save changes before exiting modified buffer
|
||||
opt.cursorline = true -- Enable highlighting of the current line
|
||||
opt.expandtab = true -- Use spaces instead of tabs
|
||||
opt.formatoptions = "jcroqlnt" -- tcqj
|
||||
opt.grepformat = "%f:%l:%c:%m"
|
||||
opt.grepprg = "rg --vimgrep"
|
||||
opt.ignorecase = true -- Ignore case
|
||||
opt.inccommand = "nosplit" -- preview incremental substitute
|
||||
opt.laststatus = 0
|
||||
opt.list = true -- Show some invisible characters (tabs...
|
||||
opt.mouse = "a" -- Enable mouse mode
|
||||
opt.number = true -- Print line number
|
||||
opt.pumblend = 10 -- Popup blend
|
||||
opt.pumheight = 10 -- Maximum number of entries in a popup
|
||||
opt.relativenumber = true -- Relative line numbers
|
||||
opt.scrolloff = 4 -- Lines of context
|
||||
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" }
|
||||
opt.shiftround = true -- Round indent
|
||||
opt.shiftwidth = 2 -- Size of an indent
|
||||
opt.shortmess:append({ W = true, I = true, c = true })
|
||||
opt.showmode = true -- Dont show mode since we have a statusline
|
||||
opt.sidescrolloff = 8 -- Columns of context
|
||||
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
|
||||
opt.smartcase = true -- Don't ignore case with capitals
|
||||
opt.smartindent = true -- Insert indents automatically
|
||||
opt.spelllang = { "en", "nl" }
|
||||
opt.spell = false -- Enable spell
|
||||
opt.splitbelow = true -- Put new windows below current
|
||||
opt.splitright = true -- Put new windows right of current
|
||||
opt.tabstop = 2 -- Number of spaces tabs count for
|
||||
opt.termguicolors = true -- True color support
|
||||
opt.timeoutlen = 300
|
||||
opt.undofile = true
|
||||
opt.undolevels = 10000
|
||||
opt.updatetime = 200 -- Save swap file and trigger CursorHold
|
||||
opt.wildmode = "longest:full,full" -- Command-line completion mode
|
||||
opt.winminwidth = 5 -- Minimum window width
|
||||
opt.wrap = false -- Disable line wrap
|
||||
|
||||
if vim.fn.has("nvim-0.9.0") == 1 then
|
||||
opt.splitkeep = "screen"
|
||||
opt.shortmess:append({ C = true })
|
||||
end
|
||||
|
||||
-- Fix markdown indentation settings
|
||||
vim.g.markdown_recommended_style = 0
|
||||
|
||||
vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]]
|
12
modules/home/cli/neovim/plugins/bufferline.lua
Normal file
12
modules/home/cli/neovim/plugins/bufferline.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
require('bufferline').setup{
|
||||
options = {
|
||||
offsets = {
|
||||
{
|
||||
filetype = "NvimTree",
|
||||
text = "File Explorer",
|
||||
highlight = "Directory",
|
||||
separator = true -- use a "true" to enable the default, or set your own character
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
46
modules/home/cli/neovim/plugins/cmp.lua
Normal file
46
modules/home/cli/neovim/plugins/cmp.lua
Normal file
@@ -0,0 +1,46 @@
|
||||
local cmp = require('cmp')
|
||||
local luasnip = require('luasnip')
|
||||
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
luasnip.config.setup {}
|
||||
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete {},
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
},
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_locally_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
},
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
},
|
||||
}
|
10
modules/home/cli/neovim/plugins/harpoon.lua
Normal file
10
modules/home/cli/neovim/plugins/harpoon.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
local mark = require('harpoon.mark')
|
||||
local ui = require('harpoon.ui')
|
||||
|
||||
vim.keymap.set("n", "<leader>q", mark.add_file)
|
||||
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
|
||||
|
||||
vim.keymap.set("n", "<C-h>", function() ui.nav_file(1) end)
|
||||
vim.keymap.set("n", "<C-t>", function() ui.nav_file(2) end)
|
||||
vim.keymap.set("n", "<C-n>", function() ui.nav_file(3) end)
|
||||
vim.keymap.set("n", "<C-s>", function() ui.nav_file(4) end)
|
57
modules/home/cli/neovim/plugins/lsp.lua
Normal file
57
modules/home/cli/neovim/plugins/lsp.lua
Normal file
@@ -0,0 +1,57 @@
|
||||
require("mason").setup{
|
||||
PATH = "append",
|
||||
}
|
||||
require("mason-lspconfig").setup()
|
||||
require('neodev').setup()
|
||||
require('lsp-inlayhints').setup()
|
||||
|
||||
local lspconfig = require('lspconfig')
|
||||
|
||||
vim.g.rustaceanvim = {
|
||||
tools = {
|
||||
hover_actions = {
|
||||
auto_focus = true,
|
||||
},
|
||||
},
|
||||
server = {
|
||||
on_attach = function(client, bufnr)
|
||||
require("lsp-inlayhints").on_attach(client, bufnr)
|
||||
require("lsp-inlayhints").show()
|
||||
end,
|
||||
default_settings = {
|
||||
['rust-analyzer'] = {
|
||||
cargo = {
|
||||
features = "all"
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
lspconfig.tsserver.setup{}
|
||||
|
||||
lspconfig.spyglassmc_language_server.setup{
|
||||
cmd = {
|
||||
"/home/xeovalyte/.npm-global/bin/spyglassmc-language-server", "--stdio"
|
||||
}
|
||||
}
|
||||
|
||||
lspconfig.arduino_language_server.setup{
|
||||
cmd = {
|
||||
"steam-run","arduino-language-server",
|
||||
"-cli-config", "/home/xeovalyte/.arduino15/arduino-cli.yaml",
|
||||
"-cli", "/usr/bin/arduino-cli",
|
||||
"-clangd", "steam-run clangd"
|
||||
}
|
||||
}
|
||||
|
||||
lspconfig.tailwindcss.setup{
|
||||
filetypes = {
|
||||
"rust",
|
||||
"css",
|
||||
}
|
||||
}
|
||||
|
||||
lspconfig.volar.setup{}
|
||||
|
||||
lspconfig.marksman.setup{}
|
40
modules/home/cli/neovim/plugins/lualine.lua
Normal file
40
modules/home/cli/neovim/plugins/lualine.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'auto',
|
||||
component_separators = { left = '', right = ''},
|
||||
section_separators = { left = '', right = ''},
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = true,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
}
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {'mode'},
|
||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'encoding', 'fileformat', 'filetype'},
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location'}
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'location'},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {}
|
||||
}
|
2
modules/home/cli/neovim/plugins/markdown-preview.lua
Normal file
2
modules/home/cli/neovim/plugins/markdown-preview.lua
Normal file
@@ -0,0 +1,2 @@
|
||||
vim.g.mkdp_auto_start = 0
|
||||
vim.g.mkdp_auto_close = 0
|
20
modules/home/cli/neovim/plugins/nvim-tree.lua
Normal file
20
modules/home/cli/neovim/plugins/nvim-tree.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
local function my_on_attach(bufnr)
|
||||
local api = require "nvim-tree.api"
|
||||
|
||||
local function opts(desc)
|
||||
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
|
||||
end
|
||||
|
||||
-- default mappings
|
||||
api.config.mappings.default_on_attach(bufnr)
|
||||
|
||||
-- custom mappings
|
||||
vim.keymap.set('n', '<C-t>', api.tree.change_root_to_parent, opts('Up'))
|
||||
vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help'))
|
||||
vim.keymap.set('n', '.', api.tree.change_root_to_node, opts('CD'))
|
||||
end
|
||||
|
||||
-- pass to setup along with your other options
|
||||
require("nvim-tree").setup {
|
||||
on_attach = my_on_attach,
|
||||
}
|
7
modules/home/cli/neovim/plugins/toggleterm.lua
Normal file
7
modules/home/cli/neovim/plugins/toggleterm.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
require("toggleterm").setup{
|
||||
open_mapping = [[<c-\>]],
|
||||
direction = 'float',
|
||||
float_opts = {
|
||||
border = 'curved'
|
||||
}
|
||||
}
|
9
modules/home/cli/neovim/plugins/treesitter.lua
Normal file
9
modules/home/cli/neovim/plugins/treesitter.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
require("nvim-treesitter.configs").setup{
|
||||
ensure_installed = {},
|
||||
|
||||
auto_install = false,
|
||||
|
||||
highlight = { enable = true },
|
||||
|
||||
indent = { enable = true },
|
||||
}
|
21
modules/home/cli/ssh.nix
Normal file
21
modules/home/cli/ssh.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
matchBlocks = {
|
||||
archserver = {
|
||||
hostname = "192.168.1.20";
|
||||
user = "xeovalyte";
|
||||
identityFile = "~/.ssh/archserver";
|
||||
};
|
||||
|
||||
"gitea.xeovalyte.dev" = {
|
||||
hostname = "gitea.xeovalyte.dev";
|
||||
port = 2222;
|
||||
user = "git";
|
||||
identityFile = "~/.ssh/gitea";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user