my first commit
This commit is contained in:
290
nixos/configuration.nix
Normal file
290
nixos/configuration.nix
Normal file
@@ -0,0 +1,290 @@
|
|||||||
|
#qm Edit this configuration file to define what should be installed on
|
||||||
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
|
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ # Include the results of the hardware scan.
|
||||||
|
./hardware-configuration.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.sessionVariables = {
|
||||||
|
GTK_IM_MODULE = "fcitx";
|
||||||
|
QT_IM_MODULE = "fcitx";
|
||||||
|
XMODIFIERS = "@im=fcitx";
|
||||||
|
SDL_IM_MODULE = "fcitx";
|
||||||
|
GLFW_IM_MODULE = "ibus"; # helps some Wayland apps behave better
|
||||||
|
};
|
||||||
|
# Bluetooth
|
||||||
|
|
||||||
|
hardware.bluetooth.enable = true;
|
||||||
|
hardware.bluetooth. powerOnBoot = true;
|
||||||
|
services.blueman.enable = true;
|
||||||
|
services.dbus.enable = true;
|
||||||
|
|
||||||
|
|
||||||
|
documentation.enable = true;
|
||||||
|
documentation.man.enable = true;
|
||||||
|
documentation.dev.enable = true;
|
||||||
|
|
||||||
|
|
||||||
|
# Bootloader.
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
networking.hostName = "nixos"; # Define your hostname.
|
||||||
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||||
|
|
||||||
|
# Configure network proxy if necessary
|
||||||
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||||
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||||
|
|
||||||
|
|
||||||
|
nix.settings.experimental-features = [ "nix-command" ];
|
||||||
|
|
||||||
|
# Enable networking
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
networking.firewall.trustedInterfaces = [ "virbr0" ];
|
||||||
|
|
||||||
|
# Virtualization
|
||||||
|
|
||||||
|
virtualisation.libvirtd.enable = true;
|
||||||
|
programs.virt-manager.enable = true;
|
||||||
|
|
||||||
|
virtualisation.docker = {
|
||||||
|
enable = true;
|
||||||
|
# Do NOT enable rootless here — Exegol doesn’t support Docker rootless mode
|
||||||
|
rootless.enable = false; # (false is the default)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
# Set your time zone.
|
||||||
|
time.timeZone = "Europe/Paris";
|
||||||
|
|
||||||
|
# Select internationalisation properties.
|
||||||
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
|
||||||
|
i18n.extraLocaleSettings = {
|
||||||
|
LC_ADDRESS = "fr_FR.UTF-8";
|
||||||
|
LC_IDENTIFICATION = "fr_FR.UTF-8";
|
||||||
|
LC_MEASUREMENT = "fr_FR.UTF-8";
|
||||||
|
LC_MONETARY = "fr_FR.UTF-8";
|
||||||
|
LC_NAME = "fr_FR.UTF-8";
|
||||||
|
LC_NUMERIC = "fr_FR.UTF-8";
|
||||||
|
LC_PAPER = "fr_FR.UTF-8";
|
||||||
|
LC_TELEPHONE = "fr_FR.UTF-8";
|
||||||
|
LC_TIME = "fr_FR.UTF-8";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable the X11 windowing system.
|
||||||
|
services.xserver.enable = true;
|
||||||
|
|
||||||
|
# Enable the XFCE Desktop Environment.
|
||||||
|
# services.xserver.displayManager.lightdm.enable = true;
|
||||||
|
# services.xserver.desktopManager.xfce.enable = true;
|
||||||
|
|
||||||
|
# Configure keymap in X11
|
||||||
|
|
||||||
|
services.xserver.xkb = {
|
||||||
|
layout = "us,ru,ara,vn,jp,kr,cn"; # Add your desired layouts
|
||||||
|
options = "grp:alt_shift_toggle";
|
||||||
|
};
|
||||||
|
|
||||||
|
i18n.inputMethod = {
|
||||||
|
enable = true;
|
||||||
|
type = "fcitx5";
|
||||||
|
|
||||||
|
fcitx5.addons = with pkgs; [
|
||||||
|
qt6Packages.fcitx5-configtool
|
||||||
|
fcitx5-gtk
|
||||||
|
|
||||||
|
fcitx5-mozc # Japanese
|
||||||
|
fcitx5-hangul # Korean
|
||||||
|
qt6Packages.fcitx5-chinese-addons # Chinese
|
||||||
|
qt6Packages.fcitx5-unikey # Vietnamese
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
i18n.inputMethod.fcitx5.waylandFrontend = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
fonts.packages = with pkgs; [
|
||||||
|
noto-fonts
|
||||||
|
noto-fonts-cjk-sans
|
||||||
|
noto-fonts-color-emoji
|
||||||
|
fira-code
|
||||||
|
fira-code-symbols
|
||||||
|
];
|
||||||
|
|
||||||
|
# Enable CUPS to print documents.
|
||||||
|
services.printing.enable = true;
|
||||||
|
|
||||||
|
# Enable sound with pipewire.
|
||||||
|
services.pulseaudio.enable = false;
|
||||||
|
security.rtkit.enable = true;
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
alsa.enable = true;
|
||||||
|
alsa.support32Bit = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
# If you want to use JACK applications, uncomment this
|
||||||
|
jack.enable = true;
|
||||||
|
|
||||||
|
# use the example session manager (no others are packaged yet so this is enabled by default,
|
||||||
|
# no need to redefine it in your config for now)
|
||||||
|
#media-session.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.portal = {
|
||||||
|
enable = true;
|
||||||
|
xdgOpenUsePortal = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.portal.extraPortals = [pkgs.xdg-desktop-portal-hyprland];
|
||||||
|
|
||||||
|
# Enable touchpad support (enabled default in most desktopManager).
|
||||||
|
# services.xserver.libinput.enable = true;
|
||||||
|
|
||||||
|
services.tailscale.enable = true;
|
||||||
|
|
||||||
|
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||||
|
users.users.mrsh = {
|
||||||
|
isNormalUser = true;
|
||||||
|
description = "Marsha";
|
||||||
|
extraGroups = ["docker" "networkmanager" "wheel" "libvirtd" "kvm" "wireshark" "video" ];
|
||||||
|
packages = with pkgs; [
|
||||||
|
# thunderbird
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
# Install firefox.
|
||||||
|
programs.firefox.enable = true;
|
||||||
|
|
||||||
|
#install wireshark
|
||||||
|
programs.wireshark.enable = true;
|
||||||
|
|
||||||
|
#ZSH
|
||||||
|
|
||||||
|
programs.zsh.enable = true;
|
||||||
|
|
||||||
|
users.extraUsers.mrsh = {
|
||||||
|
shell = pkgs.zsh;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Allow unfree packages
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
programs.nix-ld.enable = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# List packages installed in system profile. To search, run:
|
||||||
|
# $ nix search wget
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||||
|
wget
|
||||||
|
curl
|
||||||
|
git
|
||||||
|
vscodium
|
||||||
|
hyprland
|
||||||
|
kitty
|
||||||
|
git
|
||||||
|
python3
|
||||||
|
pipx
|
||||||
|
fastfetch
|
||||||
|
dnsmasq
|
||||||
|
rofi
|
||||||
|
eww
|
||||||
|
kdePackages.dolphin
|
||||||
|
tor-browser
|
||||||
|
ripgrep
|
||||||
|
net-tools
|
||||||
|
capitaine-cursors
|
||||||
|
hyprpaper
|
||||||
|
zsh
|
||||||
|
starship
|
||||||
|
tailscale
|
||||||
|
libreoffice
|
||||||
|
swtpm
|
||||||
|
unzip
|
||||||
|
zip
|
||||||
|
neovim
|
||||||
|
bluez
|
||||||
|
bluez-tools
|
||||||
|
blueman
|
||||||
|
xorg.xhost
|
||||||
|
cava
|
||||||
|
playerctl
|
||||||
|
zellij
|
||||||
|
wireshark
|
||||||
|
anki
|
||||||
|
obsidian
|
||||||
|
gcc
|
||||||
|
gdb
|
||||||
|
man-pages
|
||||||
|
man-pages-posix
|
||||||
|
cmake
|
||||||
|
openssl
|
||||||
|
nodejs
|
||||||
|
chromium
|
||||||
|
cargo
|
||||||
|
rustc
|
||||||
|
brightnessctl
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
nixpkgs.config.permittedInsecurePackages = [
|
||||||
|
"ciscoPacketTracer8-8.2.2"
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
programs.hyprland.enable = true;
|
||||||
|
programs.light.enable = true;
|
||||||
|
programs.starship.enable = true;
|
||||||
|
|
||||||
|
environment.sessionVariables = {
|
||||||
|
XCURSOR_THEME = "capitaine-cursors";
|
||||||
|
XCURSOR_SIZE = "24";
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.dconf.enable = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Some programs need SUID wrappers, can be configured further or are
|
||||||
|
# started in user sessions.
|
||||||
|
# programs.mtr.enable = true;
|
||||||
|
# programs.gnupg.agent = {
|
||||||
|
# enable = true;
|
||||||
|
# enableSSHSupport = true;
|
||||||
|
# };
|
||||||
|
|
||||||
|
# List services that you want to enable:
|
||||||
|
|
||||||
|
# Enable the OpenSSH daemon.
|
||||||
|
# services.openssh.enable = true;
|
||||||
|
|
||||||
|
# Open ports in the firewall.
|
||||||
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||||
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||||
|
# Or disable the firewall altogether.
|
||||||
|
# networking.firewall.enable = false;
|
||||||
|
|
||||||
|
# This value determines the NixOS release from which the default
|
||||||
|
# settings for stateful data, like file locations and database versions
|
||||||
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||||
|
# this value at the release version of the first install of this system.
|
||||||
|
# Before changing this value read the documentation for this option
|
||||||
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
|
system.stateVersion = "25.11"; # Did you read the comment?
|
||||||
|
|
||||||
|
}
|
||||||
3
nvim/init.lua
Normal file
3
nvim/init.lua
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
require("config.options")
|
||||||
|
require("config.lazy")
|
||||||
|
require("config.keymaps")
|
||||||
25
nvim/lazy-lock.json
Normal file
25
nvim/lazy-lock.json
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||||
|
"LuaSnip": { "branch": "master", "commit": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24" },
|
||||||
|
"alpha-nvim": { "branch": "main", "commit": "6c6a89d5b068b5251c8bdf0dd57bb921bcfeeb09" },
|
||||||
|
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||||
|
"catppuccin": { "branch": "main", "commit": "49a926655a2f5579e9c276470fc300baaa49e524" },
|
||||||
|
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||||
|
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||||
|
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||||
|
"gitsigns.nvim": { "branch": "main", "commit": "25050e4ed39e628282831d4cbecb1850454ce915" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||||
|
"lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" },
|
||||||
|
"nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "a683e0ddf0cf64c6cd689e18ffb480ade3c162b7" },
|
||||||
|
"nvim-tree.lua": { "branch": "master", "commit": "82f58063d67defc620e1ef8be606fc62a7b5dc1e" },
|
||||||
|
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
||||||
|
"strudel.nvim": { "branch": "main", "commit": "3a7e62c9048a318281328ad08d6269e50b884cd3" },
|
||||||
|
"telescope.nvim": { "branch": "master", "commit": "7d324792b7943e4aa16ad007212e6acc6f9fe335" },
|
||||||
|
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
|
||||||
|
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||||
|
}
|
||||||
28
nvim/lua/config/keymaps.lua
Normal file
28
nvim/lua/config/keymaps.lua
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
local map = vim.keymap.set
|
||||||
|
|
||||||
|
-- WhichKey will automatically pick these up if they have descriptions
|
||||||
|
map("n", "<leader>e", "<cmd>NvimTreeToggle<cr>", { desc = "Toggle Explorer" })
|
||||||
|
map("n", "<leader>f", "<cmd>Telescope find_files<cr>", { desc = "Find Files" })
|
||||||
|
map("n", "<leader>g", "<cmd>Telescope live_grep<cr>", { desc = "Grep" })
|
||||||
|
map("n", "<leader>w", "<cmd>w<cr>", { desc = "Save" })
|
||||||
|
map("n", "<leader>q", "<cmd>q<cr>", { desc = "Quit" })
|
||||||
|
map("n", "<leader>t", "<cmd>ToggleTerm<cr>", { desc = "Terminal" })
|
||||||
|
|
||||||
|
-- Clear search with <esc>
|
||||||
|
map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and clear hlsearch" })
|
||||||
|
|
||||||
|
-- Better escape
|
||||||
|
map("i", "jj", "<esc>", { desc = "Escape insert mode" })
|
||||||
|
|
||||||
|
-- Better window navigation
|
||||||
|
map("n", "<C-h>", "<C-w>h", { desc = "Go to left window" })
|
||||||
|
map("n", "<C-j>", "<C-w>j", { desc = "Go to lower window" })
|
||||||
|
map("n", "<C-k>", "<C-w>k", { desc = "Go to upper window" })
|
||||||
|
map("n", "<C-l>", "<C-w>l", { desc = "Go to right window" })
|
||||||
|
|
||||||
|
-- Buffers
|
||||||
|
map("n", "<S-h>", "<cmd>bprevious<cr>", { desc = "Prev buffer" })
|
||||||
|
map("n", "<S-l>", "<cmd>bnext<cr>", { desc = "Next buffer" })
|
||||||
|
|
||||||
|
-- Strudel
|
||||||
|
map("n", "ss", "<cmd>StrudelUpdate<cr>", { desc = "Update Strudel" })
|
||||||
40
nvim/lua/config/lazy.lua
Normal file
40
nvim/lua/config/lazy.lua
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
|
vim.fn.system({
|
||||||
|
"git",
|
||||||
|
"clone",
|
||||||
|
"--filter=blob:none",
|
||||||
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
|
"--branch=stable",
|
||||||
|
lazypath,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = " "
|
||||||
|
|
||||||
|
require("lazy").setup({
|
||||||
|
spec = {
|
||||||
|
{ import = "plugins" },
|
||||||
|
},
|
||||||
|
defaults = {
|
||||||
|
lazy = false,
|
||||||
|
version = false,
|
||||||
|
},
|
||||||
|
checker = { enabled = true },
|
||||||
|
performance = {
|
||||||
|
rtp = {
|
||||||
|
disabled_plugins = {
|
||||||
|
"gzip",
|
||||||
|
"matchit",
|
||||||
|
"matchparen",
|
||||||
|
"netrwPlugin",
|
||||||
|
"tarPlugin",
|
||||||
|
"tohtml",
|
||||||
|
"tutor",
|
||||||
|
"zipPlugin",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
23
nvim/lua/config/options.lua
Normal file
23
nvim/lua/config/options.lua
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
local opt = vim.opt
|
||||||
|
|
||||||
|
opt.number = true
|
||||||
|
opt.relativenumber = true
|
||||||
|
opt.mouse = "a"
|
||||||
|
opt.clipboard = "unnamedplus"
|
||||||
|
opt.breakindent = true
|
||||||
|
opt.undofile = true
|
||||||
|
opt.ignorecase = true
|
||||||
|
opt.smartcase = true
|
||||||
|
opt.updatetime = 250
|
||||||
|
opt.timeoutlen = 300
|
||||||
|
opt.splitright = true
|
||||||
|
opt.splitbelow = true
|
||||||
|
opt.list = true
|
||||||
|
opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" }
|
||||||
|
opt.inccommand = "split"
|
||||||
|
opt.cursorline = true
|
||||||
|
opt.scrolloff = 10
|
||||||
|
opt.expandtab = true
|
||||||
|
opt.shiftwidth = 2
|
||||||
|
opt.tabstop = 2
|
||||||
|
opt.termguicolors = true
|
||||||
67
nvim/lua/plugins/editor.lua
Normal file
67
nvim/lua/plugins/editor.lua
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
return {
|
||||||
|
-- File explorer
|
||||||
|
{
|
||||||
|
"nvim-tree/nvim-tree.lua",
|
||||||
|
dependencies = "nvim-tree/nvim-web-devicons",
|
||||||
|
opts = {
|
||||||
|
view = {
|
||||||
|
width = 30,
|
||||||
|
side = "left",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Fuzzy finder
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Treesitter
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
build = ":TSUpdate",
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Git integration
|
||||||
|
{
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Terminal
|
||||||
|
{
|
||||||
|
"akinsho/toggleterm.nvim",
|
||||||
|
version = "*",
|
||||||
|
opts = {
|
||||||
|
open_mapping = [[<c-\>]],
|
||||||
|
direction = "float",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Comments
|
||||||
|
{ "numToStr/Comment.nvim", opts = {} },
|
||||||
|
|
||||||
|
-- Autopairs
|
||||||
|
{ "windwp/nvim-autopairs", opts = {} },
|
||||||
|
|
||||||
|
{
|
||||||
|
"gruvw/strudel.nvim",
|
||||||
|
build = "npm ci",
|
||||||
|
keys = {
|
||||||
|
{ "<leader>sl", "<cmd>StrudelLaunch<CR>", desc = "Strudel Launch" },
|
||||||
|
{ "<leader>k", "<cmd>StrudelToggle<CR>", desc = "Strudel Toggle (Play/Stop)" },
|
||||||
|
{ "<leader>su", "<cmd>StrudelUpdate<CR>", desc = "Strudel Update" },
|
||||||
|
{ "<leader><leader>", "<cmd>StrudelUpdate<CR>", desc = "Strudel Update" },
|
||||||
|
{ "<leader>sq", "<cmd>StrudelQuit<CR>", desc = "Strudel Quit" },
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("strudel").setup({
|
||||||
|
browser_exec_path = "/run/current-system/sw/bin/chromium",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
85
nvim/lua/plugins/lsp.lua
Normal file
85
nvim/lua/plugins/lsp.lua
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
dependencies = {
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local on_attach = function(_, bufnr)
|
||||||
|
local opts = { buffer = bufnr }
|
||||||
|
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||||
|
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
||||||
|
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
|
||||||
|
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Setup LSPs using new vim.lsp.config API (Nvim 0.11+)
|
||||||
|
-- These assume the language servers are installed on your system PATH via Nix
|
||||||
|
local servers = { "lua_ls", "bashls", "ansiblels", "yamlls", "pyright", "nil_ls", "powershell_es", "ts_ls", "clangd" }
|
||||||
|
for _, lsp in ipairs(servers) do
|
||||||
|
vim.lsp.config(lsp, {
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Autocompletion
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
dependencies = {
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
"hrsh7th/cmp-path",
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
"saadparwaiz1/cmp_luasnip",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
local luasnip = require("luasnip")
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
luasnip.lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
["<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_jumpable() then
|
||||||
|
luasnip.expand_or_jump(1)
|
||||||
|
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" }),
|
||||||
|
}),
|
||||||
|
sources = {
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "luasnip" },
|
||||||
|
{ name = "buffer" },
|
||||||
|
{ name = "path" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
68
nvim/lua/plugins/ui.lua
Normal file
68
nvim/lua/plugins/ui.lua
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
return {
|
||||||
|
-- Colorscheme
|
||||||
|
{
|
||||||
|
"catppuccin/nvim",
|
||||||
|
name = "catppuccin",
|
||||||
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
|
config = function()
|
||||||
|
require("catppuccin").setup({
|
||||||
|
flavour = "mocha", -- latte, frappe, macchiato, mocha
|
||||||
|
})
|
||||||
|
vim.cmd([[colorscheme catppuccin]])
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Statusline
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
opts = {
|
||||||
|
options = {
|
||||||
|
theme = "catppuccin",
|
||||||
|
component_separators = "|",
|
||||||
|
section_separators = "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Bufferline
|
||||||
|
{
|
||||||
|
"akinsho/bufferline.nvim",
|
||||||
|
version = "*",
|
||||||
|
dependencies = "nvim-tree/nvim-web-devicons",
|
||||||
|
opts = {
|
||||||
|
options = {
|
||||||
|
mode = "buffers",
|
||||||
|
separator_style = "slant",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Dashboard
|
||||||
|
{
|
||||||
|
"goolord/alpha-nvim",
|
||||||
|
config = function()
|
||||||
|
local alpha = require("alpha")
|
||||||
|
local dashboard = require("alpha.themes.dashboard")
|
||||||
|
dashboard.section.header.val = {
|
||||||
|
" [ ███╗ ███╗██╗██████╗ ██████╗ ██████╗ ██╗ ]",
|
||||||
|
" [ ████╗ ████║██║██╔══██╗██╔═══██╗██╔══██╗██║ ]",
|
||||||
|
" [ ██╔████╔██║██║██║ ██║██║ ██║██████╔╝██║ ]",
|
||||||
|
" [ ██║╚██╔╝██║██║██║ ██║██║ ██║██╔══██╗██║ ]",
|
||||||
|
" [ ██║ ╚═╝ ██║██║██████╔╝╚██████╔╝██║ ██║██║ ]",
|
||||||
|
" [ ╚═╝ ╚═╝╚═╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ]",
|
||||||
|
}
|
||||||
|
alpha.setup(dashboard.config)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Which-key
|
||||||
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Icons
|
||||||
|
{ "nvim-tree/nvim-web-devicons", lazy = true },
|
||||||
|
}
|
||||||
13
nvim/lua/plugins/which-key.lua
Normal file
13
nvim/lua/plugins/which-key.lua
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
init = function()
|
||||||
|
vim.o.timeout = true
|
||||||
|
vim.o.timeoutlen = 300
|
||||||
|
end,
|
||||||
|
opts = {
|
||||||
|
-- your configuration comes here
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user