diff --git a/config/nvim/init.lua b/config/nvim/init.lua index c4da522..3dfc8e0 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -27,7 +27,7 @@ vim.o.background = "dark" -- set to "dark" for dark theme -- Scrolling and UI settings vim.opt.cursorline = true vim.opt.cursorcolumn = true -vim.opt.signcolumn = 'yes' +vim.opt.signcolumn = "yes" vim.opt.wrap = false vim.opt.sidescrolloff = 8 vim.opt.scrolloff = 8 @@ -58,63 +58,63 @@ vim.lsp.inlay_hint.enable(true) -- Plugin list -- ----------------------------------------------------------------------------------------------- local plugins = { - { "nvim-lua/plenary.nvim" }, -- used by several other plugins - { "catppuccin/nvim" }, - { "nvim-tree/nvim-web-devicons", lazy = true }, -- used by lualine and nvim-tree - { "nvim-lualine/lualine.nvim" }, -- Status line - { "nvim-tree/nvim-tree.lua" }, -- File browser - { "numToStr/Comment.nvim" }, + { "nvim-lua/plenary.nvim" }, -- used by several other plugins + { "catppuccin/nvim" }, + { "nvim-tree/nvim-web-devicons", lazy = true }, -- used by lualine and nvim-tree + { "nvim-lualine/lualine.nvim" }, -- Status line + { "nvim-tree/nvim-tree.lua" }, -- File browser + { "numToStr/Comment.nvim" }, - { "nvim-lua/plenary.nvim" }, - { "ThePrimeagen/harpoon" }, + { "nvim-lua/plenary.nvim" }, + { "ThePrimeagen/harpoon" }, - -- Telescope command menu - { "nvim-telescope/telescope.nvim" }, - { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + -- Telescope command menu + { "nvim-telescope/telescope.nvim" }, + { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, - -- TreeSitter - { "nvim-treesitter/nvim-treesitter", priority = 1000, build = ":TSUpdate" }, + -- TreeSitter + { "nvim-treesitter/nvim-treesitter", priority = 1000, build = ":TSUpdate" }, - -- LSP - { 'mason-org/mason.nvim' }, -- installs LSP servers - { 'neovim/nvim-lspconfig' }, -- configures LSPs - { 'mason-org/mason-lspconfig.nvim' }, -- links installed to configured - { 'stevearc/conform.nvim' }, -- Formatting where the LSP doesn't + -- LSP + { "mason-org/mason.nvim" }, -- installs LSP servers + { "neovim/nvim-lspconfig" }, -- configures LSPs + { "mason-org/mason-lspconfig.nvim" }, -- links installed to configured + { "stevearc/conform.nvim" }, -- Formatting where the LSP doesn't - -- AI trash - -- { 'supermaven-inc/supermaven-nvim' }, + -- AI trash + -- { 'supermaven-inc/supermaven-nvim' }, - { - 'saghen/blink.cmp', -- Blink completion tool (LSP, snippets etc) - version = '1.*', -- see keymap here: - -- opts_extend = { "sources.default" } -- https://cmp.saghen.dev/configuration/keymap.html#default + { + "saghen/blink.cmp", -- Blink completion tool (LSP, snippets etc) + version = "1.*", -- see keymap here: + -- opts_extend = { "sources.default" } -- https://cmp.saghen.dev/configuration/keymap.html#default - opts = { - keymap = { preset = "default" }, - sources = { - default = { "lsp", "path", "buffer" }, - }, - }, - }, + opts = { + keymap = { preset = "default" }, + sources = { + default = { "lsp", "path", "buffer" }, + }, + }, + }, - { - "christoomey/vim-tmux-navigator", - cmd = { - "TmuxNavigateLeft", - "TmuxNavigateDown", - "TmuxNavigateUp", - "TmuxNavigateRight", - "TmuxNavigatePrevious", - "TmuxNavigatorProcessList", - }, - keys = { - { "", "TmuxNavigateLeft" }, - { "", "TmuxNavigateDown" }, - { "", "TmuxNavigateUp" }, - { "", "TmuxNavigateRight" }, - { "", "TmuxNavigatePrevious" }, - }, -} + { + "christoomey/vim-tmux-navigator", + cmd = { + "TmuxNavigateLeft", + "TmuxNavigateDown", + "TmuxNavigateUp", + "TmuxNavigateRight", + "TmuxNavigatePrevious", + "TmuxNavigatorProcessList", + }, + keys = { + { "", "TmuxNavigateLeft" }, + { "", "TmuxNavigateDown" }, + { "", "TmuxNavigateUp" }, + { "", "TmuxNavigateRight" }, + { "", "TmuxNavigatePrevious" }, + }, + }, } -- ----------------------------------------------------------------------------------------------- @@ -122,11 +122,14 @@ local plugins = { -- ----------------------------------------------------------------------------------------------- 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, - }) + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", + lazypath, + }) end vim.opt.rtp:prepend(lazypath) require("lazy").setup(plugins) @@ -135,9 +138,9 @@ require("lazy").setup(plugins) -- Plugin config -- ----------------------------------------------------------------------------------------------- vim.cmd.colorscheme("catppuccin") -- activate the theme -require("lualine").setup() -- the status line -require("nvim-tree").setup() -- the tree file browser panel -require("telescope").setup() -- command menu +require("lualine").setup() -- the status line +require("nvim-tree").setup() -- the tree file browser panel +require("telescope").setup() -- command menu require("Comment").setup() -- require("supermaven-nvim").setup({}) @@ -147,10 +150,10 @@ require("Comment").setup() -- NB: Make sure to add more from this list! -- https://github.com/nvim-treesitter/nvim-treesitter/tree/master#supported-languages require("nvim-treesitter.configs").setup({ - ensure_installed = { "typescript", "python", "rust", "go" }, - sync_install = false, - auto_install = true, - highlight = { enable = true, }, + ensure_installed = { "typescript", "python", "rust", "go", "bash", "lua" }, + sync_install = false, + auto_install = true, + highlight = { enable = true }, }) vim.opt.foldmethod = "expr" vim.opt.foldexpr = "nvim_treesitter#foldexpr()" @@ -163,20 +166,22 @@ vim.opt.foldlevel = 99 -- NB: Make sure to add more from this list! -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md require("mason").setup() -require("mason-lspconfig").setup({ ensure_installed = { "gopls", "bashls", "beautysh" } }) +require("mason-lspconfig").setup({ ensure_installed = { "gopls", "bashls", "stylua" } }) require("conform").setup({ - default_format_opts = { lsp_format = "fallback" }, -- Many languages can be formatted directly by their LSP - formatters_by_ft = { -- but some can't, so conform is for those ones - bash = { "beautysh" }, - javascript = { "prettier" }, - javascriptreact = { "prettier" }, - typescript = { "prettier" }, - typescriptreact = { "prettier" }, - json = { "prettier" }, - html = { "prettier" }, - css = { "prettier" }, - }, + default_format_opts = { lsp_format = "fallback" }, -- Many languages can be formatted directly by their LSP + formatters_by_ft = { -- but some can't, so conform is for those ones + sh = { "shfmt" }, + bash = { "shfmt" }, + lua = { "stylua" }, + javascript = { "prettier" }, + javascriptreact = { "prettier" }, + typescript = { "prettier" }, + typescriptreact = { "prettier" }, + json = { "prettier" }, + html = { "prettier" }, + css = { "prettier" }, + }, }) -- ----------------------------------------------------------------------------------------------- @@ -215,20 +220,20 @@ vim.keymap.set("n", "", ":NvimTreeFindFile") vim.keymap.set("n", "", ":NvimTreeClose") -- Formatting -vim.keymap.set("n", "fo", require('conform').format) +vim.keymap.set("n", "fo", require("conform").format) -vim.keymap.set('n', 'k', vim.diagnostic.goto_next, { desc = "Next diagnostic" }) +vim.keymap.set("n", "k", vim.diagnostic.goto_next, { desc = "Next diagnostic" }) -- vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = "Prev diagnostic" }) local tele_builtin = require("telescope.builtin") -vim.keymap.set("n", "ff", tele_builtin.git_files, {}) -- ,ff to find git files +vim.keymap.set("n", "ff", tele_builtin.git_files, {}) -- ,ff to find git files vim.keymap.set("n", "fa", tele_builtin.find_files, {}) -- ,fa to find any files -vim.keymap.set("n", "fg", tele_builtin.live_grep, {}) -- ,fg to ripgrep -vim.keymap.set("n", "fb", tele_builtin.buffers, {}) -- ,fb to see recent buffers -vim.keymap.set("n", "fh", tele_builtin.help_tags, {}) -- ,fh to search help +vim.keymap.set("n", "fg", tele_builtin.live_grep, {}) -- ,fg to ripgrep +vim.keymap.set("n", "fb", tele_builtin.buffers, {}) -- ,fb to see recent buffers +vim.keymap.set("n", "fh", tele_builtin.help_tags, {}) -- ,fh to search help -vim.keymap.set("n", "v", require("harpoon.ui").toggle_quick_menu, {}) -- ,fh to search help -vim.keymap.set("n", "b", require("harpoon.mark").add_file, {}) -- ,fh to search help +vim.keymap.set("n", "v", require("harpoon.ui").toggle_quick_menu, {}) -- ,fh to search help +vim.keymap.set("n", "b", require("harpoon.mark").add_file, {}) -- ,fh to search help -- =============================================================================================== -- Recommended extra keymaps for a modern Neovim workflow @@ -247,7 +252,9 @@ vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { desc = "Code action vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Previous diagnostic" }) vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Next diagnostic" }) vim.keymap.set("n", "q", vim.diagnostic.setloclist, { desc = "Send diagnostics to location list" }) -vim.keymap.set("n", "f", function() vim.lsp.buf.format({ async = true }) end, { desc = "Format buffer" }) +vim.keymap.set("n", "f", function() + vim.lsp.buf.format({ async = true }) +end, { desc = "Format buffer" }) -- ---------------------------- -- Telescope / fuzzy finding diff --git a/deploy.sh b/deploy.sh index 561af5d..069b341 100644 --- a/deploy.sh +++ b/deploy.sh @@ -14,7 +14,7 @@ else fi for dir in "$source_dir"/*/; do - if [ -d "$dir" ]; then # Check if it's a directory + if [ -d "$dir" ]; then # Check if it's a directory dir_name=$(basename "$dir") source=$source_dir"/"$dir_name target=$target_config_dir"/"$dir_name @@ -34,7 +34,6 @@ done fish -c "fisher update" - fish -c "set --universal nvm_default_version $nodejs_version" if fish -c "which node" >/dev/null 2>&1; then version=$(node --version) @@ -44,4 +43,3 @@ else fish -c "nvm install $nodejs_version" fish -c "nvm use $nodejs_version" fi -