diff options
| author | Spacedio <spacedio@thernusen.net> | 2026-04-26 14:37:07 -0400 |
|---|---|---|
| committer | Spacedio <spacedio@thernusen.net> | 2026-04-26 14:37:07 -0400 |
| commit | 96c61a054f8da62dcae64ad9c76885be05826312 (patch) | |
| tree | d59ca10a31bd36c455aa8b9e964e3c89658111cb /nvim/.config | |
| parent | 18251f226832b5e18834fce7f39650d030fa6a8b (diff) | |
| download | dotfiles-laptop/x1-carbon.tar.gz | |
Initial commit of the x1-carbon wayland branch.laptop/x1-carbon
Diffstat (limited to 'nvim/.config')
| -rw-r--r-- | nvim/.config/nvim/lazy-lock.json | 23 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/plugins/lsp.lua | 231 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/plugins/one-liners.lua | 16 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/plugins/telescope.lua | 15 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/plugins/treesitter.lua | 35 |
5 files changed, 2 insertions, 318 deletions
diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 48dfe4f..f3c3533 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,25 +1,6 @@ { - "LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" }, - "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, - "cmp-nvim-lua": { "branch": "main", "commit": "e3a22cb071eb9d6508a156306b102c45cd2d573d" }, - "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, - "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, - "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "6c4830e37743b060d13c9269394176aea6a0fbc8" }, - "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, - "nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-highlight-colors": { "branch": "main", "commit": "e2cb22089cc2358b2b995c09578224f142de6039" }, - "nvim-lspconfig": { "branch": "master", "commit": "b7dcde3e6195b43476ae799720b177aedc16d44c" }, - "nvim-osc52": { "branch": "main", "commit": "04cfaba1865ae5c53b6f887c3ca7304973824fb2" }, - "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" }, - "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, - "telescope.nvim": { "branch": "master", "commit": "3333a52ff548ba0a68af6d8da1e54f9cd96e9179" }, - "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }, - "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" } + "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" } } diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua deleted file mode 100644 index 2e2c368..0000000 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ /dev/null @@ -1,231 +0,0 @@ -return { - 'neovim/nvim-lspconfig', - dependencies = { - 'williamboman/mason.nvim', - 'williamboman/mason-lspconfig.nvim', - -- Autocompletion - 'hrsh7th/nvim-cmp', - 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-path', - 'saadparwaiz1/cmp_luasnip', - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-nvim-lua', - -- Snippets - 'L3MON4D3/LuaSnip', - 'rafamadriz/friendly-snippets', - }, - config = function() - local autoformat_filetypes = { - "lua", - } - -- Create a keymap for vim.lsp.buf.implementation - vim.api.nvim_create_autocmd('LspAttach', { - callback = function(args) - local client = vim.lsp.get_client_by_id(args.data.client_id) - if not client then return end - if vim.tbl_contains(autoformat_filetypes, vim.bo.filetype) then - vim.api.nvim_create_autocmd("BufWritePre", { - buffer = args.buf, - callback = function() - vim.lsp.buf.format({ - formatting_options = { tabSize = 4, insertSpaces = true }, - bufnr = args.buf, - id = client.id - }) - end - }) - end - end - }) - - -- Add borders to floating windows - vim.lsp.handlers['textDocument/hover'] = vim.lsp.with( - vim.lsp.handlers.hover, - { border = 'rounded' } - ) - vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with( - vim.lsp.handlers.signature_help, - { border = 'rounded' } - ) - - -- Configure error/warnings interface - vim.diagnostic.config({ - virtual_text = true, - severity_sort = true, - float = { - style = 'minimal', - border = 'rounded', - header = '', - prefix = '', - }, - signs = { - text = { - [vim.diagnostic.severity.ERROR] = '✘', - [vim.diagnostic.severity.WARN] = '▲', - [vim.diagnostic.severity.HINT] = '⚑', - [vim.diagnostic.severity.INFO] = '»', - }, - }, - }) - - -- Add cmp_nvim_lsp capabilities settings to lspconfig - -- This should be executed before you configure any language server - local lspconfig_defaults = require('lspconfig').util.default_config - lspconfig_defaults.capabilities = vim.tbl_deep_extend( - 'force', - lspconfig_defaults.capabilities, - require('cmp_nvim_lsp').default_capabilities() - ) - - -- This is where you enable features that only work - -- if there is a language server active in the file - vim.api.nvim_create_autocmd('LspAttach', { - callback = function(event) - local opts = { buffer = event.buf } - - vim.keymap.set('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>', opts) - vim.keymap.set('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>', opts) - vim.keymap.set('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>', opts) - vim.keymap.set('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>', opts) - vim.keymap.set('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>', opts) - vim.keymap.set('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>', opts) - vim.keymap.set('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>', opts) - vim.keymap.set('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>', opts) - vim.keymap.set('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>', opts) - vim.keymap.set({ 'n', 'x' }, '<F3>', '<cmd>lua vim.lsp.buf.format({async = true})<cr>', opts) - vim.keymap.set('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>', opts) - end, - }) - - require('mason').setup({}) - require('mason-lspconfig').setup({ - ensure_installed = { - "lua_ls", - "intelephense", - "ts_ls", - "eslint", - }, - handlers = { - -- this first function is the "default handler" - -- it applies to every language server without a custom handler - function(server_name) - require('lspconfig')[server_name].setup({}) - end, - - -- this is the "custom handler" for `lua_ls` - lua_ls = function() - require('lspconfig').lua_ls.setup({ - settings = { - Lua = { - runtime = { - version = 'LuaJIT', - }, - diagnostics = { - globals = { 'vim' }, - }, - workspace = { - library = { vim.env.VIMRUNTIME }, - }, - }, - }, - }) - end, - }, - }) - - local cmp = require('cmp') - - require('luasnip.loaders.from_vscode').lazy_load() - - vim.opt.completeopt = { 'menu', 'menuone', 'noselect' } - - cmp.setup({ - preselect = 'item', - completion = { - completeopt = 'menu,menuone,noinsert' - }, - window = { - documentation = cmp.config.window.bordered(), - }, - sources = { - { name = 'path' }, - { name = 'nvim_lsp' }, - { name = 'buffer', keyword_length = 3 }, - { name = 'luasnip', keyword_length = 2 }, - }, - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) - end, - }, - formatting = { - fields = { 'abbr', 'menu', 'kind' }, - format = function(entry, item) - local n = entry.source.name - if n == 'nvim_lsp' then - item.menu = '[LSP]' - else - item.menu = string.format('[%s]', n) - end - return item - end, - }, - mapping = cmp.mapping.preset.insert({ - -- confirm completion item - ['<CR>'] = cmp.mapping.confirm({ select = false }), - - -- scroll documentation window - ['<C-f>'] = cmp.mapping.scroll_docs(5), - ['<C-u>'] = cmp.mapping.scroll_docs(-5), - - -- toggle completion menu - ['<C-e>'] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.abort() - else - cmp.complete() - end - end), - - -- tab complete - ['<Tab>'] = cmp.mapping(function(fallback) - local col = vim.fn.col('.') - 1 - - if cmp.visible() then - cmp.select_next_item({ behavior = 'select' }) - elseif col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then - fallback() - else - cmp.complete() - end - end, { 'i', 's' }), - - -- go to previous item - ['<S-Tab>'] = cmp.mapping.select_prev_item({ behavior = 'select' }), - - -- navigate to next snippet placeholder - ['<C-d>'] = cmp.mapping(function(fallback) - local luasnip = require('luasnip') - - if luasnip.jumpable(1) then - luasnip.jump(1) - else - fallback() - end - end, { 'i', 's' }), - - -- navigate to the previous snippet placeholder - ['<C-b>'] = cmp.mapping(function(fallback) - local luasnip = require('luasnip') - - if luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { 'i', 's' }), - }), - }) - end -} - diff --git a/nvim/.config/nvim/lua/plugins/one-liners.lua b/nvim/.config/nvim/lua/plugins/one-liners.lua deleted file mode 100644 index fe240f1..0000000 --- a/nvim/.config/nvim/lua/plugins/one-liners.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - { "tpope/vim-fugitive" }, - { "ojroques/nvim-osc52" }, - { - "norcalli/nvim-colorizer.lua", - config = function() - require("colorizer").setup() - end, - }, - { - "brenoprata10/nvim-highlight-colors", - config = function() - require('nvim-highlight-colors').setup({}) - end - }, -} diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua deleted file mode 100644 index 49d1276..0000000 --- a/nvim/.config/nvim/lua/plugins/telescope.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - 'nvim-telescope/telescope.nvim', version = '*', - dependencies = { - 'nvim-lua/plenary.nvim', - -- optional but recommended - { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, - }, - config = function() - local builtin = require('telescope.builtin') - vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' }) - vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live grep' }) - vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' }) - vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' }) - end -} diff --git a/nvim/.config/nvim/lua/plugins/treesitter.lua b/nvim/.config/nvim/lua/plugins/treesitter.lua deleted file mode 100644 index e430504..0000000 --- a/nvim/.config/nvim/lua/plugins/treesitter.lua +++ /dev/null @@ -1,35 +0,0 @@ -return { - 'nvim-treesitter/nvim-treesitter', - branch = 'master', -- Important: Use the 'main' branch - build = ':TSUpdate', - config = function() - - -- Configure nvim-treesitter with ensure_installed - require("nvim-treesitter.configs").setup({ - ensure_installed = { - 'lua', - 'vim', - 'python', - 'javascript', - 'typescript', - 'go', - 'yaml', - 'bash', - 'html', - 'css', - 'markdown', - 'markdown_inline', - 'sql', - }, - highlight = { - enable = true, - }, - indent = { - enable = true, - }, -}) - - - - end, -} |
