From 1a509d6e840a0e9bba0f500c38c696ca529a1ec0 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Tue, 10 Oct 2023 00:15:27 -0400 Subject: [PATCH] more neovim lsp improvements --- home-config/nvim/lua/keybinds.lua | 13 +++++++------ home-config/nvim/lua/lsp.lua | 3 +++ home-config/nvim/lua/plugin.lua | 19 ++++++++++++++----- home-config/nvim/lua/theme.lua | 29 +++++++++++++++++++++++++---- home-config/nvim/lua/tree.lua | 19 +++++++++++++++++++ home-config/nvim/lua/vimopt.lua | 1 - 6 files changed, 68 insertions(+), 16 deletions(-) diff --git a/home-config/nvim/lua/keybinds.lua b/home-config/nvim/lua/keybinds.lua index cea6cfe..67cbfd4 100644 --- a/home-config/nvim/lua/keybinds.lua +++ b/home-config/nvim/lua/keybinds.lua @@ -1,18 +1,19 @@ local opts = { noremap = true, silent = true } -local keymap = vim.api.nvim_set_keymap +local keymap = vim.keymap.set +local builtin = require('telescope.builtin') vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' keymap('', '', '', opts) -keymap('n', 'e', ':NvimTreeToggle %', opts) - -local builtin = require('telescope.builtin') -local keymap = vim.keymap.set - +keymap('n', 'e', vim.cmd.NvimTreeToggle) +keymap('n', 'm', vim.cmd.Mason) +keymap('n', 'h', vim.cmd.noh) +keymap('n', 'p', vim.cmd.PlugUpdate) keymap('n', 'ff', builtin.find_files, {}) keymap('n', 'fg', builtin.live_grep, {}) keymap('n', 'fb', builtin.buffers, {}) keymap('n', 'fh', builtin.help_tags, {}) keymap('n', 'u', vim.cmd.UndotreeToggle) keymap('n', 'gs', vim.cmd.Git) +keymap('n', 't', function() require('trouble').toggle() end) diff --git a/home-config/nvim/lua/lsp.lua b/home-config/nvim/lua/lsp.lua index af62047..3f54054 100644 --- a/home-config/nvim/lua/lsp.lua +++ b/home-config/nvim/lua/lsp.lua @@ -71,3 +71,6 @@ lsp.setup() vim.diagnostic.config({ virtual_text = true }) + +require("neodev").setup() +require("nvim-surround").setup() diff --git a/home-config/nvim/lua/plugin.lua b/home-config/nvim/lua/plugin.lua index f477d85..72be553 100644 --- a/home-config/nvim/lua/plugin.lua +++ b/home-config/nvim/lua/plugin.lua @@ -10,12 +10,12 @@ Plug('SirVer/ultisnips') Plug('honza/vim-snippets') Plug('preservim/nerdcommenter') Plug('mhinz/vim-startify') -Plug('neoclide/coc.nvim', {branch = 'release'}) -Plug('nvim-telescope/telescope.nvim', {tag = '0.1.3' }) -Plug('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'}) +Plug('neoclide/coc.nvim', { branch = 'release' }) +Plug('nvim-telescope/telescope.nvim', { tag = '0.1.3' }) +Plug('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' }) Plug('nvim-lua/plenary.nvim') Plug('mbbill/undotree') -Plug('catppuccin/nvim', {as = 'catppuccin'}) +Plug('catppuccin/nvim', { as = 'catppuccin' }) Plug('tpope/vim-fugitive') Plug('neovim/nvim-lspconfig') Plug('hrsh7th/nvim-cmp') @@ -23,6 +23,15 @@ Plug('hrsh7th/cmp-nvim-lsp') Plug('L3MON4D3/LuaSnip') Plug('williamboman/mason.nvim') Plug('williamboman/mason-lspconfig.nvim') -Plug('VonHeikemen/lsp-zero.nvim', {branch = 'v3.x'}) +Plug('VonHeikemen/lsp-zero.nvim', { branch = 'v3.x' }) +Plug('akinsho/bufferline.nvim', { tag = '*' }) +Plug('folke/neodev.nvim') +Plug('RRethy/vim-illuminate') +Plug('SmiteshP/nvim-navic') +Plug('utilyre/barbecue.nvim') +Plug('j-hui/fidget.nvim', { tag = 'legacy' }) +Plug('rcarriga/nvim-notify') +Plug('folke/trouble.nvim') +Plug('kylechui/nvim-surround') vim.call('plug#end') diff --git a/home-config/nvim/lua/theme.lua b/home-config/nvim/lua/theme.lua index 41b53a2..5d58a18 100644 --- a/home-config/nvim/lua/theme.lua +++ b/home-config/nvim/lua/theme.lua @@ -1,7 +1,3 @@ -local options = { - termguicolors = true -} - local catppuccin = require('catppuccin') catppuccin.setup({ @@ -10,6 +6,21 @@ catppuccin.setup({ cmp = true, nvimtree = true, treesitter = true, + illuminate = { + enabled = true, + lsp = false + }, + barbecue = { + dim_dirname = true, -- directory name is dimmed by default + bold_basename = true, + dim_context = false, + alt_background = false, + }, + coc_nvim = true, + fidget = true, + markdown = true, + notify = true, + lsp_trouble = true, }, }) @@ -32,3 +43,13 @@ require('lualine').setup { vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) vim.api.nvim_set_hl(0, "NvimTreeNormal", { bg = "none" }) + +vim.opt.termguicolors = true +require("bufferline").setup{} +require("barbecue").setup() +require("barbecue.ui").toggle(true) +require("fidget").setup { + window = { + blend = 0, + }, +} diff --git a/home-config/nvim/lua/tree.lua b/home-config/nvim/lua/tree.lua index 0214392..aef5023 100644 --- a/home-config/nvim/lua/tree.lua +++ b/home-config/nvim/lua/tree.lua @@ -29,7 +29,26 @@ end require("nvim-tree").setup({ sort_by = "case_sensitive", view = { + adaptive_size = false, + centralize_selection = true, width = 30, + side = "left", + preserve_window_proportions = false, + number = false, + relativenumber = false, + signcolumn = "yes", + float = { + enable = false, + quit_on_focus_loss = true, + open_win_config = { + relative = "editor", + border = "rounded", + width = 30, + height = 30, + row = 1, + col = 1, + }, + }, }, renderer = { group_empty = true, diff --git a/home-config/nvim/lua/vimopt.lua b/home-config/nvim/lua/vimopt.lua index ac1a689..b0a8818 100644 --- a/home-config/nvim/lua/vimopt.lua +++ b/home-config/nvim/lua/vimopt.lua @@ -7,7 +7,6 @@ set.clipboard = "unnamedplus" set.hlsearch = true set.autoindent = true set.ttyfast = true -set.cc = '80' set.number = true set.relativenumber = true set.rnu = true