diff --git a/init.lua b/init.lua index 8fbe4079..2769ee54 100644 --- a/init.lua +++ b/init.lua @@ -17,11 +17,9 @@ Kickstart.nvim is a template for your own configuration. a guide. One possible example: - https://learnxinyminutes.com/docs/lua/ - And then you can explore or search through `:help lua-guide` - https://neovim.io/doc/user/lua-guide.html - Kickstart Guide: I have left several `:help X` comments throughout the init.lua @@ -37,15 +35,12 @@ I hope you enjoy your Neovim journey, P.S. You can delete this when you're done too. It's your config now :) --]] + -- Set as the leader key --- See `:help mapleader` --- NOTE: Must happen before plugins are required (otherwise wrong leader will be used) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Install package manager --- https://github.com/folke/lazy.nvim --- `:help lazy.nvim.txt` for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' if not vim.loop.fs_stat(lazypath) then vim.fn.system { @@ -53,69 +48,45 @@ if not vim.loop.fs_stat(lazypath) then 'clone', '--filter=blob:none', 'https://github.com/folke/lazy.nvim.git', - '--branch=stable', -- latest stable release + '--branch=stable', lazypath, } end vim.opt.rtp:prepend(lazypath) --- NOTE: Here is where you install your plugins. --- You can configure plugins using the `config` key. --- --- You can also configure plugins after the setup call, --- as they will be available in your neovim runtime. +-- Set up lazy.nvim and your plugins require('lazy').setup({ - -- NOTE: First, some plugins that don't require any configuration - - -- Git related plugins 'tpope/vim-fugitive', 'tpope/vim-rhubarb', - - -- Detect tabstop and shiftwidth automatically + 'nvim-neotest/nvim-nio', 'tpope/vim-sleuth', - -- NOTE: This is where your plugins related to LSP can be installed. - -- The configuration is done below. Search for lspconfig to find it below. { - -- LSP Configuration & Plugins 'neovim/nvim-lspconfig', dependencies = { - -- Automatically install LSPs to stdpath for neovim 'williamboman/mason.nvim', 'williamboman/mason-lspconfig.nvim', - - -- Useful status updates for LSP - -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, - - -- Additional lua configuration, makes nvim stuff amazing! 'folke/neodev.nvim', }, }, { - -- Autocompletion 'hrsh7th/nvim-cmp', dependencies = { - -- Snippet Engine & its associated nvim-cmp source 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip', - - -- Adds LSP completion capabilities 'hrsh7th/cmp-nvim-lsp', - - -- Adds a number of user-friendly snippets 'rafamadriz/friendly-snippets', }, }, - -- Useful plugin to show you pending keybinds. - { 'folke/which-key.nvim', opts = {} }, + -- Useful plugin to show pending keybinds + { 'folke/which-key.nvim', opts = {} }, + { - -- Adds git related signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', opts = { - -- See `:help gitsigns.txt` signs = { add = { text = '+' }, change = { text = '~' }, @@ -126,7 +97,6 @@ require('lazy').setup({ on_attach = function(bufnr) vim.keymap.set('n', 'hp', require('gitsigns').preview_hunk, { buffer = bufnr, desc = 'Preview git hunk' }) - -- don't override the built-in and fugitive keymaps local gs = package.loaded.gitsigns vim.keymap.set({ 'n', 'v' }, ']c', function() if vim.wo.diff then @@ -151,7 +121,6 @@ require('lazy').setup({ }, { - -- Theme inspired by Atom 'navarasu/onedark.nvim', priority = 1000, config = function() @@ -160,9 +129,7 @@ require('lazy').setup({ }, { - -- Set lualine as statusline 'nvim-lualine/lualine.nvim', - -- See `:help lualine.txt` opts = { options = { icons_enabled = false, @@ -174,30 +141,33 @@ require('lazy').setup({ }, { - -- Add indentation guides even on blank lines 'lukas-reineke/indent-blankline.nvim', - -- Enable `lukas-reineke/indent-blankline.nvim` - -- See `:help ibl` main = 'ibl', opts = {}, }, - -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, + -- Comment plugin with custom keymaps + { + 'numToStr/Comment.nvim', + opts = { + toggler = { + line = '/', -- Changed from + block = 'b', -- Changed from + }, + opleader = { + line = '/', -- Optional + block = 'B', -- Optional + }, + } + }, - -- Fuzzy Finder (files, lsp, etc) { 'nvim-telescope/telescope.nvim', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim', - -- Fuzzy Finder Algorithm which requires local dependencies to be built. - -- Only load if `make` is available. Make sure you have the system - -- requirements installed. { 'nvim-telescope/telescope-fzf-native.nvim', - -- NOTE: If you are having trouble with this installation, - -- refer to the README for telescope-fzf-native for more instructions. build = 'make', cond = function() return vim.fn.executable 'make' == 1 @@ -207,7 +177,6 @@ require('lazy').setup({ }, { - -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', dependencies = { 'nvim-treesitter/nvim-treesitter-textobjects', @@ -215,85 +184,44 @@ require('lazy').setup({ build = ':TSUpdate', }, - -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart - -- These are some example plugins that I've included in the kickstart repository. - -- Uncomment any of the lines below to enable them. + -- Icons support + 'kyazdani42/nvim-web-devicons', + 'echasnovski/mini.icons', + + -- Autoformat and debugging require 'kickstart.plugins.autoformat', require 'kickstart.plugins.debug', - -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` - -- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping - -- up-to-date with whatever is in the kickstart repo. - -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- - -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins - { import = 'custom.plugins' }, }, {}) --- [[ Setting options ]] --- See `:help vim.o` --- NOTE: You can change these options as you wish! - --- Set highlight on search +-- General options vim.o.hlsearch = false - --- Make line numbers default vim.wo.number = true vim.wo.relativenumber = true - --- Enable mouse mode vim.o.mouse = 'a' - --- Sync clipboard between OS and Neovim. --- Remove this option if you want your OS clipboard to remain independent. --- See `:help 'clipboard'` vim.o.clipboard = 'unnamedplus' - --- Enable break indent vim.o.breakindent = true - --- Save undo history vim.o.undofile = true - --- Case-insensitive searching UNLESS \C or capital in search vim.o.ignorecase = true vim.o.smartcase = true - --- Keep signcolumn on by default vim.wo.signcolumn = 'yes' - --- Decrease update time vim.o.updatetime = 250 vim.o.timeoutlen = 300 - --- Set completeopt to have a better completion experience vim.o.completeopt = 'menuone,noselect' - --- NOTE: You should make sure your terminal supports this vim.o.termguicolors = true - vim.o.scrolloff = 8 - vim.o.tabstop = 2 vim.o.softtabstop = 2 vim.o.shiftwidth = 2 vim.o.expandtab = true - - --- [[ Basic Keymaps ]] - --- Keymaps for better default experience --- See `:help vim.keymap.set()` +-- Basic keymaps vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) - --- Remap for dealing with word wrap vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) --- [[ Highlight on yank ]] --- See `:help vim.highlight.on_yank()` +-- Highlight on yank local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) vim.api.nvim_create_autocmd('TextYankPost', { callback = function() @@ -303,8 +231,7 @@ vim.api.nvim_create_autocmd('TextYankPost', { pattern = '*', }) --- [[ Configure Telescope ]] --- See `:help telescope` and `:help telescope.setup()` +-- Telescope setup require('telescope').setup { defaults = { mappings = { @@ -315,41 +242,23 @@ require('telescope').setup { }, }, } - --- Enable telescope fzf native, if installed pcall(require('telescope').load_extension, 'fzf') --- See `:help telescope.builtin` +-- Telescope keymaps vim.keymap.set('n', '?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) vim.keymap.set('n', '', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) vim.keymap.set('n', '/', function() - -- You can pass additional configuration to telescope to change theme, layout, etc. require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { winblend = 10, previewer = false, }) end, { desc = '[/] Fuzzily search in current buffer' }) -vim.keymap.set('n', 'gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) -vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) -vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) -vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) -vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) -vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) -vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) - --- [[ Configure Treesitter ]] --- See `:help nvim-treesitter` --- Defer Treesitter setup after first render to improve startup time of 'nvim {filename}' +-- Treesitter configuration vim.defer_fn(function() require('nvim-treesitter.configs').setup { - -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', - 'bash' }, - - -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) + ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' }, auto_install = false, - highlight = { enable = true }, indent = { enable = true }, incremental_selection = { @@ -364,9 +273,8 @@ vim.defer_fn(function() textobjects = { select = { enable = true, - lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim + lookahead = true, keymaps = { - -- You can use the capture groups defined in textobjects.scm ['aa'] = '@parameter.outer', ['ia'] = '@parameter.inner', ['af'] = '@function.outer', @@ -377,7 +285,7 @@ vim.defer_fn(function() }, move = { enable = true, - set_jumps = true, -- whether to set jumps in the jumplist + set_jumps = true, goto_next_start = { [']m'] = '@function.outer', [']]'] = '@class.outer', @@ -414,20 +322,12 @@ vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnos vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) --- [[ Configure LSP ]] --- This function gets run when an LSP connects to a particular buffer. +-- LSP setup local on_attach = function(_, bufnr) - -- NOTE: Remember that lua is a real programming language, and as such it is possible - -- to define small helper and utility functions so you don't have to repeat yourself - -- many times. - -- - -- In this case, we create a function that lets us more easily define mappings specific - -- for LSP related items. It sets the mode, buffer and description for us each time. local nmap = function(keys, func, desc) if desc then desc = 'LSP: ' .. desc end - vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc }) end @@ -441,11 +341,8 @@ local on_attach = function(_, bufnr) nmap('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') nmap('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') - -- See `:help K` for why this keymap nmap('K', vim.lsp.buf.hover, 'Hover Documentation') nmap('', vim.lsp.buf.signature_help, 'Signature Documentation') - - -- Lesser used LSP functionality nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') nmap('wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder') nmap('wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder') @@ -453,79 +350,20 @@ local on_attach = function(_, bufnr) print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, '[W]orkspace [L]ist Folders') - -- Create a command `:Format` local to the LSP buffer vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_) vim.lsp.buf.format() end, { desc = 'Format current buffer with LSP' }) end --- document existing key chains -require('which-key').register { - ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, - ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, - ['g'] = { name = '[G]it', _ = 'which_key_ignore' }, - ['h'] = { name = 'More git', _ = 'which_key_ignore' }, - ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, - ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, - ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, -} - --- mason-lspconfig requires that these setup functions are called in this order --- before setting up the servers. require('mason').setup() require('mason-lspconfig').setup() - --- Enable the following language servers --- Feel free to add/remove any LSPs that you want here. They will automatically be installed. --- --- Add any additional override configuration in the following tables. They will be passed to --- the `settings` field of the server config. You must look up that documentation yourself. --- --- If you want to override the default filetypes that your language server will attach to you can --- define the property 'filetypes' to the map in question. -local servers = { - -- clangd = {}, - -- gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, - -- tsserver = {}, - -- html = { filetypes = { 'html', 'twig', 'hbs'} }, - - lua_ls = { - Lua = { - workspace = { checkThirdParty = false }, - telemetry = { enable = false }, - }, - }, -} - --- Setup neovim lua configuration -require('neodev').setup() - --- nvim-cmp supports additional completion capabilities, so broadcast that to servers -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) - --- Ensure the servers above are installed +local servers = { lua_ls = { Lua = { workspace = { checkThirdParty = false }, telemetry = { enable = false } } } } +local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities()) local mason_lspconfig = require 'mason-lspconfig' +mason_lspconfig.setup { ensure_installed = vim.tbl_keys(servers) } +mason_lspconfig.setup_handlers { function(server_name) require('lspconfig')[server_name].setup { capabilities = capabilities, on_attach = on_attach, settings = servers[server_name], filetypes = (servers[server_name] or {}).filetypes, } end } -mason_lspconfig.setup { - ensure_installed = vim.tbl_keys(servers), -} - -mason_lspconfig.setup_handlers { - function(server_name) - require('lspconfig')[server_name].setup { - capabilities = capabilities, - on_attach = on_attach, - settings = servers[server_name], - filetypes = (servers[server_name] or {}).filetypes, - } - end, -} - --- [[ Configure nvim-cmp ]] --- See `:help cmp` +-- CMP setup local cmp = require 'cmp' local luasnip = require 'luasnip' require('luasnip.loaders.from_vscode').lazy_load() @@ -580,16 +418,17 @@ require("cmp").setup({ require("colorizer").setup { user_default_options = { - RRGGBBAA = true, -- #RRGGBBAA hex codes - AARRGGBB = true, -- 0xAARRGGBB hex codes - rgb_fn = true, -- CSS rgb() and rgba() functions - hsl_fn = true, -- CSS hsl() and hsla() functions - css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB - css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn - tailwind = true, -- Enable tailwind colors - sass = { enable = true, parsers = { "css" }, }, -- Enable sass colors + RRGGBBAA = true, + AARRGGBB = true, + rgb_fn = true, + hsl_fn = true, + css = true, + css_fn = true, + tailwind = true, + sass = { enable = true, parsers = { "css" } }, }, } --- The line beneath this is called `modeline`. See `:help modeline` +-- Modeline -- vim: ts=2 sts=2 sw=2 et + diff --git a/lazy-lock.json b/lazy-lock.json index 6f6d52e6..c004cacc 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,39 +1,43 @@ { - "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, - "LuaSnip": { "branch": "master", "commit": "80a8528f084a97b624ae443a6f50ff8074ba486b" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, + "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, + "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, - "friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" }, - "gitsigns.nvim": { "branch": "main", "commit": "af0f583cd35286dd6f0e3ed52622728703237e50" }, - "gv.vim": { "branch": "master", "commit": "c67a016566e03d8936c7386e626f88956e87761e" }, - "indent-blankline.nvim": { "branch": "master", "commit": "29be0919b91fb59eca9e90690d76014233392bef" }, - "lazy.nvim": { "branch": "main", "commit": "16603c6917435d8446f7357cb61095138a417085" }, - "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "40301e1c74bc0946eece13edf2b1c561cc497491" }, - "mason-nvim-dap.nvim": { "branch": "main", "commit": "f0cd12f7a8a310c58cecebddb6b219ffad1cfd0f" }, - "mason.nvim": { "branch": "main", "commit": "eabf6d347fdb75be360d4c0ced1145670a171453" }, - "neodev.nvim": { "branch": "main", "commit": "80487e4f7bfa11c2ef2a1b461963db019aad6a73" }, - "nvim-autopairs": { "branch": "master", "commit": "0f04d78619cce9a5af4f355968040f7d675854a1" }, - "nvim-cmp": { "branch": "main", "commit": "51260c02a8ffded8e16162dcf41a23ec90cfba62" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" }, - "nvim-dap": { "branch": "master", "commit": "4048f37bc8b1a36fe1f5fde0df7d84aef71380e4" }, - "nvim-dap-go": { "branch": "main", "commit": "a5cc8dcad43f0732585d4793deb02a25c4afb766" }, - "nvim-dap-ui": { "branch": "master", "commit": "34160a7ce6072ef332f350ae1d4a6a501daf0159" }, - "nvim-lspconfig": { "branch": "master", "commit": "d0467b9574b48429debf83f8248d8cee79562586" }, - "nvim-treesitter": { "branch": "master", "commit": "c5a7533113b2deb7db899d387b877389cc8b6113" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "e69a504baf2951d52e1f1fbb05145d43f236cbf1" }, - "onedark.nvim": { "branch": "master", "commit": "b9acd92ded2ba155867ca5af9d618e933d96e3b0" }, - "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, - "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "bc25c56083939f274edcfe395c6ff7de23b67c50" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, - "telescope.nvim": { "branch": "0.1.x", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" }, - "todo-comments.nvim": { "branch": "main", "commit": "4a6737a8d70fe1ac55c64dfa47fcb189ca431872" }, - "vim-fugitive": { "branch": "master", "commit": "46eaf8918b347906789df296143117774e827616" }, - "vim-go": { "branch": "master", "commit": "1401b576c6ac382529188d3d26cff866139f2f9a" }, + "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, + "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, + "gv.vim": { "branch": "master", "commit": "b6bb6664e2c95aa584059f195eb3a9f3cb133994" }, + "indent-blankline.nvim": { "branch": "master", "commit": "18603eb949eba08300799f64027af11ef922283f" }, + "lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" }, + "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, + "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, + "null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, + "nvim-autopairs": { "branch": "master", "commit": "f158dcb865c36f72c92358f87787dab2c272eaf3" }, + "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "0671e0eabc6842676d3310370e8fae4e1c51d7f9" }, + "nvim-dap": { "branch": "master", "commit": "90616ae6ae40053103dc66872886fc26b94c70c8" }, + "nvim-dap-go": { "branch": "main", "commit": "5511788255c92bdd845f8d9690f88e2e0f0ff9f2" }, + "nvim-dap-ui": { "branch": "master", "commit": "1c351e4e417d4691da12948b6ecf966936a56d28" }, + "nvim-lspconfig": { "branch": "master", "commit": "f4fef355efa3c5d0813512480ee7b2c050b09fe4" }, + "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, + "nvim-treesitter": { "branch": "master", "commit": "2b2635551c83f26f87bf122ad25fcaf90b9a6be0" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" }, + "nvim-web-devicons": { "branch": "master", "commit": "26220156aafb198b2de6a4cf80c1b120a3768da0" }, + "onedark.nvim": { "branch": "master", "commit": "fae34f7c635797f4bf62fb00e7d0516efa8abe37" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, + "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, + "vim-go": { "branch": "master", "commit": "105c4591c99ab152fac967ef4a566c97e071104e" }, "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, - "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, + "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, "vim-svelte": { "branch": "main", "commit": "0e93ec53c3667753237282926fec626785622c1c" }, - "vim-wakatime": { "branch": "master", "commit": "3c6c5bf17f4ae6c53396667ce3405df02a80b894" }, - "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } -} \ No newline at end of file + "vim-wakatime": { "branch": "master", "commit": "f699e30ca1ba0c7f316847316fd0ba19d3ee51c1" }, + "which-key.nvim": { "branch": "main", "commit": "fb070344402cfc662299d9914f5546d840a22126" } +} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 0926e493..0542cd3a 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -4,6 +4,13 @@ -- See the kickstart.nvim README for more information return { + { + 'neovim/nvim-lspconfig', + config = function() + require('custom.plugins.lspconfig') -- This simply loads the lspconfig.lua file + end, + }, + -- nvim-autopairs configuration { "windwp/nvim-autopairs", @@ -51,5 +58,12 @@ return { }) end }, - { 'junegunn/gv.vim' } + { 'junegunn/gv.vim' }, + { + 'kyazdani42/nvim-web-devicons' + }, + { + 'echasnovski/mini.icons' + } + } diff --git a/lua/custom/plugins/lspconfig.lua b/lua/custom/plugins/lspconfig.lua new file mode 100644 index 00000000..36254e56 --- /dev/null +++ b/lua/custom/plugins/lspconfig.lua @@ -0,0 +1,28 @@ +local lspconfig = require('lspconfig') + +return { + 'neovim/nvim-lspconfig', + config = function() + -- Configure Python LSP (pylsp) + lspconfig.pylsp.setup { + settings = { + pylsp = { + plugins = { + mypy = { + enabled = true, + live_mode = false, + }, + pylint = { + enabled = true, + }, + pyflakes = { + enabled = false, -- Disable pyflakes if pylint is used + }, + }, + }, + }, + } + + end, +} + diff --git a/lua/kickstart/plugins/autoformat.lua b/lua/kickstart/plugins/autoformat.lua index bc56b15b..d06e0c94 100644 --- a/lua/kickstart/plugins/autoformat.lua +++ b/lua/kickstart/plugins/autoformat.lua @@ -5,9 +5,18 @@ return { 'neovim/nvim-lspconfig', + 'jose-elias-alvarez/null-ls.nvim', config = function() + -- Force .html files to be recognized as htmldjango for Jinja compatibility + vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { + pattern = "*.html", + callback = function() + vim.bo.filetype = "htmldjango" + end, + }) + -- Switch for controlling whether you want autoformatting. - -- Use :KickstartFormatToggle to toggle autoformatting on or off + -- Use :KickstartFormatToggle to toggle autoformatting on or off local format_is_enabled = true vim.api.nvim_create_user_command('KickstartFormatToggle', function() format_is_enabled = not format_is_enabled @@ -15,8 +24,8 @@ return { end, {}) -- Create an augroup that is used for managing our formatting autocmds. - -- We need one augroup per client to make sure that multiple clients - -- can attach to the same buffer without interfering with each other. + -- We need one augroup per client to make sure that multiple clients + -- can attach to the same buffer without interfering with each other. local _augroups = {} local get_augroup = function(client) if not _augroups[client.id] then @@ -51,7 +60,7 @@ return { end -- Create an autocmd that will run *before* we save the buffer. - -- Run the formatting command for the LSP that has just attached. + -- Run the formatting command for the LSP that has just attached. vim.api.nvim_create_autocmd('BufWritePre', { group = get_augroup(client), buffer = bufnr, @@ -70,5 +79,15 @@ return { }) end, }) + + -- Set up null-ls for additional formatting needs + null_ls.setup({ + sources = { + null_ls.builtins.formatting.prettier.with({ + filetypes = { "html", "jinja", "htmldjango" }, + }), + }, + }) end, } +