diff options
| author | Raghuram Subramani <raghus2247@gmail.com> | 2024-09-06 21:50:50 +0530 |
|---|---|---|
| committer | Raghuram Subramani <raghus2247@gmail.com> | 2024-09-06 21:50:50 +0530 |
| commit | 32fa47525533b73786d9b41e410a0e6106e18977 (patch) | |
| tree | 00c01659d6135529e1c0e8f159eab0ad20330abf | |
| parent | f4e27f7d82aad04b95ae8238c3a9d21b16a43830 (diff) | |
update
| -rw-r--r-- | config/nvim/init.lua | 114 | ||||
| -rw-r--r-- | flake.lock | 12 | ||||
| -rw-r--r-- | machines/d/home.nix | 2 | ||||
| -rw-r--r-- | machines/v/home.nix | 1 | ||||
| -rw-r--r-- | machines/x/home.nix | 4 |
5 files changed, 65 insertions, 68 deletions
diff --git a/config/nvim/init.lua b/config/nvim/init.lua index 4823b2e..bb2a482 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -25,20 +25,20 @@ vim.api.nvim_create_autocmd('VimLeave',{ }) -- Setup Packages -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' if not (vim.uv or vim.loop).fs_stat(lazypath) then vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release + 'git', + 'clone', + '--filter=blob:none', + 'https://github.com/folke/lazy.nvim.git', + '--branch=stable', -- latest stable release lazypath, }) end vim.opt.rtp:prepend(lazypath) -require("lazy").setup({ +require('lazy').setup({ 'lukas-reineke/indent-blankline.nvim', 'windwp/nvim-autopairs', 'numToStr/Comment.nvim', @@ -55,12 +55,18 @@ require("lazy").setup({ 'L3MON4D3/LuaSnip', 'nvim-telescope/telescope.nvim', 'nvim-lua/plenary.nvim', + 'klen/nvim-config-local', 'stevearc/oil.nvim', 'christoomey/vim-tmux-navigator' }) +require('config-local').setup { + config_files = { ".nvim.lua", ".nvimrc", ".exrc" }, + hashfile = vim.fn.stdpath("data") .. "/config-local", +} + local oil = require('oil') _G.oil = oil oil.setup { @@ -76,15 +82,15 @@ oil.setup { require('ibl').setup() require('Comment').setup { - padding = true, - toggler = { - line = '\\\\', - block = ']]' - }, - opleader = { - line = '\\\\', - block = ']]' - } + padding = true, + toggler = { + line = '\\\\', + block = ']]' + }, + opleader = { + line = '\\\\', + block = ']]' + } } -- CMP Setup @@ -95,54 +101,44 @@ cmp.setup({ require('luasnip').lsp_expand(args.body) end }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - ['<C-b>'] = cmp.mapping.scroll_docs(-4), - ['<C-f>'] = cmp.mapping.scroll_docs(4), - ['<C-Space>'] = cmp.mapping.complete(), - ['<TAB>'] = cmp.mapping.confirm({ select = true }), - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' } - }, { - { name = 'buffer' }, - } + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + ['<C-b>'] = cmp.mapping.scroll_docs(-4), + ['<C-f>'] = cmp.mapping.scroll_docs(4), + ['<C-Space>'] = cmp.mapping.complete(), + ['<TAB>'] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' } + }, { + { name = 'buffer' }, + } ) }) cmp.setup.filetype('gitcommit', { - sources = cmp.config.sources({ - { name = 'cmp_git' }, - }, { - { name = 'buffer' }, - }) + sources = cmp.config.sources({ + { name = 'cmp_git' }, + }, { + { name = 'buffer' }, + }) }) cmp.setup.cmdline({ '/', '?' }, { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = 'buffer' } - } + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' } + } }) cmp.setup.cmdline(':', { - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline' } - }) + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) }) --- Set Up Lspconfig -local lspconfig = require('lspconfig') -local capabilities = require('cmp_nvim_lsp').default_capabilities() -servers = { 'pyright', 'ccls', 'gopls' } -for _, lsp in pairs(servers) do - lspconfig[lsp].setup { - capabilities = capabilities - } -end - -- Set Up Telescope local actions = require('telescope.actions') local telescope = require('telescope') @@ -209,3 +205,11 @@ map('n', '<A-<>', '<Cmd>BufferMovePrevious<CR>', opts) map('n', '<A->>', '<Cmd>BufferMoveNext<CR>', opts) -- Close buffer map('n', '<A-c>', '<Cmd>BufferClose<CR>', opts) + +vim.api.nvim_create_augroup('AutoFormatting', {}) +vim.api.nvim_create_autocmd('BufWritePre', { + group = 'AutoFormatting', + callback = function() + vim.lsp.buf.format() + end, +}) @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1723015306, - "narHash": "sha256-jQnFEtH20/OsDPpx71ntZzGdRlpXhUENSQCGTjn//NA=", + "lastModified": 1725180166, + "narHash": "sha256-fzssXuGR/mCeGbzM1ExaTqDz7QDGta3WA4jJsZyRruo=", "owner": "nix-community", "repo": "home-manager", - "rev": "b3d5ea65d88d67d4ec578ed11d4d2d51e3de525e", + "rev": "471e3eb0a114265bcd62d11d58ba8d3421ee68eb", "type": "github" }, "original": { @@ -22,11 +22,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1722813957, - "narHash": "sha256-IAoYyYnED7P8zrBFMnmp7ydaJfwTnwcnqxUElC1I26Y=", + "lastModified": 1725432240, + "narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "cb9a96f23c491c081b38eab96d22fa958043c9fa", + "rev": "ad416d066ca1222956472ab7d0555a6946746a80", "type": "github" }, "original": { diff --git a/machines/d/home.nix b/machines/d/home.nix index 7c0a463..41b1380 100644 --- a/machines/d/home.nix +++ b/machines/d/home.nix @@ -19,8 +19,6 @@ unzip zip - ccls - pyright git-lfs ]; diff --git a/machines/v/home.nix b/machines/v/home.nix index d8a1100..201d8db 100644 --- a/machines/v/home.nix +++ b/machines/v/home.nix @@ -19,7 +19,6 @@ unzip zip - ccls pyright git-lfs ]; diff --git a/machines/x/home.nix b/machines/x/home.nix index 0f68e65..52b6f06 100644 --- a/machines/x/home.nix +++ b/machines/x/home.nix @@ -29,11 +29,7 @@ wl-clipboard - clang-tools - ccls - ruff-lsp git-lfs - slides ]; |
