diff options
| author | Aargh Rai <aargh.rai+git@gmail.com> | 2026-06-18 15:43:12 +0530 |
|---|---|---|
| committer | Aargh Rai <aargh.rai+git@gmail.com> | 2026-06-18 15:43:12 +0530 |
| commit | 47d419e46aea94a1fee788003a27770eab11329c (patch) | |
| tree | 8fc090d2f46a403a48ca389321a1e82978721d00 | |
| parent | e8e5ed4f7e684ee38a5f20162053e68f2911ff1e (diff) | |
custom made my nvim config
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | flake.nix | 8 | ||||
| -rw-r--r-- | foot/foot.ini | 2 | ||||
| -rw-r--r-- | hypr/hyprland/input.conf | 2 | ||||
| -rw-r--r-- | nixos/desktop-environment.nix | 14 | ||||
| -rw-r--r-- | nixos/environment.nix | 1 | ||||
| -rw-r--r-- | nvim/.stylua.toml | 6 | ||||
| -rw-r--r-- | nvim/LICENSE | 24 | ||||
| -rw-r--r-- | nvim/README.md | 9 | ||||
| -rw-r--r-- | nvim/init.lua | 498 | ||||
| -rw-r--r-- | nvim/lazy-lock.json | 31 | ||||
| -rw-r--r-- | nvim/lua/autocmds.lua | 1 | ||||
| -rw-r--r-- | nvim/lua/chadrc.lua | 24 | ||||
| -rw-r--r-- | nvim/lua/configs/conform.lua | 15 | ||||
| -rw-r--r-- | nvim/lua/configs/lazy.lua | 47 | ||||
| -rw-r--r-- | nvim/lua/configs/lspconfig.lua | 26 | ||||
| -rw-r--r-- | nvim/lua/mappings.lua | 9 | ||||
| -rw-r--r-- | nvim/lua/options.lua | 10 | ||||
| -rw-r--r-- | nvim/lua/plugins/init.lua | 50 | ||||
| -rw-r--r-- | nvim/nvim-pack-lock.json | 69 |
20 files changed, 553 insertions, 294 deletions
@@ -1,3 +1,4 @@ hypr-zoom *.hm-backup *.dat +*.bk @@ -60,6 +60,12 @@ enable = true; minecraft = true; }; + + # TODO + sessions = { + plasma_x11 = true; + hyprland_wayland = true; + }; dualbootedwithwindows = false; # This is where I have keep the dotfiles folder, replace it accordingly @@ -76,7 +82,7 @@ inherit quickshell inputs system username hostname unstable symlinkRoot opt languages terminalworkspace - dualbootedwithwindows games; + dualbootedwithwindows games sessions; }; modules = [ diff --git a/foot/foot.ini b/foot/foot.ini index ad5d15f..383b8ee 100644 --- a/foot/foot.ini +++ b/foot/foot.ini @@ -2,4 +2,4 @@ font=JetBrainsMono Nerd Font:size=12 [colors-dark] -background=1e2122 +background=282828 diff --git a/hypr/hyprland/input.conf b/hypr/hyprland/input.conf index 96214ff..4f2e755 100644 --- a/hypr/hyprland/input.conf +++ b/hypr/hyprland/input.conf @@ -20,6 +20,6 @@ input { # See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more device { name = epic-mouse-v1 - sensitivity = -0.5 + sensitivity = -0.01 } diff --git a/nixos/desktop-environment.nix b/nixos/desktop-environment.nix index df0abdd..7f4fa4e 100644 --- a/nixos/desktop-environment.nix +++ b/nixos/desktop-environment.nix @@ -11,11 +11,12 @@ programs.sway.enable = true; programs.dconf.enable = true; environment.systemPackages = with pkgs; [ + libGL + quickshell.packages.${pkgs.system}.quickshell qt6.qtwayland catppuccin-cursors.mochaMauve swaybg - wl-clipboard mako lm_sensors grim @@ -25,5 +26,16 @@ hyprpicker playerctl libnotify + + wl-clipboard + + xclip + libx11 + libxrandr + libxinerama + libxcursor + libxi + libxext + libxfixes ]; } diff --git a/nixos/environment.nix b/nixos/environment.nix index d8f70e5..2601bad 100644 --- a/nixos/environment.nix +++ b/nixos/environment.nix @@ -71,6 +71,7 @@ lolcat just process-compose + ffmpeg jq termshark diff --git a/nvim/.stylua.toml b/nvim/.stylua.toml deleted file mode 100644 index ecb6dca..0000000 --- a/nvim/.stylua.toml +++ /dev/null @@ -1,6 +0,0 @@ -column_width = 120 -line_endings = "Unix" -indent_type = "Spaces" -indent_width = 2 -quote_style = "AutoPreferDouble" -call_parentheses = "None" diff --git a/nvim/LICENSE b/nvim/LICENSE deleted file mode 100644 index fdddb29..0000000 --- a/nvim/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -This is free and unencumbered software released into the public domain. - -Anyone is free to copy, modify, publish, use, compile, sell, or -distribute this software, either in source code form or as a compiled -binary, for any purpose, commercial or non-commercial, and by any -means. - -In jurisdictions that recognize copyright laws, the author or authors -of this software dedicate any and all copyright interest in the -software to the public domain. We make this dedication for the benefit -of the public at large and to the detriment of our heirs and -successors. We intend this dedication to be an overt act of -relinquishment in perpetuity of all present and future rights to this -software under copyright law. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -For more information, please refer to <https://unlicense.org> diff --git a/nvim/README.md b/nvim/README.md deleted file mode 100644 index 769fbdf..0000000 --- a/nvim/README.md +++ /dev/null @@ -1,9 +0,0 @@ -**This repo is supposed to be used as config by NvChad users!** - -- The main nvchad repo (NvChad/NvChad) is used as a plugin by this repo. -- So you just import its modules , like `require "nvchad.options" , require "nvchad.mappings"` -- So you can delete the .git from this repo ( when you clone it locally ) or fork it :) - -# Credits - -1) Lazyvim starter https://github.com/LazyVim/starter as nvchad's starter was inspired by Lazyvim's . It made a lot of things easier! diff --git a/nvim/init.lua b/nvim/init.lua index 864b997..9c61926 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,48 +1,470 @@ -vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/" -vim.g.mapleader = " " +vim.loader.enable() +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' +vim.g.have_nerd_font = true +vim.opt.wrap = false +vim.opt.colorcolumn = "80" +vim.o.number = true +vim.o.relativenumber = true +vim.o.mouse = 'a' +vim.o.showmode = false +vim.schedule(function() vim.o.clipboard = 'unnamedplus' end) +vim.o.breakindent = true +vim.o.undofile = true +vim.o.ignorecase = true +vim.o.smartcase = true +vim.o.signcolumn = 'yes' +vim.o.updatetime = 250 +vim.o.timeoutlen = 300 +vim.o.splitright = true +vim.o.splitbelow = true +vim.o.list = true +vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } +vim.o.inccommand = 'split' +vim.o.cursorline = true +vim.o.scrolloff = 5 +vim.o.confirm = true --- bootstrap lazy and all plugins -local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" +vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>') +vim.diagnostic.config { + update_in_insert = false, + severity_sort = true, + float = { border = 'rounded', source = 'if_many' }, + underline = { severity = { min = vim.diagnostic.severity.WARN } }, -if not vim.uv.fs_stat(lazypath) then - local repo = "https://github.com/folke/lazy.nvim.git" - vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath } -end + virtual_text = true, + virtual_lines = false, -vim.opt.rtp:prepend(lazypath) - -local lazy_config = require "configs.lazy" - --- load plugins -require("lazy").setup({ - { - "NvChad/NvChad", - lazy = false, - branch = "v2.5", - import = "nvchad.plugins", - config = function() - require "options" - local nvim_tree_options = require "nvchad.configs.nvimtree" - nvim_tree_options.filters.dotfiles = false -- To show dotfiles as well - nvim_tree_options.filters.git_ignored = false -- Set this to false to show git ignored files - nvim_tree_options.git = { - enable = true, - ignore = false, -- Set this to false to show git ignored files - timeout = 500, + jump = { + on_jump = function(_, bufnr) + vim.diagnostic.open_float { + bufnr = bufnr, + scope = 'cursor', + focus = false, } end, }, +} + +vim.keymap.set("n", "<leader>mh", "<cmd>:wincmd h<CR>", { desc = "Move between windows (h)" }) +vim.keymap.set("n", "<leader>mj", "<cmd>:wincmd j<CR>", { desc = "Move between windows (j)" }) +vim.keymap.set("n", "<leader>mk", "<cmd>:wincmd k<CR>", { desc = "Move between windows (k)" }) +vim.keymap.set("n", "<leader>ml", "<cmd>:wincmd l<CR>", { desc = "Move between windows (l)" }) + +vim.keymap.set("n", "<leader>sv", "<cmd>:vsplit<CR>", { desc = "Split vertically" }) +vim.keymap.set("n", "<leader>sh", "<cmd>:split<CR>", { desc = "Split horizontally" }) + +vim.api.nvim_create_autocmd('TextYankPost', { + desc = 'Highlight when yanking (copying) text', + group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), + callback = function() vim.hl.on_yank() end, +}) + +local function run_build(name, cmd, cwd) + local result = vim.system(cmd, { cwd = cwd }):wait() + if result.code ~= 0 then + local stderr = result.stderr or '' + local stdout = result.stdout or '' + local output = stderr ~= '' and stderr or stdout + if output == '' then output = 'No output from build command.' end + vim.notify(('Build failed for %s:\n%s'):format(name, output), vim.log.levels.ERROR) + end +end + +vim.api.nvim_create_autocmd('PackChanged', { + callback = function(ev) + local name = ev.data.spec.name + local kind = ev.data.kind + if kind ~= 'install' and kind ~= 'update' then return end + + if name == 'telescope-fzf-native.nvim' and vim.fn.executable 'make' == 1 then + run_build(name, { 'make' }, ev.data.path) + return + end + + if name == 'LuaSnip' then + if vim.fn.has 'win32' ~= 1 and vim.fn.executable 'make' == 1 then run_build(name, { 'make', 'install_jsregexp' }, ev.data.path) end + return + end + + if name == 'nvim-treesitter' then + if not ev.data.active then vim.cmd.packadd 'nvim-treesitter' end + vim.cmd 'TSUpdate' + return + end + end, +}) + +---@param repo string +---@return string +local function gh(repo) return 'https://github.com/' .. repo end + +vim.pack.add { gh 'NMAC427/guess-indent.nvim' } +require('guess-indent').setup {} + +-- Here is a more advanced configuration example that passes options to `gitsigns.nvim` +-- +-- See `:help gitsigns` to understand what each configuration key does. +-- Adds git related signs to the gutter, as well as utilities for managing changes +vim.pack.add { gh 'lewis6991/gitsigns.nvim' } +require('gitsigns').setup { + signs = { + add = { text = '+' }, ---@diagnostic disable-line: missing-fields + change = { text = '~' }, ---@diagnostic disable-line: missing-fields + delete = { text = '_' }, ---@diagnostic disable-line: missing-fields + topdelete = { text = '‾' }, ---@diagnostic disable-line: missing-fields + changedelete = { text = '~' }, ---@diagnostic disable-line: missing-fields + }, +} + +vim.pack.add { gh 'folke/which-key.nvim' } +require('which-key').setup { + delay = 0, + icons = { mappings = vim.g.have_nerd_font }, + spec = { + { '<leader>s', group = '[S]plit', mode = { 'n' } }, + { '<leader>f', group = '[F]ind', mode = { 'n', 'v' } }, + { '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } }, + { 'gr', group = 'LSP Actions', mode = { 'n' } }, + }, +} + +vim.pack.add { gh 'MunifTanjim/nui.nvim' } +vim.pack.add { gh 'X3eRo0/dired.nvim' } +require('dired').setup { } + +vim.pack.add { gh 'ellisonleao/gruvbox.nvim' } +vim.cmd.colorscheme 'gruvbox' + +vim.pack.add { gh 'folke/todo-comments.nvim' } +require('todo-comments').setup { signs = false } + +vim.pack.add { gh 'nvim-mini/mini.nvim' } + +if vim.g.have_nerd_font then + require('mini.icons').setup() + MiniIcons.mock_nvim_web_devicons() +end + +require('mini.ai').setup { + -- NOTE: Avoid conflicts with the built-in incremental selection mappings on Neovim>=0.12 (see `:help treesitter-incremental-selection`) + mappings = { + around_next = 'aa', + inside_next = 'ii', + }, + n_lines = 500, +} + +require('mini.surround').setup() +local statusline = require 'mini.statusline' +statusline.setup { use_icons = vim.g.have_nerd_font } +---@diagnostic disable-next-line: duplicate-set-field +statusline.section_location = function() return '%2l:%-2v' end + +---@type (string|vim.pack.Spec)[] +local telescope_plugins = { + gh 'nvim-lua/plenary.nvim', + gh 'nvim-telescope/telescope.nvim', + gh 'nvim-telescope/telescope-ui-select.nvim', +} +if vim.fn.executable 'make' == 1 then table.insert(telescope_plugins, gh 'nvim-telescope/telescope-fzf-native.nvim') end + +vim.pack.add(telescope_plugins) + +require('telescope').setup { + extensions = { + ['ui-select'] = { require('telescope.themes').get_dropdown() }, + }, +} + +pcall(require('telescope').load_extension, 'fzf') +pcall(require('telescope').load_extension, 'ui-select') + +local builtin = require 'telescope.builtin' +vim.keymap.set('n', '<leader>fk', builtin.keymaps, { desc = '[F]ind [K]eymaps' }) +vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = '[F]ind [F]iles' }) +vim.keymap.set({ 'n', 'v' }, '<leader>fw', builtin.grep_string, { desc = '[F]ind current [W]ord' }) +vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = '[F]ind by [G]rep' }) +vim.keymap.set('n', '<leader>fd', builtin.diagnostics, { desc = '[F]ind [D]iagnostics' }) +vim.keymap.set('n', '<leader>fc', builtin.commands, { desc = '[F]ind [C]ommands' }) +vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' }) + +vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('telescope-lsp-attach', { clear = true }), + callback = function(event) + local buf = event.buf + vim.keymap.set('n', 'grr', builtin.lsp_references, { buffer = buf, desc = '[G]oto [R]eferences' }) + vim.keymap.set('n', 'gri', builtin.lsp_implementations, { buffer = buf, desc = '[G]oto [I]mplementation' }) + vim.keymap.set('n', 'grd', builtin.lsp_definitions, { buffer = buf, desc = '[G]oto [D]efinition' }) + vim.keymap.set('n', 'gO', builtin.lsp_document_symbols, { buffer = buf, desc = 'Open Document Symbols' }) + vim.keymap.set('n', 'gW', builtin.lsp_dynamic_workspace_symbols, { buffer = buf, desc = 'Open Workspace Symbols' }) + vim.keymap.set('n', 'grt', builtin.lsp_type_definitions, { buffer = buf, desc = '[G]oto [T]ype Definition' }) + end, +}) + +vim.keymap.set('n', '<leader>fc', function() + builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { + winblend = 10, + previewer = false, + }) +end, { desc = '[F]uzzily search in [c]urrent buffer' }) + +vim.keymap.set( + 'n', + '<leader>f/', + function() + builtin.live_grep { + grep_open_files = true, + prompt_title = 'Live Grep in Open Files', + } + end, + { desc = '[F]ind in Open Files' } +) + +vim.pack.add { gh 'j-hui/fidget.nvim' } +require('fidget').setup {} + +vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), + callback = function(event) + local map = function(keys, func, desc, mode) + mode = mode or 'n' + vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) + end + + map('grn', vim.lsp.buf.rename, '[R]e[n]ame') + map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' }) + map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + local client = vim.lsp.get_client_by_id(event.data.client_id) + if client and client:supports_method('textDocument/documentHighlight', event.buf) then + local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) + vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.document_highlight, + }) + + vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.clear_references, + }) + + vim.api.nvim_create_autocmd('LspDetach', { + group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }), + callback = function(event2) + vim.lsp.buf.clear_references() + vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf } + end, + }) + end + if client and client:supports_method('textDocument/inlayHint', event.buf) then + map('<leader>th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints') + end + end, +}) + +local servers = { + -- clangd = {}, + -- gopls = {}, + -- pyright = {}, + -- rust_analyzer = {}, + -- + -- Some languages (like typescript) have entire language plugins that can be useful: + -- https://github.com/pmizio/typescript-tools.nvim + -- + -- But for many setups, the LSP (`ts_ls`) will work just fine + -- ts_ls = {}, + + stylua = {}, -- Used to format Lua code + + lua_ls = { + on_init = function(client) + client.server_capabilities.documentFormattingProvider = false + + if client.workspace_folders then + local path = client.workspace_folders[1].name + if path ~= vim.fn.stdpath 'config' and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) then return end + end + + client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { + runtime = { + version = 'LuaJIT', + path = { 'lua/?.lua', 'lua/?/init.lua' }, + }, + workspace = { + checkThirdParty = false, + -- NOTE: this is a lot slower and will cause issues when working on your own configuration. + -- See https://github.com/neovim/nvim-lspconfig/issues/3189 + library = vim.tbl_extend('force', vim.api.nvim_get_runtime_file('', true), { + '${3rd}/luv/library', + '${3rd}/busted/library', + }), + }, + }) + end, + ---@type lspconfig.settings.lua_ls + settings = { + Lua = { + format = { enable = false }, + }, + }, + }, +} + +vim.pack.add { + -- gh 'neovim/nvim-lspconfig', + -- gh 'mason-org/mason.nvim', + -- gh 'mason-org/mason-lspconfig.nvim', + -- gh 'WhoIsSethDaniel/mason-tool-installer.nvim', +} + +-- Automatically install LSPs and related tools to stdpath for Neovim +-- require('mason').setup {} + +local ensure_installed = vim.tbl_keys(servers or {}) +vim.list_extend(ensure_installed, { + -- You can add other tools here that you want Mason to install +}) + +-- require('mason-tool-installer').setup { ensure_installed = ensure_installed } + +for name, server in pairs(servers) do + vim.lsp.config(name, server) + vim.lsp.enable(name) +end + +vim.pack.add { gh 'stevearc/conform.nvim' } +require('conform').setup { + notify_on_error = false, + format_on_save = function(bufnr) + local enabled_filetypes = { +c = true, + lua = true, + python = true, + } + if enabled_filetypes[vim.bo[bufnr].filetype] then + return { timeout_ms = 500 } + else + return nil + end + end, + default_format_opts = { + lsp_format = 'fallback', -- Use external formatters if configured below, otherwise use LSP formatting. Set to `false` to disable LSP formatting entirely. + }, + -- You can also specify external formatters in here. + formatters_by_ft = { + -- rust = { 'rustfmt' }, + -- Conform can also run multiple formatters sequentially + -- python = { "isort", "black" }, + -- + -- You can use 'stop_after_first' to run the first available formatter from the list + -- javascript = { "prettierd", "prettier", stop_after_first = true }, + }, +} + +vim.keymap.set({ 'n', 'v' }, '<leader>f', function() require('conform').format { async = true } end, { desc = '[F]ormat buffer' }) + +-- vim.pack.add { { src = gh 'L3MON4D3/LuaSnip', version = vim.version.range '2.*' } } +-- require('luasnip').setup {} + +-- `friendly-snippets` contains a variety of premade snippets. +-- See the README about individual language/framework/plugin snippets: +-- https://github.com/rafamadriz/friendly-snippets +-- +-- vim.pack.add { gh 'rafamadriz/friendly-snippets' } +-- require('luasnip.loaders.from_vscode').lazy_load() + +-- [[ Autocomplete Engine ]] +-- vim.pack.add { { src = gh 'saghen/blink.cmp', version = vim.version.range '1.*' } } +-- require('blink.cmp').setup { + -- keymap = { + -- 'default' (recommended) for mappings similar to built-in completions + -- <c-y> to accept ([y]es) the completion. + -- This will auto-import if your LSP supports it. + -- This will expand snippets if the LSP sent a snippet. + -- 'super-tab' for tab to accept + -- 'enter' for enter to accept + -- 'none' for no mappings + -- + -- For an understanding of why the 'default' preset is recommended, + -- you will need to read `:help ins-completion` + -- + -- No, but seriously. Please read `:help ins-completion`, it is really good! + -- + -- All presets have the following mappings: + -- <tab>/<s-tab>: move to right/left of your snippet expansion + -- <c-space>: Open menu or open docs if already open + -- <c-n>/<c-p> or <up>/<down>: Select next/previous item + -- <c-e>: Hide menu + -- <c-k>: Toggle signature help + -- + -- See `:help blink-cmp-config-keymap` for defining your own keymap + -- preset = 'default', + + -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: + -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps + -- }, + + -- appearance = { + -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' + -- Adjusts spacing to ensure icons are aligned + -- nerd_font_variant = 'mono', + -- }, + + -- completion = { + -- By default, you may press `<c-space>` to show the documentation. + -- Optionally, set `auto_show = true` to show the documentation after a delay. + -- documentation = { auto_show = false, auto_show_delay_ms = 500 }, + -- }, + + -- sources = { + -- default = { 'lsp', 'path', 'snippets' }, + -- }, + + -- snippets = { preset = 'luasnip' }, + + -- Blink.cmp includes an optional, recommended rust fuzzy matcher, + -- which automatically downloads a prebuilt binary when enabled. + -- + -- By default, we use the Lua implementation instead, but you may enable + -- the rust implementation via `'prefer_rust_with_warning'` + -- + -- See `:help blink-cmp-config-fuzzy` for more information + -- fuzzy = { implementation = 'lua' }, + + -- Shows a signature help window while you type arguments for a function + -- signature = { enabled = true }, +-- } + +vim.pack.add { { src = gh 'nvim-treesitter/nvim-treesitter', version = 'main' } } + +local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } +require('nvim-treesitter').install(parsers) + +local function treesitter_try_attach(buf, language) + if not vim.treesitter.language.add(language) then return end + vim.treesitter.start(buf, language) + local has_indent_query = vim.treesitter.query.get(language, 'indents') ~= nil + if has_indent_query then vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" end +end - { import = "plugins" }, -}, lazy_config) +local available_parsers = require('nvim-treesitter').get_available() +vim.api.nvim_create_autocmd('FileType', { + callback = function(args) + local buf, filetype = args.buf, args.match --- load theme -dofile(vim.g.base46_cache .. "defaults") -dofile(vim.g.base46_cache .. "statusline") + local language = vim.treesitter.language.get_lang(filetype) + if not language then return end -require "options" -require "autocmds" + local installed_parsers = require('nvim-treesitter').get_installed 'parsers' -vim.schedule(function() - require "mappings" -end) + if vim.tbl_contains(installed_parsers, language) then + treesitter_try_attach(buf, language) + elseif vim.tbl_contains(available_parsers, language) then + require('nvim-treesitter').install(language):await(function() treesitter_try_attach(buf, language) end) + else + treesitter_try_attach(buf, language) + end + end, +}) diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json deleted file mode 100644 index 63dd0b6..0000000 --- a/nvim/lazy-lock.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "LuaSnip": { "branch": "master", "commit": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24" }, - "NvChad": { "branch": "v2.5", "commit": "d042cc975247c2aa55fcb228e5d146dc1dc6c648" }, - "base46": { "branch": "v3.0", "commit": "884b990dcdbe07520a0892da6ba3e8d202b46337" }, - "cmp-async-path": { "branch": "main", "commit": "f8af3f726e07f2e9d37672eaa9102581aefce149" }, - "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, - "cmp-nvim-lua": { "branch": "main", "commit": "e3a22cb071eb9d6508a156306b102c45cd2d573d" }, - "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" }, - "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, - "gitsigns.nvim": { "branch": "main", "commit": "dd3f588bacbeb041be6facf1742e42097f62165d" }, - "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, - "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, - "mason.nvim": { "branch": "main", "commit": "bb639d4bf385a4d89f478b83af4d770be05ab7eb" }, - "menu": { "branch": "main", "commit": "7a0a4a2896b715c066cfbe320bdc048091874cc6" }, - "minty": { "branch": "main", "commit": "aafc9e8e0afe6bf57580858a2849578d8d8db9e0" }, - "nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" }, - "nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" }, - "nvim-lspconfig": { "branch": "master", "commit": "a4ed4e761c400849e8c9f8bda33e5083f890268c" }, - "nvim-tree.lua": { "branch": "master", "commit": "07f541fcaa4a5ae019598240362449ab7e9812b3" }, - "nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" }, - "nvim-web-devicons": { "branch": "master", "commit": "0d7d35fa946837b8738b17c18d1faa1ac351e7f9" }, - "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, - "telescope.nvim": { "branch": "master", "commit": "7d324792b7943e4aa16ad007212e6acc6f9fe335" }, - "ui": { "branch": "v3.0", "commit": "3e67e9d5325fd47fdbc90ca00a147db2f3525754" }, - "undotree": { "branch": "master", "commit": "6fa6b57cda8459e1e4b2ca34df702f55242f4e4d" }, - "vim-tmux-navigator": { "branch": "master", "commit": "e41c431a0c7b7388ae7ba341f01a0d217eb3a432" }, - "volt": { "branch": "main", "commit": "620de1321f275ec9d80028c68d1b88b409c0c8b1" }, - "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } -} diff --git a/nvim/lua/autocmds.lua b/nvim/lua/autocmds.lua deleted file mode 100644 index d2db0bb..0000000 --- a/nvim/lua/autocmds.lua +++ /dev/null @@ -1 +0,0 @@ -require "nvchad.autocmds" diff --git a/nvim/lua/chadrc.lua b/nvim/lua/chadrc.lua deleted file mode 100644 index fb1b09b..0000000 --- a/nvim/lua/chadrc.lua +++ /dev/null @@ -1,24 +0,0 @@ --- This file needs to have same structure as nvconfig.lua --- https://github.com/NvChad/ui/blob/v3.0/lua/nvconfig.lua --- Please read that file to know all available options :( - ----@type ChadrcConfig -local M = {} - -M.base46 = { - theme = "gruvchad", - - -- hl_override = { - -- Comment = { italic = true }, - -- ["@comment"] = { italic = true }, - -- }, -} - --- M.nvdash = { load_on_startup = true } --- M.ui = { --- tabufline = { --- lazyload = false --- } ---} - -return M diff --git a/nvim/lua/configs/conform.lua b/nvim/lua/configs/conform.lua deleted file mode 100644 index 35ba6cf..0000000 --- a/nvim/lua/configs/conform.lua +++ /dev/null @@ -1,15 +0,0 @@ -local options = { - formatters_by_ft = { - lua = { "stylua" }, - -- css = { "prettier" }, - -- html = { "prettier" }, - }, - - -- format_on_save = { - -- -- These options will be passed to conform.format() - -- timeout_ms = 500, - -- lsp_fallback = true, - -- }, -} - -return options diff --git a/nvim/lua/configs/lazy.lua b/nvim/lua/configs/lazy.lua deleted file mode 100644 index cd170bd..0000000 --- a/nvim/lua/configs/lazy.lua +++ /dev/null @@ -1,47 +0,0 @@ -return { - defaults = { lazy = true }, - install = { colorscheme = { "nvchad" } }, - - ui = { - icons = { - ft = "", - lazy = " ", - loaded = "", - not_loaded = "", - }, - }, - - performance = { - rtp = { - disabled_plugins = { - "2html_plugin", - "tohtml", - "getscript", - "getscriptPlugin", - "gzip", - "logipat", - "netrw", - "netrwPlugin", - "netrwSettings", - "netrwFileHandlers", - "matchit", - "tar", - "tarPlugin", - "rrhelper", - "spellfile_plugin", - "vimball", - "vimballPlugin", - "zip", - "zipPlugin", - "tutor", - "rplugin", - "syntax", - "synmenu", - "optwin", - "compiler", - "bugreport", - "ftplugin", - }, - }, - }, -} diff --git a/nvim/lua/configs/lspconfig.lua b/nvim/lua/configs/lspconfig.lua deleted file mode 100644 index d89bd10..0000000 --- a/nvim/lua/configs/lspconfig.lua +++ /dev/null @@ -1,26 +0,0 @@ -require("nvchad.configs.lspconfig").defaults() - --- NOTE: DO NOT USE MASON TO INSTALL LSPs, THEY CONFLICT WITH THESE, IF YOU --- HAVE ANY INSTALLED, REMOVE THEM -local servers = { - "html", "cssls", "rust_analyzer", "zls", - "ts_ls", "pylsp" -} -vim.lsp.enable(servers) - -vim.lsp.config("clangd", { - cmd = { - "clangd", - "--query-driver=/run/current-system/sw/bin/arm-none-eabi-gcc", - }, -}) - - - -vim.lsp.config("gdscript", { - cmd = { "ncat", "localhost", "6005" }, - filetypes = { "gd", "gdscript", "gdscript3" }, -}) - -vim.lsp.enable("clangd") -vim.lsp.enable("gdscript") diff --git a/nvim/lua/mappings.lua b/nvim/lua/mappings.lua deleted file mode 100644 index 318473c..0000000 --- a/nvim/lua/mappings.lua +++ /dev/null @@ -1,9 +0,0 @@ -require "nvchad.mappings" - -local map = vim.keymap.set -local unmap = vim.keymap.del - -map("n", ";", ":", { desc = "CMD enter command mode" }) -map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>") -map({ "n", "v" }, "<C-f>", ":%s/") -map("n", "<leader>n", "<cmd>NvimTreeToggle<cr>", { desc = "Toggle file tree" }) diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua deleted file mode 100644 index b50a463..0000000 --- a/nvim/lua/options.lua +++ /dev/null @@ -1,10 +0,0 @@ -require "nvchad.options" - --- add yours here! -vim.opt.wrap = false -vim.opt.spell = true -vim.opt.spelllang = { "en" } -vim.opt.colorcolumn = "80" - --- local o = vim.o --- o.cursorlineopt ='both' -- to enable cursorline! diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua deleted file mode 100644 index 7ed8f4b..0000000 --- a/nvim/lua/plugins/init.lua +++ /dev/null @@ -1,50 +0,0 @@ -return { - { - "stevearc/conform.nvim", - -- event = 'BufWritePre', -- uncomment for format on save - opts = require "configs.conform", - }, - - -- These are some examples, uncomment them if you want to see them work! - { - "neovim/nvim-lspconfig", - config = function() - require "configs.lspconfig" - end, - }, - - { - "mbbill/undotree", - event = "BufReadPost", - config = function() - vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle, { desc = "Toggle UndoTree" }) - end, - }, - - -- test new blink - -- { import = "nvchad.blink.lazyspec" }, - - { - "nvim-treesitter/nvim-treesitter", - opts = { - ensure_installed = { - "vim", "lua", "vimdoc", - "html", "css", "elixir", "rust" - }, - }, - }, - - { - "christoomey/vim-tmux-navigator", - lazy = false, - }, - - { - "nvim-tree/nvim-tree.lua", - opts = { - view = { - side = "left" - } - } - }, -} diff --git a/nvim/nvim-pack-lock.json b/nvim/nvim-pack-lock.json new file mode 100644 index 0000000..07b5547 --- /dev/null +++ b/nvim/nvim-pack-lock.json @@ -0,0 +1,69 @@ +{ + "plugins": { + "conform.nvim": { + "rev": "619363c30309d29ffa631e67c8183f2a72caa373", + "src": "https://github.com/stevearc/conform.nvim" + }, + "dired.nvim": { + "rev": "7cf5ceb69a6bbea547f97397fa5310b1571eb03a", + "src": "https://github.com/X3eRo0/dired.nvim" + }, + "fidget.nvim": { + "rev": "82404b196e73a00b1727a91903beef5ddc319d22", + "src": "https://github.com/j-hui/fidget.nvim" + }, + "gitsigns.nvim": { + "rev": "25050e4ed39e628282831d4cbecb1850454ce915", + "src": "https://github.com/lewis6991/gitsigns.nvim" + }, + "gruvbox.nvim": { + "rev": "154eb5ff5b96d0641307113fa385eaf0d36d9796", + "src": "https://github.com/ellisonleao/gruvbox.nvim" + }, + "guess-indent.nvim": { + "rev": "84a4987ff36798c2fc1169cbaff67960aed9776f", + "src": "https://github.com/NMAC427/guess-indent.nvim" + }, + "mini.nvim": { + "rev": "bf8169f3e518be8de3f88073ace37d91f576cb04", + "src": "https://github.com/nvim-mini/mini.nvim" + }, + "nui.nvim": { + "rev": "de740991c12411b663994b2860f1a4fd0937c130", + "src": "https://github.com/MunifTanjim/nui.nvim" + }, + "nvim-treesitter": { + "rev": "4916d6592ede8c07973490d9322f187e07dfefac", + "src": "https://github.com/nvim-treesitter/nvim-treesitter", + "version": "'main'" + }, + "plenary.nvim": { + "rev": "74b06c6c75e4eeb3108ec01852001636d85a932b", + "src": "https://github.com/nvim-lua/plenary.nvim" + }, + "telescope-fzf-native.nvim": { + "rev": "b25b749b9db64d375d782094e2b9dce53ad53a40", + "src": "https://github.com/nvim-telescope/telescope-fzf-native.nvim" + }, + "telescope-ui-select.nvim": { + "rev": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2", + "src": "https://github.com/nvim-telescope/telescope-ui-select.nvim" + }, + "telescope.nvim": { + "rev": "9377230aa5305d9e9aca4ed8dadf1070fb4aa9fc", + "src": "https://github.com/nvim-telescope/telescope.nvim" + }, + "todo-comments.nvim": { + "rev": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668", + "src": "https://github.com/folke/todo-comments.nvim" + }, + "tokyonight.nvim": { + "rev": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6", + "src": "https://github.com/folke/tokyonight.nvim" + }, + "which-key.nvim": { + "rev": "3aab2147e74890957785941f0c1ad87d0a44c15a", + "src": "https://github.com/folke/which-key.nvim" + } + } +} |
