From dfdd45f1e265d201f58d893f9e7a63c1ea3c834b Mon Sep 17 00:00:00 2001 From: John Costa Date: Tue, 8 Oct 2024 22:13:42 +0100 Subject: [PATCH] feat(nvim): various plugins and small configuration details --- hypr/hyprland/general.conf | 6 +++--- nvim/init.lua | 12 ++++++++++++ nvim/lazy.lua | 18 ------------------ nvim/lua/plugins/init.lua | 11 ++++++++++- nvim/mappings.lua | 22 ---------------------- 5 files changed, 25 insertions(+), 44 deletions(-) delete mode 100644 nvim/lazy.lua delete mode 100644 nvim/mappings.lua diff --git a/hypr/hyprland/general.conf b/hypr/hyprland/general.conf index 60594d78..e6cb9d39 100644 --- a/hypr/hyprland/general.conf +++ b/hypr/hyprland/general.conf @@ -1,9 +1,9 @@ # MONITOR CONFIG -# monitor=,preferred,auto,1 +monitor=,preferred,auto,1 # monitor=,addreserved, 0, 0, 0, 0 # Custom reserved area # HDMI port: mirror display. To see device name, use `hyprctl monitors` -monitor=HDMI-A-1,2560x1440@144,1920x0,1,mirror,eDP-1 +# monitor=HDMI-A-1,2560x1440@144,1920x0,1,mirror,eDP-1 input { # Keyboard: Add a layout and uncomment kb_options for Win+Space switching shortcut @@ -14,7 +14,7 @@ input { repeat_rate = 35 touchpad { - natural_scroll = yes + natural_scroll = false disable_while_typing = true clickfinger_behavior = true scroll_factor = 0.5 diff --git a/nvim/init.lua b/nvim/init.lua index ad43eb93..ce278b6a 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -18,6 +18,13 @@ vim.opt.undofile = true vim.opt.ignorecase = true vim.opt.smartcase = true +-- Remove sign column (LSP gutter on the left) +vim.opt.signcolumn = "yes" + +-- Line Numbers +vim.opt.number = true +vim.opt.relativenumber = true + -- Modules -- -- Lazy = Package Manager -- @@ -60,6 +67,7 @@ vim.keymap.set("n", "x", "bd") local builtin = require("telescope.builtin") vim.keymap.set("n", "ff", builtin.find_files, { desc = "Telescope find files" }) vim.keymap.set("n", "fw", builtin.live_grep, { desc = "Telescope live grep" }) +vim.keymap.set("n", "fb", builtin.buffers, { desc = "Telescope live buffers" }) -- Neo Tree -- vim.keymap.set("n", "", " Neotree toggle ") @@ -68,3 +76,7 @@ vim.keymap.set("n", "e", " Neotree focus ") -- LSP -- vim.keymap.set("n", "gd", vim.lsp.buf.definition) vim.keymap.set("n", "ca", vim.lsp.buf.code_action) +vim.keymap.set("n", "lf", vim.diagnostic.open_float) + +-- Search -- +vim.keymap.set("n", "", " noh ") diff --git a/nvim/lazy.lua b/nvim/lazy.lua deleted file mode 100644 index cb168723..00000000 --- a/nvim/lazy.lua +++ /dev/null @@ -1,18 +0,0 @@ --- Bootstrap lazy.nvim -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, - { "\nPress any key to exit..." }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end -end -vim.opt.rtp:prepend(lazypath) - -require("lazy").setup("plugins") diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua index f539040f..7f205c7e 100644 --- a/nvim/lua/plugins/init.lua +++ b/nvim/lua/plugins/init.lua @@ -1,4 +1,9 @@ return { + { + "windwp/nvim-autopairs", + event = "InsertEnter", + config = true, + }, { "Everblush/nvim", name = "everblush" }, { "hrsh7th/vim-vsnip" }, { "hrsh7th/cmp-nvim-lsp" }, @@ -53,7 +58,7 @@ return { local configs = require("nvim-treesitter.configs") configs.setup({ - ensure_installed = { "lua", "javascript", "typescript", "html", "tsx" }, + ensure_installed = { "lua", "javascript", "typescript", "html", "tsx", "zig" }, sync_install = false, highlight = { enable = true }, indent = { enable = true }, @@ -123,6 +128,10 @@ return { lsp.vtsls.setup({ capabilities = capabilities, }) + + lsp.zls.setup({ + capabilities = capabilities, + }) end, }, } diff --git a/nvim/mappings.lua b/nvim/mappings.lua deleted file mode 100644 index dc672fb2..00000000 --- a/nvim/mappings.lua +++ /dev/null @@ -1,22 +0,0 @@ -vim.g.mapleader = " " - --- Save -- -vim.keymap.set("n", "", "w") - --- Split navigation -- -vim.keymap.set("n", "", "h") -vim.keymap.set("n", "", "j") -vim.keymap.set("n", "", "k") -vim.keymap.set("n", "", "l") - --- Buffers -- -vim.keymap.set("n", "x", "bd") - --- Telescope Mappings -- -local builtin = require("telescope.builtin") -vim.keymap.set("n", "ff", builtin.find_files, { desc = "Telescope find files" }) -vim.keymap.set("n", "fw", builtin.live_grep, { desc = "Telescope live grep" }) - --- Neo Tree -- -vim.keymap.set("n", "", " Neotree toggle ") -vim.keymap.set("n", "e", " Neotree focus ")