diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 8cb205e..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -plugin diff --git a/.stylua.toml b/.stylua.toml new file mode 100644 index 0000000..ca1541c --- /dev/null +++ b/.stylua.toml @@ -0,0 +1,6 @@ +column_width = 120 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 4 +quote_style = "AutoPreferDouble" +call_parentheses = "None" diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 2591365..0000000 --- a/LICENSE +++ /dev/null @@ -1,16 +0,0 @@ -The GPLv3 License (GPLv3) - -Copyright (c) 2023 Author - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . diff --git a/README.md b/README.md index 550f8d4..70820da 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,6 @@ -## Installation -```bash -# backup your current config -mv ~/.config/nvim ~/.config/nvim.bak -mv ~/.local/share/nvim ~/.local/share/nvim.bak +### My nvchad config -# clone my configuration -git clone https://github.com/krolyxon/nvim.git ~/.config/nvim -``` - -### Thanks to [NvChad](https://github.com/nvchad/nvchad) +#### extra plugins added +1. rustaceanvim: for rust development. +2. crates.nvim: for rust dependencies lookup. +3. nvim-tetris: tetris game. diff --git a/init.lua b/init.lua index 0fac395..ab217cc 100644 --- a/init.lua +++ b/init.lua @@ -1,17 +1,47 @@ -require("core.options") -require("core.utils").load_mappings() -require("core.autocmds") --- require("ui").setup_colorscheme() +vim.g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/" +vim.g.mapleader = " " --- add binaries installed by mason.nvim to path -vim.env.PATH = vim.env.PATH .. ":" .. vim.fn.stdpath "data" .. "/mason/bin" - --- bootstrap lazy.nvim! +-- bootstrap lazy and all plugins local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - require("core.bootstrap").lazy(lazypath) +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 vim.opt.rtp:prepend(lazypath) -require "plugins" + +local lazy_config = require "configs.lazy" + +-- load plugins +require("lazy").setup({ + { + "NvChad/NvChad", + lazy = false, + branch = "v2.5", + import = "nvchad.plugins", + }, + + { import = "plugins" }, +}, lazy_config) + +-- load theme +dofile(vim.g.base46_cache .. "defaults") +dofile(vim.g.base46_cache .. "statusline") + +require "options" +require "nvchad.autocmds" +require("autocmds") + +vim.schedule(function() + require "mappings" +end) + + + + + + + + + diff --git a/lazy-lock.json b/lazy-lock.json index 2061c5a..f24af94 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,37 +1,31 @@ { - "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, - "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, - "clangd_extensions.nvim": { "branch": "main", "commit": "bafed83f79b5779f5b43e8e015e13ca99dcd8b3a" }, + "LuaSnip": { "branch": "master", "commit": "45db5addf8d0a201e1cf247cae4cdce605ad3768" }, + "NvChad": { "branch": "v2.5", "commit": "b7a163e232524f1024a59a0a5c6ddf123530085c" }, + "base46": { "branch": "v2.5", "commit": "1b4710eaaea14a3d1bfd9ba7724152bbf18e5bc6" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "codeium.vim": { "branch": "main", "commit": "5b8f68d5c0e32ae97d073a56ff14dba5646ec223" }, - "crates.nvim": { "branch": "main", "commit": "3fc7ddac13ddf65914a733ef074317c4c72ef05b" }, + "codeium.vim": { "branch": "main", "commit": "1513aef682a9b3363c0bf60292e6ddc781c716ce" }, + "conform.nvim": { "branch": "master", "commit": "0ebe875d9c306f5fc829db38492ffff2a70d8e9d" }, + "crates.nvim": { "branch": "main", "commit": "891063a2dc8471501b9742406a514be62a20c138" }, "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, - "gitsigns.nvim": { "branch": "main", "commit": "f388995990aba04cfdc7c3ab870c33e280601109" }, - "harpoon": { "branch": "master", "commit": "c1aebbad9e3d13f20bedb8f2ce8b3a94e39e424a" }, - "indent-blankline.nvim": { "branch": "master", "commit": "8299fe7703dfff4b1752aeed271c3b95281a952d" }, - "kterm": { "branch": "main", "commit": "b587868af673cc4ddf6b1bd13d65dafbfd77383e" }, - "lazy.nvim": { "branch": "main", "commit": "9d445ebbd89401544a538c6af080e4d2785abb49" }, - "lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" }, - "markdown.nvim": { "branch": "main", "commit": "4ab835985de62b46b6785ae160f5f709b77a0f92" }, - "mason.nvim": { "branch": "main", "commit": "4546dec8b56bc56bc1d81e717e4a935bc7cd6477" }, - "nvim-autopairs": { "branch": "master", "commit": "78a4507bb9ffc9b00f11ae0ac48243d00cb9194d" }, - "nvim-cmp": { "branch": "main", "commit": "8202df9561b90102b41dbc1ad71945534ef4ea39" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "760e27df4dd966607e8fb7fd8b6b93e3c7d2e193" }, - "nvim-jdtls": { "branch": "master", "commit": "8eb5f0dbe6e126b392ddcaf45893358619893e45" }, - "nvim-lspconfig": { "branch": "master", "commit": "01e08d4bf1c35e5126b2ad5209725e4c552289ab" }, + "gitsigns.nvim": { "branch": "main", "commit": "899e993850084ea33d001ec229d237bc020c19ae" }, + "indent-blankline.nvim": { "branch": "master", "commit": "db926997af951da38e5004ec7b9fbdc480b48f5d" }, + "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "nvim-autopairs": { "branch": "master", "commit": "19606af7c039271d5aa96bceff101e7523af3136" }, + "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "194ec600488f7c7229668d0e80bd197f3a2b84ff" }, + "nvim-lspconfig": { "branch": "master", "commit": "3ad562700d0615818bf358268ac8914f6ce2b079" }, "nvim-tetris": { "branch": "master", "commit": "d17c99fb527ada98ffb0212ffc87ccda6fd4f7d9" }, - "nvim-tree.lua": { "branch": "master", "commit": "78a9ca5ed6557f29cd0ce203df44213e54bfabb9" }, - "nvim-treesitter": { "branch": "master", "commit": "5a8e9644c49f992f47bacd7900f4404df6fd9d38" }, - "plenary.nvim": { "branch": "master", "commit": "9a0d3bf7b832818c042aaf30f692b081ddd58bd9" }, + "nvim-tree.lua": { "branch": "master", "commit": "d43ab67d0eb4317961c5e9d15fffe908519debe0" }, + "nvim-treesitter": { "branch": "master", "commit": "64cc1ef764a0b137a642d05cacdfe1126124fb35" }, + "nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" }, + "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, "rustaceanvim": { "branch": "master", "commit": "d3a8b145f0b3db4de9a08fcbc604659f52ee4fbc" }, - "telescope.nvim": { "branch": "master", "commit": "74ce793a60759e3db0d265174f137fb627430355" }, - "todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" }, - "tokyonight.nvim": { "branch": "main", "commit": "e89caa3ad6d8da9d0dd981ec74a82c55adc61ffd" }, - "undotree": { "branch": "master", "commit": "b6fdb95db53b7ceb23ddfe8a8211a3135d98eef0" }, - "vim-fugitive": { "branch": "master", "commit": "99db68d9b3304580bd383da7aaee05c7a954a344" }, - "which-key.nvim": { "branch": "main", "commit": "5224c261825263f46f6771f1b644cae33cd06995" } + "telescope.nvim": { "branch": "master", "commit": "5972437de807c3bc101565175da66a1aa4f8707a" }, + "ui": { "branch": "v2.5", "commit": "cd474496cdc41c833f6376eaf20e7c357b7a2e35" }, + "which-key.nvim": { "branch": "main", "commit": "bfec3d6bc0a9b0b2cb11644642f78c2c3915eef0" } } diff --git a/lua/core/autocmds.lua b/lua/autocmds.lua similarity index 68% rename from lua/core/autocmds.lua rename to lua/autocmds.lua index 6cfc051..adef16b 100644 --- a/lua/core/autocmds.lua +++ b/lua/autocmds.lua @@ -1,21 +1,33 @@ -local KrolyxonGroup = vim.api.nvim_create_augroup('Krolyxon', {}) - local autocmd = vim.api.nvim_create_autocmd -- Highlight on yank autocmd("TextYankPost", { callback = function() - vim.highlight.on_yank({ - higroup = 'IncSearch', + vim.highlight.on_yank { + higroup = "IncSearch", timeout = 40, - }) + } end, }) +-- Restore Cursor on file open +autocmd("BufReadPost", { + pattern = "*", + callback = function() + local line = vim.fn.line "'\"" + if + line > 1 + and line <= vim.fn.line "$" + and vim.bo.filetype ~= "commit" + and vim.fn.index({ "xxd", "gitrebase" }, vim.bo.filetype) == -1 + then + vim.cmd 'normal! g`"' + end + end, +}) -- Remove trailing whitespaces on :w autocmd({ "BufWritePre" }, { - group = KrolyxonGroup, pattern = "*", command = [[%s/\s\+$//e]], }) @@ -23,11 +35,11 @@ autocmd({ "BufWritePre" }, { -- Don"t auto commenting new lines autocmd("BufEnter", { pattern = "", - command = "set fo-=c fo-=r fo-=o" + command = "set fo-=c fo-=r fo-=o", }) -- spell check markdown and tex files -vim.cmd([[ +vim.cmd [[ augroup spellCheck autocmd! autocmd Filetype plaintext setlocal spell @@ -37,18 +49,7 @@ vim.cmd([[ autocmd BufRead,BufNewFile *.Rmd setlocal spell autocmd BufRead,BufNewFile *.tex setlocal spell augroup END -]]) - - --- Run C/C++ fil -vim.api.nvim_buf_set_keymap(0, 'n', '', ':w:!gcc -o %:t:r % && ./%:t:r', { silent = true }) -vim.api.nvim_buf_set_keymap(0, 'n', '', ':w:!g++ -o %:t:r % && ./%:t:r', { silent = true }) -vim.api.nvim_buf_set_keymap(0, 'n', '', - ':w:lua require("kterm.terminal").send("cp -f " .. vim.fn.expand("%") .. " /tmp; javac -d /tmp " .. vim.fn.expand("%") .. "; java -cp /tmp " .. vim.fn.expand("%:t:r"), "float")', - { silent = true }) --- vim.api.nvim_buf_set_keymap(0, 'n', '', ":w:new | term . '!gcc %:p:h && ./a.out':startinsert", {silent = true}) --- - +]] local build_commands = { c = "!g++ -std=c++17 -o %:p:r.o %", @@ -58,7 +59,7 @@ local build_commands = { -- tex = "pdflatex %", tex = "VimtexCompile", javascript = "", - java = "!jrun %" + java = "!jrun %", } local debug_build_commands = { @@ -105,10 +106,10 @@ vim.api.nvim_create_user_command("Run", function() for file, command in pairs(run_commands) do if filetype == file then - vim.cmd("sp") -- Vertical split + vim.cmd "sp" -- Vertical split -- vim.cmd("vs") -- Horizontal split vim.cmd("term " .. command) - vim.cmd("resize 20N") -- Comment this if horizontal + vim.cmd "resize 20N" -- Comment this if horizontal local keys = vim.api.nvim_replace_termcodes("i", true, false, true) vim.api.nvim_feedkeys(keys, "n", false) break @@ -117,11 +118,12 @@ vim.api.nvim_create_user_command("Run", function() end, {}) vim.api.nvim_create_user_command("Ha", function() - vim.cmd([[Build]]) - vim.cmd([[Run]]) + vim.cmd [[Build]] + vim.cmd [[Run]] end, {}) -vim.api.nvim_create_user_command("Config", function() vim.cmd([[cd ~/.config/nvim]]) end, {}) - +vim.api.nvim_create_user_command("Config", function() + vim.cmd [[cd ~/.config/nvim]] +end, {}) vim.cmd [[ autocmd BufRead,BufNewFile *.slint set filetype=slint ]] diff --git a/lua/chadrc.lua b/lua/chadrc.lua new file mode 100644 index 0000000..713bbd0 --- /dev/null +++ b/lua/chadrc.lua @@ -0,0 +1,9 @@ +---@type ChadrcConfig +local M = {} + +M.base46 = { + theme = "tokyodark", + theme_toggle = { "tokyodark", "tokyonight" }, +} + +return M diff --git a/lua/configs/conform.lua b/lua/configs/conform.lua new file mode 100644 index 0000000..5d3d089 --- /dev/null +++ b/lua/configs/conform.lua @@ -0,0 +1,15 @@ +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/lua/plugins/configs/lazy_nvim.lua b/lua/configs/lazy.lua similarity index 82% rename from lua/plugins/configs/lazy_nvim.lua rename to lua/configs/lazy.lua index f9999e1..fbb19a9 100644 --- a/lua/plugins/configs/lazy_nvim.lua +++ b/lua/configs/lazy.lua @@ -1,10 +1,6 @@ return { defaults = { lazy = true }, - - -- install = { - -- try to load one of these colorschemes when starting an installation during startup - -- colorscheme = { "rose-pine" }, - -- }, + install = { colorscheme = { "nvchad" } }, ui = { icons = { @@ -24,6 +20,10 @@ return { "getscriptPlugin", "gzip", "logipat", + "netrw", + "netrwPlugin", + "netrwSettings", + "netrwFileHandlers", "matchit", "tar", "tarPlugin", @@ -33,7 +33,7 @@ return { "vimballPlugin", "zip", "zipPlugin", - -- "tutor", + "tutor", "rplugin", "syntax", "synmenu", diff --git a/lua/configs/lspconfig.lua b/lua/configs/lspconfig.lua new file mode 100644 index 0000000..c655bff --- /dev/null +++ b/lua/configs/lspconfig.lua @@ -0,0 +1,32 @@ +-- load defaults i.e lua_lsp +require("nvchad.configs.lspconfig").defaults() + +local lspconfig = require "lspconfig" + +-- EXAMPLE +local servers = { "cssls", "jdtls", "slint_lsp" } +local nvlsp = require "nvchad.configs.lspconfig" + +-- lsps with default config +for _, lsp in ipairs(servers) do + lspconfig[lsp].setup { + on_attach = nvlsp.on_attach, + on_init = nvlsp.on_init, + capabilities = nvlsp.capabilities, + } +end + +-- Html lsp +lspconfig.html.setup { + on_attach = nvlsp.on_attach, + capabilities = nvlsp.capabilities, + init_option = { provideFormatter = true }, + filetypes = { "htmldjango", "html" }, +} + +-- configuring single server, example: typescript +-- lspconfig.tsserver.setup { +-- on_attach = nvlsp.on_attach, +-- on_init = nvlsp.on_init, +-- capabilities = nvlsp.capabilities, +-- } diff --git a/lua/core/bootstrap.lua b/lua/core/bootstrap.lua deleted file mode 100644 index 8cacebb..0000000 --- a/lua/core/bootstrap.lua +++ /dev/null @@ -1,28 +0,0 @@ -local M = {} - -M.lazy = function(install_path) - print "Bootstrapping lazy.nvim .." - - vim.fn.system { - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - install_path, - } - - vim.opt.rtp:prepend(install_path) - - -- install plugins + compile their configs - require "plugins" - - require("lazy").load { plugins = "nvim-treesitter" } - - -- install binaries from mason.nvim & tsparsers on LazySync - vim.schedule(function() - vim.cmd "bw | silent! MasonInstallAll" -- close lazy window - end, 0) -end - -return M diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua deleted file mode 100644 index 81f1bb1..0000000 --- a/lua/core/mappings.lua +++ /dev/null @@ -1,372 +0,0 @@ -local M = {} - -M.general = { - n = { [""] = { " noh ", "no highlight" }, - - -- switch between windows - -- [""] = { "h", "window left" }, - -- [""] = { "l", "window right" }, - -- [""] = { "j", "window down" }, - -- [""] = { "k", "window up" }, - - -- cycleling through buffers - ["tk"] = { " bnext ", "Next buffer" }, - ["tj"] = { " bprev ", "Previous buffer" }, - - -- Allow moving the cursor through wrapped lines with j, k, and - -- http://www.reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/ - -- empty mode is same as using :map - -- also don't use g[j|k] when in operator pending mode, so it doesn't alter d, y or c behaviour - ["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } }, - ["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } }, - - -- new buffer - ["b"] = { " enew ", "new buffer" }, - - -- close buffer + hide terminal buffer - ["x"] = { - function() - require("core.utils").close_buffer() - end, - "close buffer", - }, - - ["d"] = { "\"_d", "delete without copying into clipboard" }, - - -- motion keybinds - [""] = { "zz", "move forward half page" }, - [""] = { "zz", "move backward half page" }, - - ["n"] = { "nzzzv" }, - ["N"] = { "Nzzzv" }, - - ["pv"] = { " Ex ", "File Tree" }, - - ["ex"] = { "!chmod +x %", "Make the current buffer script executable", opts = { silent = true } }, - - ["s"] = { [[:%s/\<\>//gI]] }, - }, - - v = { - ["d"] = { "\"_d", "delete without copying into clipboard" }, - - ["J"] = { ":m '>+1gv=gv" }, - ["K"] = { ":m '<-2gv=gv" }, - }, - - x = { - -- Don't copy the replaced text after pasting in visual mode - -- https://vim.fandom.com/wiki/Replace_a_word_with_yanked_text#Alternative_mapping_for_paste - ["p"] = { 'p:let @+=@0:let @"=@0', opts = { silent = true } }, - }, -} - -M.kterm = { - plugin = true, - - t = { - -- toggle in terminal mode - [""] = { - function() - require("kterm.terminal").toggle "float" - end, - "toggle floating term", - }, - - -- [""] = { - -- function() - -- require("kterm.terminal").toggle "horizontal" - -- end, - -- "toggle horizontal term", - -- }, - -- - -- [""] = { - -- function() - -- require("kterm.terminal").toggle "vertical" - -- end, - -- "toggle vertical term", - -- }, - }, - - n = { - -- toggle in normal mode - [""] = { - function() - require("kterm.terminal").toggle "float" - end, - "toggle floating term", - }, - - -- [""] = { - -- function() - -- require("kterm.terminal").toggle "horizontal" - -- end, - -- "toggle horizontal term", - -- }, - -- - -- [""] = { - -- function() - -- require("kterm.terminal").toggle "vertical" - -- end, - -- "toggle vertical term", - -- }, - }, -} - -M.nvimtree = { - plugin = true, - - n = { - -- toggle - [""] = { " NvimTreeToggle ", "Toggle nvimtree" }, - - -- focus - ["e"] = { " NvimTreeFocus ", "Focus nvimtree" }, - }, -} - -M.telescope = { - plugin = true, - - n = { - -- find - ["ff"] = { " Telescope find_files ", "find files" }, - ["fa"] = { " Telescope find_files follow=true no_ignore=true hidden=true ", "find all" }, - ["fw"] = { " Telescope live_grep ", "live grep" }, - ["fb"] = { " Telescope buffers ", "find buffers" }, - ["fh"] = { " Telescope help_tags ", "help page" }, - ["fo"] = { " Telescope oldfiles ", "find oldfiles" }, - ["fz"] = { " Telescope current_buffer_fuzzy_find ", "find in current buffer" }, - ["tk"] = { " Telescope keymaps ", "show keys" }, - - -- git - ["cm"] = { " Telescope git_commits ", "git commits" }, - ["gt"] = { " Telescope git_status ", "git status" }, - - -- theme switcher - ["th"] = { " Telescope colorscheme", "colorthemes" }, - }, -} - -M.fugitive = { - plugin = true, - n = { - ["gs"] = { " Git ", "Git" } - } -} - -M.harpoon = { - plugin = true, - n = { - [""] = { function() require("harpoon.ui").nav_file(1) end, "Harpoon File 1" }, - [""] = { function() require("harpoon.ui").nav_file(2) end, "Harpoon File 2" }, - [""] = { function() require("harpoon.ui").nav_file(3) end, "Harpoon File 3" }, - [""] = { function() require("harpoon.ui").nav_file(4) end, "Harpoon File 4" }, - - [""] = { function() require("harpoon.ui").toggle_quick_menu() end, "Harpoon Toggle Quick Menu" }, - - ["a"] = { function() require("harpoon.mark").add_file() end, "Harpoon Add File" }, - - } -} - -M.undotree = { - plugin = true, - n = { - -- toggle - ["u"] = { " UndotreeToggle ", "toggle undotree" }, - }, -} - -M.whichkey = { - plugin = true, - - n = { - ["wK"] = { - function() - vim.cmd "WhichKey" - end, - "which-key all keymaps", - }, - ["wk"] = { - function() - local input = vim.fn.input "WhichKey: " - vim.cmd("WhichKey " .. input) - end, - "which-key query lookup", - }, - }, -} - -M.comment = { - plugin = true, - - -- toggle comment in both modes - n = { - ["/"] = { - function() - require("Comment.api").toggle.linewise.current() - end, - "toggle comment", - }, - }, - - v = { - ["/"] = { - "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", - "toggle comment", - }, - }, -} - -M.lspconfig = { - plugin = true, - - -- See ` :help vim.lsp.*` for documentation on any of the below functions - - n = { - ["gD"] = { - function() - vim.lsp.buf.declaration() - end, - "lsp declaration", - }, - - ["gd"] = { - function() - vim.lsp.buf.definition() - end, - "lsp definition", - }, - - ["K"] = { - function() - vim.lsp.buf.hover() - end, - "lsp hover", - }, - - ["gi"] = { - function() - vim.lsp.buf.implementation() - end, - "lsp implementation", - }, - - ["ls"] = { - function() - vim.lsp.buf.signature_help() - end, - "lsp signature_help", - }, - - ["D"] = { - function() - vim.lsp.buf.type_definition() - end, - "lsp definition type", - }, - - ["ca"] = { - function() - vim.lsp.buf.code_action() - end, - "lsp code_action", - }, - - ["gr"] = { - function() - vim.lsp.buf.references() - end, - "lsp references", - }, - - ["f"] = { - function() - vim.diagnostic.open_float() - end, - "floating diagnostic", - }, - - ["[d"] = { - function() - vim.diagnostic.goto_prev({ float = { border = "rounded" } }) - end, - "goto prev", - }, - - ["]d"] = { - function() - vim.diagnostic.goto_next({ float = { border = "rounded" } }) - end, - "goto_next", - }, - - ["q"] = { - function() - vim.diagnostic.setloclist() - end, - "diagnostic setloclist", - }, - - ["fm"] = { - function() - vim.lsp.buf.format { async = true } - end, - "lsp formatting", - }, - - ["wa"] = { - function() - vim.lsp.buf.add_workspace_folder() - end, - "add workspace folder", - }, - - ["wr"] = { - function() - vim.lsp.buf.remove_workspace_folder() - end, - "remove workspace folder", - }, - - ["wl"] = { - function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, - "list workspace folders", - }, - }, -} - -M.rust = { - plugin = true, - n = { - ["rr"] = { " RustRun", "RustRun" }, - ["roc"] = { " RustOpenCargo ", "RustLsp openCargo" }, - }, -} - -M.blankline = { - plugin = true, - - n = { - ["cc"] = { - function() - local ok, start = require("indent_blankline.utils").get_current_context( - vim.g.indent_blankline_context_patterns, - vim.g.indent_blankline_use_treesitter_scope - ) - - if ok then - vim.api.nvim_win_set_cursor(vim.api.nvim_get_current_win(), { start, 0 }) - vim.cmd [[normal! _]] - end - end, - - "Jump to current_context", - }, - }, -} - -return M diff --git a/lua/core/options.lua b/lua/core/options.lua deleted file mode 100644 index 078c7ed..0000000 --- a/lua/core/options.lua +++ /dev/null @@ -1,47 +0,0 @@ -local opt = vim.opt -local g = vim.g - -opt.laststatus = 3 -- global statusline -opt.cmdheight = 1 -opt.clipboard = "unnamedplus" -opt.cul = true -- cursor line -opt.mouse = opt.mouse + "nv" -- mouse scrolling -opt.ignorecase = true -opt.smartcase = true -opt.showmode = false -opt.incsearch = true - --- numbers -opt.number = true -opt.numberwidth = 2 -opt.relativenumber = true -opt.ruler = false -opt.colorcolumn = "100" - --- indentline -opt.expandtab = true -opt.shiftwidth = 4 -opt.smartindent = true - --- go to previous/next line with h,l,left arrow and right arrow --- when cursor reaches end/beginning of line -opt.whichwrap:append "<>[]hl" -g.mapleader = " " - --- disable nvim intro -opt.shortmess:append "sI" -opt.signcolumn = "yes" -opt.termguicolors = true -opt.timeoutlen = 400 - -opt.swapfile = false -opt.undodir = vim.fn.expand('~/.local/share/nvim/undodir') -opt.undofile = true - --- netrw settings -vim.g.netrw_browse_split = 0 -vim.g.netrw_banner = 0 -vim.g.netrw_winsize = 25 - --- interval for writing swap file to disk, also used by gitsigns -opt.updatetime = 250 diff --git a/lua/core/utils.lua b/lua/core/utils.lua deleted file mode 100644 index fa839c8..0000000 --- a/lua/core/utils.lua +++ /dev/null @@ -1,74 +0,0 @@ -local M = {} -local merge_tb = vim.tbl_deep_extend - -M.close_buffer = function(bufnr) - if vim.bo.buftype == "terminal" then - vim.cmd(vim.bo.buflisted and "set nobl | enew" or "hide") - else - bufnr = bufnr or vim.api.nvim_get_current_buf() - vim.cmd("confirm bd" .. bufnr) - end -end - -M.load_mappings = function(section, mapping_opt) - local function set_section_map(section_values) - if section_values.plugin then - return - end - section_values.plugin = nil - - for mode, mode_values in pairs(section_values) do - local default_opts = merge_tb("force", { mode = mode }, mapping_opt or {}) - for keybind, mapping_info in pairs(mode_values) do - -- merge default + user opts - local opts = merge_tb("force", default_opts, mapping_info.opts or {}) - - mapping_info.opts, opts.mode = nil, nil - opts.desc = mapping_info[2] - - vim.keymap.set(mode, keybind, mapping_info[1], opts) - end - end - end - - local mappings = require("core.mappings") - - if type(section) == "string" then - mappings[section]["plugin"] = nil - mappings = { mappings[section] } - end - - for _, sect in pairs(mappings) do - set_section_map(sect) - end -end - -M.lazy_load = function(plugin) - vim.api.nvim_create_autocmd({ "BufRead", "BufWinEnter", "BufNewFile" }, { - group = vim.api.nvim_create_augroup("BeLazyOnFileOpen" .. plugin, {}), - callback = function() - local file = vim.fn.expand "%" - local condition = file ~= "NvimTree_1" and file ~= "[lazy]" and file ~= "" - - if condition then - vim.api.nvim_del_augroup_by_name("BeLazyOnFileOpen" .. plugin) - - -- dont defer for treesitter as it will show slow highlighting - -- This deferring only happens only when we do "nvim filename" - if plugin ~= "nvim-treesitter" then - vim.schedule(function() - require("lazy").load { plugins = plugin } - - if plugin == "nvim-lspconfig" then - vim.cmd "silent! do FileType" - end - end) - else - require("lazy").load { plugins = plugin } - end - end - end, - }) -end - -return M diff --git a/lua/mappings.lua b/lua/mappings.lua new file mode 100644 index 0000000..42ef731 --- /dev/null +++ b/lua/mappings.lua @@ -0,0 +1,15 @@ +require "nvchad.mappings" + +-- add yours here + +local map = vim.keymap.set + +map("n", ";", ":", { desc = "CMD enter command mode" }) +map("i", "jk", "") + +-- map({ "n", "i", "v" }, "", " w ") + +-- Flaoting Terminal +map({ "n", "t" }, "", function() + require("nvchad.term").toggle { pos = "float", id = "floatTerm" } +end, { desc = "terminal toggle floating term" }) diff --git a/lua/options.lua b/lua/options.lua new file mode 100644 index 0000000..9f978f8 --- /dev/null +++ b/lua/options.lua @@ -0,0 +1,5 @@ +require "nvchad.options" + +local o = vim.o +o.cursorlineopt = "both" -- to enable cursorline! +o.shiftwidth = 4 diff --git a/lua/plugins/configs/clangd.lua b/lua/plugins/configs/clangd.lua deleted file mode 100644 index e332623..0000000 --- a/lua/plugins/configs/clangd.lua +++ /dev/null @@ -1,29 +0,0 @@ -local clangd = require("clangd_extensions"); - -local options = { - server = { - filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto" }, - single_file_support = true, - on_attach = require("plugins.configs.lspconfig").on_attach, - capabilities = require("plugins.configs.lspconfig").capabilities, - root_dir = vim.loop.cwd, - -- The command that starts the language server (Has nothing to do with compiling) - cmd = { - "clangd", - -- NOTE: don't remove this if you don't want errors - "--offset-encoding=utf-16", - "-j=4", - "--background-index", - "--clang-tidy", - "--fallback-style=llvm", - "--all-scopes-completion", - "--completion-style=detailed", - "--header-insertion=iwyu", - "--header-insertion-decorators", - "--pch-storage=memory", - }, - -- init_option = { fallbackFlags = { "-std=c++2a" } } - } - -} -clangd.setup(options) diff --git a/lua/plugins/configs/cmp.lua b/lua/plugins/configs/cmp.lua deleted file mode 100644 index a381afb..0000000 --- a/lua/plugins/configs/cmp.lua +++ /dev/null @@ -1,131 +0,0 @@ -local cmp = require("cmp") --- require("ui").load_highlight "cmp" - - -local function border(hl_name) - return { - { "╭", hl_name }, - { "─", hl_name }, - { "╮", hl_name }, - { "│", hl_name }, - { "╯", hl_name }, - { "─", hl_name }, - { "╰", hl_name }, - { "│", hl_name }, - } -end - -local options = { - completion = { - completeopt = "menu,menuone", - }, - window = { - completion = { - border = border "CmpBorder", - winhighlight = "Normal:CmpPmenu,CursorLine:PmenuSel,Search:None", - scrollbar = false, - }, - documentation = { - border = border "CmpDocBorder", - }, - }, - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - - formatting = { - format = function(_, vim_item) - local icons = { - Namespace = "󰌗", - Text = "󰉿", - Method = "󰆧", - Function = "󰆧", - Constructor = "", - Field = "󰜢", - Variable = "󰀫", - Class = "󰠱", - Interface = "", - Module = "", - Property = "󰜢", - Unit = "󰑭", - Value = "󰎠", - Enum = "", - Keyword = "󰌋", - Snippet = "", - Color = "󰏘", - File = "󰈚", - Reference = "󰈇", - Folder = "󰉋", - EnumMember = "", - Constant = "󰏿", - Struct = "󰙅", - Event = "", - Operator = "󰆕", - TypeParameter = "󰊄", - Table = "", - Object = "󰅩", - Tag = "", - Array = "[]", - Boolean = "", - Number = "", - Null = "󰟢", - String = "󰉿", - Calendar = "", - Watch = "󰥔", - Package = "", - Copilot = "", - } - vim_item.kind = string.format("%s %s", icons[vim_item.kind], vim_item.kind) - return vim_item - end, - }, - - mapping = { - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.close(), - [""] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Replace, - select = false, - }, - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif require("luasnip").expand_or_jumpable() then - vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-expand-or-jump", true, true, true), "") - else - fallback() - end - end, { - "i", - "s", - }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif require("luasnip").jumpable(-1) then - vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-jump-prev", true, true, true), "") - else - fallback() - end - end, { - "i", - "s", - }), - }, - sources = { - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "buffer" }, - { name = "nvim_lua" }, - { name = "path" }, - { name = "crates" }, - }, -} - -cmp.setup(options) diff --git a/lua/plugins/configs/kterm.lua b/lua/plugins/configs/kterm.lua deleted file mode 100644 index ee34df4..0000000 --- a/lua/plugins/configs/kterm.lua +++ /dev/null @@ -1,24 +0,0 @@ -local options = { - terminals = { - list = {}, - type_opts = { - float = { - relative = "editor", - row = 0.07, - col = 0.05, - width = 0.9, - height = 0.8, - border = "single", - }, - horizontal = { location = "rightbelow", split_ratio = 0.4 }, - vertical = { location = "rightbelow", split_ratio = 0.5 }, - }, - }, - behavior = { - close_on_exit = true, - auto_insert = true, - }, - enable_new_mappings = true, -} - -require("kterm").setup(options) diff --git a/lua/plugins/configs/lspconfig.lua b/lua/plugins/configs/lspconfig.lua deleted file mode 100644 index 9c56e4c..0000000 --- a/lua/plugins/configs/lspconfig.lua +++ /dev/null @@ -1,205 +0,0 @@ -local lspconfig = require("lspconfig") - -local M = {} -local utils = require "core.utils" - --- export on_attach & capabilities for custom lspconfigs - -M.on_attach = function(client, bufnr) - -- if vim.g.vim_version > 7 then - -- -- nightly - -- client.server_capabilities.documentFormattingProvider = false - -- client.server_capabilities.documentRangeFormattingProvider = false - -- else - -- -- stable - -- client.resolved_capabilities.document_formatting = false - -- client.resolved_capabilities.document_range_formatting = false - -- end - - utils.load_mappings("lspconfig", { buffer = bufnr }) - - if client.server_capabilities.signatureHelpProvider then - local function lspSymbol(name, icon) - local hl = "DiagnosticSign" .. name - vim.fn.sign_define(hl, { text = icon, numhl = hl, texthl = hl }) - end - - lspSymbol("Error", "󰅙") - lspSymbol("Info", "󰋼") - lspSymbol("Hint", "󰌵") - lspSymbol("Warn", "") - - vim.diagnostic.config { - virtual_text = { - prefix = "", - }, - signs = true, - underline = true, - update_in_insert = false, - } - - vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { - border = "single", - }) - vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { - border = "single", - focusable = false, - relative = "cursor", - }) - - -- suppress error messages from lang servers - vim.notify = function(msg, log_level) - if msg:match "exit code" then - return - end - if log_level == vim.log.levels.ERROR then - vim.api.nvim_err_writeln(msg) - else - vim.api.nvim_echo({ { msg } }, true, {}) - end - end - - -- Borders for LspInfo winodw - local win = require "lspconfig.ui.windows" - local _default_opts = win.default_opts - - win.default_opts = function(options) - local opts = _default_opts(options) - opts.border = "single" - return opts - end - end -end - -M.capabilities = vim.lsp.protocol.make_client_capabilities() - -M.capabilities.textDocument.completion.completionItem = { - documentationFormat = { "markdown", "plaintext" }, - snippetSupport = true, - preselectSupport = true, - insertReplaceSupport = true, - labelDetailsSupport = true, - deprecatedSupport = true, - commitCharactersSupport = true, - tagSupport = { valueSet = { 1 } }, - resolveSupport = { - properties = { - "documentation", - "detail", - "additionalTextEdits", - }, - }, -} - -lspconfig.lua_ls.setup { - on_attach = M.on_attach, - capabilities = M.capabilities, - - settings = { - Lua = { - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = { - [vim.fn.expand "$VIMRUNTIME/lua"] = true, - [vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true, - [vim.fn.stdpath("data") .. "/lazy/lazy.nvim/lua/lazy"] = true, - }, - maxPreload = 100000, - preloadFileSize = 10000, - }, - }, - }, -} - --- lspconfig.rust_analyzer.setup { --- on_attach = M.on_attach, --- capabilities = M.capabilities, --- --- settings = { --- tools = { --- inlay_hints = { --- auto = true, --- show_parameter_hints = true, --- }, --- }, --- } --- } - -lspconfig.clangd.setup { - filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto" }, - single_file_support = true, - on_attach = M.on_attach, - capabilities = M.capabilities, - root_dir = vim.loop.cwd, - -- init_option = { fallbackFlags = { "-std=c++2a" } } -} - -lspconfig.html.setup { - on_attach = M.on_attach, - capabilities = M.capabilities, - init_option = { provideFormatter = true }, - filetypes = { "htmldjango", "html" }, -} - -lspconfig.asm_lsp.setup { - on_attach = M.on_attach, - capabilities = M.capabilities, - init_option = { provideFormatter = true }, - command = "asm-lsp", - filetypes = { "a", "s", "S", "asm" }, - -} - -lspconfig.slint_lsp.setup { - on_attach = M.on_attach, - capabilities = M.capabilities, - init_option = { provideFormatter = true }, - filetypes = { "slt", "slint" }, -} - -lspconfig.jdtls.setup { - on_attach = M.on_attach, - capabilities = M.capabilities, - init_option = { - provideFormatter = true, - init_options = { - -- extendedClientCapabilities = { - -- classFileContentsSupport = true, - -- generateToStringPromptSupport = true, - -- hashCodeEqualsPromptSupport = true, - -- advancedExtractRefactoringSupport = true, - -- advancedOrganizeImportsSupport = true, - -- generateConstructorsPromptSupport = true, - -- generateDelegateMethodsPromptSupport = true, - -- moveRefactoringSupport = true, - -- overrideMethodsPromptSupport = true, - -- executeClientCommandSupport = true, - -- inferSelectionSupport = { - -- 'extractMethod', - -- 'extractVariable', - -- 'extractConstant', - -- 'extractVariableAllOccurrence', - -- }, - -- }, - }, - }, -} - -local servers = { - "marksman", - "taplo", - "pyright", - "cssls", - "tsserver", -} - -for _, lsp in ipairs(servers) do - lspconfig[lsp].setup { - on_attach = M.on_attach, - capabilities = M.capabilities, - } -end - -return M diff --git a/lua/plugins/configs/mason.lua b/lua/plugins/configs/mason.lua deleted file mode 100644 index ecacb98..0000000 --- a/lua/plugins/configs/mason.lua +++ /dev/null @@ -1,25 +0,0 @@ -local options = { - PATH = "skip", - ui = { - icons = { - package_pending = " ", - package_installed = "󰄳 ", - package_uninstalled = " 󰚌", - }, - - keymaps = { - toggle_server_expand = "", - install_server = "i", - update_server = "u", - check_server_version = "c", - update_all_servers = "U", - check_outdated_servers = "C", - uninstall_server = "X", - cancel_installation = "", - }, - }, - - max_concurrent_installers = 10, -} - -require("mason").setup(options) diff --git a/lua/plugins/configs/nvimtree.lua b/lua/plugins/configs/nvimtree.lua deleted file mode 100644 index cb79d4f..0000000 --- a/lua/plugins/configs/nvimtree.lua +++ /dev/null @@ -1,77 +0,0 @@ -local options = { - filters = { - dotfiles = false, - exclude = { vim.fn.stdpath "config" .. "/lua/custom" }, - }, - -- disable_netrw = true, - hijack_netrw = true, - hijack_cursor = true, - hijack_unnamed_buffer_when_opening = false, - sync_root_with_cwd = true, - update_focused_file = { - enable = true, - update_root = false, - }, - view = { - adaptive_size = false, - side = "left", - width = 30, - preserve_window_proportions = true, - }, - git = { - enable = false, - ignore = true, - }, - filesystem_watchers = { - enable = true, - }, - actions = { - open_file = { - resize_window = true, - }, - }, - renderer = { - root_folder_label = false, - highlight_git = false, - highlight_opened_files = "none", - - indent_markers = { - enable = false, - }, - - icons = { - show = { - file = true, - folder = true, - folder_arrow = true, - git = false, - }, - - glyphs = { - default = "󰈚", - symlink = "", - folder = { - default = "", - empty = "", - empty_open = "", - open = "", - symlink = "", - symlink_open = "", - arrow_open = "", - arrow_closed = "", - }, - git = { - unstaged = "✗", - staged = "✓", - unmerged = "", - renamed = "➜", - untracked = "★", - deleted = "", - ignored = "◌", - }, - }, - }, - }, -} - -return options diff --git a/lua/plugins/configs/others.lua b/lua/plugins/configs/others.lua deleted file mode 100644 index 846221c..0000000 --- a/lua/plugins/configs/others.lua +++ /dev/null @@ -1,90 +0,0 @@ -local M = {} - -M.autopairs = function() - local options = { - fast_wrap = {}, - disable_filetype = { "TelescopePrompt", "vim" }, - } - - require("nvim-autopairs").setup(options) - - local cmp_autopairs = require "nvim-autopairs.completion.cmp" - require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done()) -end - -M.luasnip = function() - local options = { - history = true, - updateevents = "TextChanged,TextChangedI", - } - - require("luasnip").config.set_config(options) - -- vscode format - require("luasnip.loaders.from_vscode").lazy_load() - require("luasnip.loaders.from_vscode").lazy_load { paths = vim.g.vscode_snippets_path or "" } - require('luasnip.loaders.from_vscode').lazy_load({ paths = "~/.config/nvim/snippets/" }) - - -- snipmate format - require("luasnip.loaders.from_snipmate").load() - require("luasnip.loaders.from_snipmate").lazy_load { paths = vim.g.snipmate_snippets_path or "" } - - -- lua format - require("luasnip.loaders.from_lua").load() - require("luasnip.loaders.from_lua").lazy_load { paths = vim.g.lua_snippets_path or "" } - vim.api.nvim_create_autocmd("InsertLeave", { - callback = function() - if require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()] - and not require("luasnip").session.jump_active - then - require("luasnip").unlink_current() - end - end, - }) -end - -M.gitsigns = function() - local options = { - signs = { - add = { hl = "GitSignsAdd", text = "▎", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, - change = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, - delete = { hl = "GitSignsDelete", text = "󰍵", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, - topdelete = { hl = "GitSignsDelete", text = "‾", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, - changedelete = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, - }, - } - require("gitsigns").setup(options) -end - -M.blankline = function() - local options = { - indentLine_enabled = 1, - char = "▏", - filetype_exclude = { - "help", - "terminal", - "alpha", - "lazy", - "lspinfo", - "TelescopePrompt", - "TelescopeResults", - "nvchad_cheatsheet", - "lsp-installer", - "", - }, - buftype_exclude = { "terminal" }, - show_trailing_blankline_indent = false, - show_first_indent_level = false, - } - - require("indent_blankline").setup(options) -end - -M.colorizer = function() - require("colorizer").setup() - -- execute colorizer as soon as possible - vim.defer_fn(function() - require("colorizer").attach_to_buffer(0) - end, 0) -end - -return M diff --git a/lua/plugins/configs/statusline.lua b/lua/plugins/configs/statusline.lua deleted file mode 100644 index afca37f..0000000 --- a/lua/plugins/configs/statusline.lua +++ /dev/null @@ -1,41 +0,0 @@ -require('lualine').setup { - options = { - icons_enabled = true, - theme = 'auto', - component_separators = { left = '', right = '' }, - section_separators = { left = '', right = '' }, - disabled_filetypes = { - statusline = {}, - winbar = {}, - }, - ignore_focus = {}, - always_divide_middle = true, - globalstatus = false, - refresh = { - statusline = 1000, - tabline = 1000, - winbar = 1000, - } - }, - sections = { - lualine_a = { 'mode' }, - lualine_b = { 'branch', 'diff', 'diagnostics' }, - lualine_c = { - { "filename", path = 1, symbols = { modified = "  ", readonly = "", unnamed = "" } } - }, - lualine_y = { 'progress' }, - lualine_z = { 'location' } - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { 'filename' }, - lualine_x = { 'location' }, - lualine_y = {}, - lualine_z = {} - }, - tabline = {}, - winbar = {}, - inactive_winbar = {}, - extensions = {} -} diff --git a/lua/plugins/configs/telescope.lua b/lua/plugins/configs/telescope.lua deleted file mode 100644 index 48cb233..0000000 --- a/lua/plugins/configs/telescope.lua +++ /dev/null @@ -1,57 +0,0 @@ -vim.g.theme_switcher_loaded = true - -local options = { - defaults = { - vimgrep_arguments = { - "rg", - "-L", - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - }, - prompt_prefix = "  ", - selection_caret = " ", - entry_prefix = " ", - initial_mode = "insert", - selection_strategy = "reset", - sorting_strategy = "ascending", - layout_strategy = "horizontal", - layout_config = { - horizontal = { - prompt_position = "top", - preview_width = 0.55, - results_width = 0.8, - }, - vertical = { - mirror = false, - }, - width = 0.87, - height = 0.80, - preview_cutoff = 120, - }, - file_sorter = require("telescope.sorters").get_fuzzy_file, - file_ignore_patterns = { "node_modules" }, - generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, - path_display = { "truncate" }, - winblend = 0, - border = {}, - borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, - color_devicons = true, - set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil, - file_previewer = require("telescope.previewers").vim_buffer_cat.new, - grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new, - qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new, - -- Developer configurations: Not meant for general override - buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker, - mappings = { - n = { ["q"] = require("telescope.actions").close }, - }, - }, -} - -local telescope = require("telescope") --- check for any override -telescope.setup(options) diff --git a/lua/plugins/configs/treesitter.lua b/lua/plugins/configs/treesitter.lua deleted file mode 100644 index d0dcf21..0000000 --- a/lua/plugins/configs/treesitter.lua +++ /dev/null @@ -1,19 +0,0 @@ --- require("ui").load_highlight "treesitter" - -local options = { - ensure_installed = { - "lua", - "rust", - "c", - "python", - }, - - highlight = { - enable = true, - use_languagetree = true, - }, - - indent = { enable = true }, -} - -require("nvim-treesitter.configs").setup(options) diff --git a/lua/plugins/configs/whichkey.lua b/lua/plugins/configs/whichkey.lua deleted file mode 100644 index d8252a0..0000000 --- a/lua/plugins/configs/whichkey.lua +++ /dev/null @@ -1,31 +0,0 @@ -local options = { - - icons = { - breadcrumb = "»", -- symbol used in the command line area that shows your active key combo - separator = "  ", -- symbol used between a key and it's label - group = "+", -- symbol prepended to a group - }, - - popup_mappings = { - scroll_down = "", -- binding to scroll down inside the popup - scroll_up = "", -- binding to scroll up inside the popup - }, - - window = { - border = "none", -- none/single/double/shadow - }, - - layout = { - spacing = 6, -- spacing between columns - }, - - hidden = { "", "", "", "", "call", "lua", "^:", "^ " }, - - triggers_blacklist = { - -- list of mode / prefixes that should never be hooked by WhichKey - i = { "j", "k" }, - v = { "j", "k" }, - }, -} - -require("which-key").setup(options) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 3ede7ee..c81d5d1 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -1,371 +1,46 @@ --- All plugins have lazy = true by default, to load a plugin on startup just lazy=false -local plugins = { - -- { dir = "~/repos/krose-pine", - -- lazy = false, - -- priority = 1000, - -- config = function() - -- function ColorMyPencils(color) - -- color = color or "rose-pine" - -- vim.cmd.colorscheme(color) - -- - -- vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) - -- vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) - -- - -- end - -- - -- ColorMyPencils() - -- end - -- }, +return { { - "folke/tokyonight.nvim", - lazy = false, - init = function() - require("tokyonight").setup({ - -- transparent = true, - style = "night" - }) - vim.cmd.colorscheme("tokyonight-night") - end - }, - - { 'nvim-lua/plenary.nvim' }, - - - -- { - -- "nvim-treesitter/nvim-treesitter", - -- init = function() - -- require("core.utils").lazy_load "nvim-treesitter" - -- end, - -- cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSEnable", "TSDisable", "TSModuleInfo" }, - -- build = ":TSUpdate", - -- config = function() - -- require "plugins.configs.treesitter" - -- end, - -- }, - - { - "nvim-treesitter/nvim-treesitter", - event = { "BufReadPost", "BufNewFile" }, - cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" }, - build = ":TSUpdate", - config = function() - require "plugins.configs.treesitter" - end, - }, - - { - "lewis6991/gitsigns.nvim", - ft = "gitcommit", - init = function() - -- load gitsigns only when a git file is opened - vim.api.nvim_create_autocmd({ "BufRead" }, { - group = vim.api.nvim_create_augroup("GitSignsLazyLoad", { clear = true }), - callback = function() - vim.fn.jobstart({ "git", "-C", vim.loop.cwd(), "rev-parse" }, - { - on_exit = function(_, return_code) - if return_code == 0 then - vim.api.nvim_del_augroup_by_name "GitSignsLazyLoad" - vim.schedule(function() - require("lazy").load { plugins = { "gitsigns.nvim" } } - end) - end - end - } - ) - end, - }) - end, - config = function() - require("plugins.configs.others").gitsigns() - end, - }, - - - -- Highlight todo, notes, etc in comments - { - 'folke/todo-comments.nvim', - event = 'VimEnter', - dependencies = { 'nvim-lua/plenary.nvim' }, - opts = { signs = false } - }, - - { - "tpope/vim-fugitive", - cmd = "Git", - init = function() - require("core.utils").load_mappings "fugitive" - end - }, - - { - "nvim-telescope/telescope.nvim", - dependencies = { "nvim-treesitter/nvim-treesitter" }, - cmd = "Telescope", - config = function() - require "plugins.configs.telescope" - -- require("telescope").setup() - end, - init = function() - require("core.utils").load_mappings "telescope" - end, - }, - - { - "ThePrimeagen/harpoon", - init = function() - require("core.utils").load_mappings "harpoon" - end - }, - - -- lsp stuff - - { - "williamboman/mason.nvim", - cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUninstall", "MasonUninstallAll", "MasonLog" }, - config = function() - require "plugins.configs.mason" - local ensure_installed = { "lua-language-server", "rust-analyzer", "pyright", "clangd", "html-lsp" } -- not an option from mason.nvim - vim.api.nvim_create_user_command("MasonInstallAll", function() - vim.cmd("MasonInstall " .. table.concat(ensure_installed, " ")) - end, {}) - end, + "stevearc/conform.nvim", + -- event = "BufWritePre", -- uncomment for format on save + opts = require "configs.conform", }, { "neovim/nvim-lspconfig", - -- init = function() - -- require("core.utils").lazy_load "nvim-lspconfig" - -- end, - - event = "User FilePost", config = function() - require "plugins.configs.lspconfig" + require "configs.lspconfig" end, }, - { - 'mrcjkb/rustaceanvim', - version = '^5', -- Recommended - lazy = false, -- This plugin is already lazy - ["rust-analyzer"] = { - cargo = { - allFeatures = true, - }, - }, - config = function() - require("core.utils").load_mappings "rust" - vim.g.rustaceanvim = { - tools = { - float_win_config = { - border = 'rounded' - } - }, - - } - end - }, - - { - "Saecki/crates.nvim", - event = { "BufRead Cargo.toml" }, - config = function() - require("crates").setup() - -- Add crates.nvim to the cmp sources as soon as we load the plugin - require("cmp").setup.buffer({ sources = { { name = "crates" } } }) - end, - }, - - - { - "p00f/clangd_extensions.nvim", - ft = { "c", "cpp", "objc", "objcpp", "cuda", "proto" }, - dependencies = "neovim/nvim-lspconfig", - config = function() - require("plugins.configs.clangd") - end - }, - - - { - "mfussenegger/nvim-jdtls", - ft = "java", - - config = function() - local config = { - cmd = { vim.fn.stdpath "data" .. "/mason/bin/jdtls" }, - root_dir = vim.fs.dirname(vim.fs.find({ 'gradlew', '.git', 'mvnw' }, { upward = true })[1]), - } - require('jdtls').start_or_attach(config) - end, - }, - -- load luasnips + cmp related in insert mode only - - { - "hrsh7th/nvim-cmp", - event = "InsertEnter", - dependencies = { - { - -- snippet plugin - "L3MON4D3/LuaSnip", - dependencies = "rafamadriz/friendly-snippets", - config = function() - require("plugins.configs.others").luasnip() - end, - }, - - -- autopairing of (){}[] etc - { - "windwp/nvim-autopairs", - config = function() - require("plugins.configs.others").autopairs() - end, - }, - - -- cmp sources plugins - { - "saadparwaiz1/cmp_luasnip", - "hrsh7th/cmp-nvim-lua", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - }, - }, - - config = function() - require "plugins.configs.cmp" - end, - }, - -- misc - -- - { - 'Exafunction/codeium.vim', - event = 'BufEnter' - }, - -- { - -- 'vimwiki/vimwiki', - -- event = "VeryLazy", - -- init = function() - -- vim.g.vimwiki_list = { - -- { - -- path = '~/dox/brain/Notes', - -- syntax = 'markdown', - -- ext = '.md', - -- } - -- } - -- end, + -- "nvim-treesitter/nvim-treesitter", + -- opts = { + -- ensure_installed = { + -- "vim", "lua", "vimdoc", + -- "html", "css" + -- }, + -- }, -- }, + -- Misc { - 'MeanderingProgrammer/markdown.nvim', - ft = { "markdown" }, - config = function() - require('render-markdown').setup({}) - end, - }, - - { - "numToStr/Comment.nvim", - -- keys = { "gc", "gb" }, - config = function() - require("Comment").setup() - end, - init = function() - require("core.utils").load_mappings "comment" - end, - }, - - { - "mbbill/undotree", - cmd = "UndotreeToggle", - init = function() - require("core.utils").load_mappings "undotree" - end, - }, - - { - "krolyxon/kterm", - config = function() - require "plugins.configs.kterm" - end, - init = function() - require("core.utils").load_mappings "kterm" - end, - }, - - -- UI stuff - - { - "lukas-reineke/indent-blankline.nvim", - event = "BufRead", - config = function() - require("plugins.configs.others").blankline() - end, - init = function() - require("core.utils").lazy_load "indent-blankline.nvim" - require("core.utils").load_mappings "blankline" - end, - }, - - { - "nvchad/nvim-colorizer.lua", - init = function() - require("core.utils").lazy_load "nvim-colorizer.lua" - end, - config = function() - require("plugins.configs.others").colorizer() - end, - }, - - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - config = function() - require("plugins.configs.statusline") - end, - }, - - -- Only load whichkey after all the gui - { - "folke/which-key.nvim", - enabled = true, - keys = { "", "\"", "'", "`", "c", "v" }, - cmd = "WhichKey", - config = function() - require "plugins.configs.whichkey" - end, - init = function() - require("core.utils").load_mappings "whichkey" - end, - }, - - - { - "nvim-tree/nvim-tree.lua", - cmd = { "NvimTreeToggle", "NvimTreeFocus" }, - init = function() - require("core.utils").load_mappings "nvimtree" - end, - opts = function() - return require "plugins.configs.nvimtree" - end, - config = function(_, opts) - require("nvim-tree").setup(opts) - end, + "Exafunction/codeium.vim", + event = "BufEnter", }, { "alec-gibson/nvim-tetris", cmd = { "Tetris" }, }, + + -- Crates version completion for rust + { + "Saecki/crates.nvim", + event = { "BufRead Cargo.toml" }, + config = function() + require("crates").setup() + -- Add crates.nvim to the cmp sources as soon as we load the plugin + require("cmp").setup.buffer { sources = { { name = "crates" } } } + end, + }, } - --- pin commits for all default plugins -for _, value in pairs(plugins) do - value.pin = true -end - --- load lazy.nvim options -local lazy_config = require "plugins.configs.lazy_nvim" -require("lazy").setup(plugins, lazy_config) diff --git a/lua/plugins/rust.lua b/lua/plugins/rust.lua new file mode 100644 index 0000000..bf3e437 --- /dev/null +++ b/lua/plugins/rust.lua @@ -0,0 +1,19 @@ +return { + "mrcjkb/rustaceanvim", + version = "^5", -- Recommended + lazy = false, -- This plugin is already lazy + ["rust-analyzer"] = { + cargo = { + allFeatures = true, + }, + }, + config = function() + vim.g.rustaceanvim = { + tools = { + float_win_config = { + border = "rounded", + }, + }, + } + end, +} diff --git a/lua/plugins/rustaceanvim.lua b/lua/plugins/rustaceanvim.lua new file mode 100644 index 0000000..9ce1333 --- /dev/null +++ b/lua/plugins/rustaceanvim.lua @@ -0,0 +1,31 @@ +return { + "mrcjkb/rustaceanvim", + version = "^5", -- Recommended + lazy = false, -- This plugin is already lazy + ["rust-analyzer"] = { + cargo = { + allFeatures = true, + }, + }, + config = function() + vim.g.rustaceanvim = { + tools = { + float_win_config = { + border = "rounded", + }, + }, + } + end, + + + -- Crates version completion for rust + { + "Saecki/crates.nvim", + event = { "BufRead Cargo.toml" }, + config = function() + require("crates").setup() + -- Add crates.nvim to the cmp sources as soon as we load the plugin + require("cmp").setup.buffer { sources = { { name = "crates" } } } + end, + }, +} diff --git a/lua/ui/init.lua b/lua/ui/init.lua deleted file mode 100644 index 5353cc6..0000000 --- a/lua/ui/init.lua +++ /dev/null @@ -1,25 +0,0 @@ -local M = {} - -M.load_highlight = function(group) - -- if type(group) == "string" and group == "core" then - -- local syntax = require("ui.integrations.syntax") - -- local nvim = require("ui.integrations.nvim") - -- group = merge_tb("force", syntax, nvim) - -- end - if type(group) == "string" then - group = require("ui.integrations." .. group) - end - - for hl, col in pairs(group) do - vim.api.nvim_set_hl(0, hl, col) - end -end - -M.setup_colorscheme = function () - -- vim.cmd('hi clear') - require("ui.term_hl") - require("ui").load_highlight "syntax" - require("ui").load_highlight "nvim" -end - -return M diff --git a/lua/ui/integrations/cmp.lua b/lua/ui/integrations/cmp.lua deleted file mode 100644 index 5c1c981..0000000 --- a/lua/ui/integrations/cmp.lua +++ /dev/null @@ -1,15 +0,0 @@ -local theme = require("ui.kdark").colors - -return { - CmpItemAbbr = { fg = theme.bright_black }, - CmpItemAbbrMatch = { fg = theme.white, bold = true }, - CmpItemAbbrDeprecated = { fg = theme.bright_black, strikethrough = true }, - CmpItemAbbrMatchFuzzy = { fg = theme.white, bold = true }, - CmpItemKind = { fg = theme.magenta }, - CmpItemKindClass = { fg = theme.yellow }, - CmpItemKindFunction = { fg = theme.magenta }, - CmpItemKindInterface = { fg = theme.yellow }, - CmpItemKindMethod = { fg = theme.magenta }, - CmpItemKindSnippet = { fg = theme.magenta }, - CmpItemKindVariable = { fg = theme.cyan }, -} diff --git a/lua/ui/integrations/nvim.lua b/lua/ui/integrations/nvim.lua deleted file mode 100644 index 9de2c96..0000000 --- a/lua/ui/integrations/nvim.lua +++ /dev/null @@ -1,99 +0,0 @@ -local theme = require("ui.kdark").colors - -return { - Comment = { fg = theme.bright_black }, - - SignColumn = { - bg = theme.black, - }, - - -- line number - LineNr = { fg = theme.bright_black }, - CursorLineNr = { fg = theme.white }, - - CursorLine = { - bg = '#131313', - sp = "none", - }, - - -- those ugly ~'s - EndOfBuffer = { fg = theme.black }, - - -- floating windows - FloatBorder = { fg = theme.blue }, - NormalFloat = { bg = theme.black }, - - -- Pmenu i.e completion menu - Pmenu = { bg = theme.black }, - PmenuSbar = { bg = theme.black }, - PmenuSel = { bg = '#26233a', fg = theme.white }, - PmenuThumb = { bg = theme.bright_black }, - - -- nvim cmp - CmpItemAbbr = { fg = theme.white }, - CmpItemAbbrMatch = { fg = theme.blue, bold = true }, - CmpBorder = { fg = theme.bright_black }, - CmpDocBorder = { fg = theme.bright_black }, - - NvimInternalError = { fg = theme.red }, - WinSeparator = { fg = theme.bright_black }, - - -- Dashboard i.e alpha.nvim - AlphaHeader = { fg = theme.bright_black }, - AlphaButtons = { fg = theme.bright_black }, - - -- Gitsigns.nvim - DiffAdd = { - fg = theme.blue, - }, - - DiffAdded = { - fg = theme.green, - }, - - DiffChange = { - fg = theme.bright_black, - }, - - DiffChangeDelete = { - fg = theme.red, - }, - - DiffModified = { - fg = theme.yellow, - }, - - DiffDelete = { - fg = theme.red, - }, - - DiffRemoved = { - fg = theme.red, - }, - - -- Indent blankline - IndentBlanklineChar = { fg = theme.bright_black }, - IndentBlanklineSpaceChar = { fg = theme.bright_black }, - - -- Lsp Diagnostics - DiagnosticHint = { fg = theme.magenta }, - DiagnosticError = { fg = theme.red }, - DiagnosticWarn = { fg = theme.yellow }, - DiagnosticInformation = { fg = theme.green }, - - -- StatusLine = { - -- fg = theme.white, - -- }, - -- StatusLineNC = { - -- fg = theme.white, - -- }, - -- StatusLineSeparator = { - -- fg = theme.bright_black, - -- }, - -- StatusLineTerm = { - -- fg = theme.bright_black, - -- }, - -- StatusLineTermNC = { - -- fg = theme.bright_black, - -- }, -} diff --git a/lua/ui/integrations/syntax.lua b/lua/ui/integrations/syntax.lua deleted file mode 100644 index 7622f06..0000000 --- a/lua/ui/integrations/syntax.lua +++ /dev/null @@ -1,112 +0,0 @@ -local theme = require("ui.kdark").colors - -return { - Boolean = { - fg = theme.orange, - }, - - Character = { - fg = theme.magenta, - }, - - Conditional = { - fg = theme.magenta, - }, - - Constant = { - fg = theme.white, - }, - - Define = { - fg = theme.magenta, - sp = "none", - }, - - Delimiter = { - fg = theme.cyan, - }, - - Float = { - fg = theme.yellow, - }, - - Function = { - fg = theme.bright_blue, - }, - - Identifier = { - fg = theme.white, - sp = "none", - }, - - Include = { - fg = theme.bright_blue, - }, - - Keyword = { - fg = theme.magenta, - }, - - Label = { - fg = theme.yellow, - }, - - Number = { - fg = theme.yellow, - }, - - Operator = { - fg = theme.gray, - sp = "none", - }, - - PreProc = { - fg = theme.yellow, - }, - - Repeat = { - fg = theme.yellow, - }, - - Special = { - fg = theme.bright_blue, - }, - - SpecialChar = { - fg = theme.orange, - }, - - Statement = { - fg = theme.magenta, - }, - - StorageClass = { - fg = theme.yellow, - }, - - String = { - fg = theme.yellow, - }, - - Structure = { - fg = '#37908d', - }, - - Tag = { - fg = theme.yellow, - }, - - Todo = { - fg = theme.yellow, - bg = theme.bright_black, - }, - - Type = { - fg = theme.yellow, - sp = "none", - }, - - Typedef = { - fg = theme.yellow, - }, -} diff --git a/lua/ui/integrations/treesitter.lua b/lua/ui/integrations/treesitter.lua deleted file mode 100644 index 9df965e..0000000 --- a/lua/ui/integrations/treesitter.lua +++ /dev/null @@ -1,168 +0,0 @@ -local theme = require("ui.kdark").colors - -return { - TSAnnotation = { - fg = theme.orange, - sp = "none", - }, - - TSAttribute = { - fg = theme.bright_green, - sp = "none", - }, - - TSCharacter = { - fg = theme.magenta, - sp = "none", - }, - - TSConstBuiltin = { - fg = theme.bright_yellow, - sp = "none", - }, - - TSConstMacro = { - fg = theme.magenta, - sp = "none", - }, - - TSError = { - fg = theme.red, - sp = "none", - }, - - TSException = { - fg = theme.magenta, - sp = "none", - }, - - TSFloat = { - fg = theme.bright_yellow, - sp = "none", - }, - - TSFuncBuiltin = { - fg = theme.bright_blue, - sp = "none", - }, - - TSFuncMacro = { - fg = theme.magenta, - sp = "none", - }, - - TSKeywordOperator = { - fg = theme.bright_magenta, - sp = "none", - }, - - TSMethod = { - fg = theme.bright_blue, - sp = "none", - }, - - TSNamespace = { - fg = theme.magenta, - sp = "none", - }, - - TSNone = { - fg = theme.gray, - sp = "none", - }, - - TSParameter = { - fg = theme.magenta, - sp = "none", - }, - - TSParameterReference = { - fg = theme.gray, - sp = "none", - }, - - TSPunctDelimiter = { - fg = theme.orange, - sp = "none", - }, - - TSPunctSpecial = { - fg = theme.gray, - sp = "none", - }, - - TSStringRegex = { - fg = theme.cyan, - sp = "none", - }, - - TSStringEscape = { - fg = theme.cyan, - sp = "none", - }, - - TSSymbol = { - fg = theme.bright_green, - sp = "none", - }, - - TSTagDelimiter = { - fg = theme.orange, - sp = "none", - }, - - TSText = { - fg = theme.gray, - sp = "none", - }, - - TSStrong = { - bold = true, - }, - - TSEmphasis = { - fg = theme.base09, - sp = "none", - }, - - TSStrike = { - fg = theme.black, - sp = "none", - strikethrough = true, - }, - - TSLiteral = { - fg = theme.bright_magenta, - sp = "none", - }, - - TSURI = { - fg = theme.bright_magenta, - sp = "none", - underline = true, - }, - - TSTypeBuiltin = { - fg = theme.yellow, - sp = "none", - }, - - TSVariableBuiltin = { - fg = theme.bright_yellow, - sp = "none", - }, - - TSDefinition = { - sp = theme.blue, - underline = true, - }, - - TSDefinitionUsage = { - sp = theme.bright_black, - underline = true, - }, - - TSCurrentScope = { - bold = true, - }, -} diff --git a/lua/ui/kdark.lua b/lua/ui/kdark.lua deleted file mode 100644 index 92079b7..0000000 --- a/lua/ui/kdark.lua +++ /dev/null @@ -1,44 +0,0 @@ -local M = {} - -M.colors= { - black = "#000000", -- base00 - red = "#cd0000", -- base01 - green = "#00cd00", -- base02 - yellow = "#cdcd00", -- base03 - blue = "#0000ee", -- base04 - magenta = "#cd00cd", -- base05 - cyan = "#00cdcd", -- base06 - white = "#e5e5e5", -- base07 - bright_black = "#7f7f7f", -- base08 - bright_red = "#ff0000", -- base09 - bright_green = "#00ff00", -- base0A - bright_yellow = "#ffff00", -- base0B - bright_blue = "#5c5cff", -- base0C - bright_magenta = "#ff00ff", -- base0D - bright_cyan = "#00ffff", -- base0E - bright_white = "#ffffff", -- base0F - orange = "#be5046", - gray = "#abb2bf", -} - --- M.colors= { --- black = "#131313", -- base00 --- red = "#353b45", -- base01 --- green = "#3e4451", -- base02 --- yellow = "#545862", -- base03 --- blue = "#565c64", -- base04 --- magenta = "#abb2bf", -- base05 --- cyan = "#b6bdca", -- base06 --- white = "#c8ccd4", -- base07 --- bright_black = "#cd00cd", -- base08 --- bright_red = "#d19a66", -- base09 --- bright_green = "#cdcd00", -- base0A --- bright_yellow = "#00ff00", -- base0B --- bright_blue = "#56b6c2", -- base0C --- bright_magenta = "#5c5cff", -- base0D --- bright_cyan = "#cd00cd", -- base0E --- bright_white = "#be5046", -- base0F --- } - - -return M diff --git a/lua/ui/term_hl.lua b/lua/ui/term_hl.lua deleted file mode 100644 index cfa9b5a..0000000 --- a/lua/ui/term_hl.lua +++ /dev/null @@ -1,18 +0,0 @@ -local colors = require("ui.kdark").colors - -vim.g.terminal_color_0 = "#" .. colors.black -vim.g.terminal_color_1 = "#" .. colors.red -vim.g.terminal_color_2 = "#" .. colors.green -vim.g.terminal_color_3 = "#" .. colors.yellow -vim.g.terminal_color_4 = "#" .. colors.blue -vim.g.terminal_color_5 = "#" .. colors.magenta -vim.g.terminal_color_6 = "#" .. colors.cyan -vim.g.terminal_color_7 = "#" .. colors.white -vim.g.terminal_color_8 = "#" .. colors.bright_black -vim.g.terminal_color_9 = "#" .. colors.bright_red -vim.g.terminal_color_10 = "#" .. colors.bright_green -vim.g.terminal_color_11 = "#" .. colors.bright_yellow -vim.g.terminal_color_12 = "#" .. colors.bright_blue -vim.g.terminal_color_13 = "#" .. colors.bright_magenta -vim.g.terminal_color_14 = "#" .. colors.bright_cyan -vim.g.terminal_color_15 = "#" .. colors.bright_white diff --git a/snippets/asm.json b/snippets/asm.json deleted file mode 100644 index db94c48..0000000 --- a/snippets/asm.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "boilerplate": { - "prefix": "boilerplate", - "body": [ - "\n.model small", - "\n.data", - "\n.code", - "\tmov ax, @data", - "\tmov ds, ax", - "\n\n\tmov ah, 4ch", - "\tint 21h", - "\tends", - "end" - ] - } -} diff --git a/snippets/c.json b/snippets/c.json deleted file mode 100644 index 4a0c30b..0000000 --- a/snippets/c.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "boilerplate": { - "prefix": "boilerplate", - "body": [ - "#include ", - "\nint main(int argc, char *argv[])", - "{", - " $1", - " return 0;", - "}" - ] - } -} diff --git a/snippets/package.json b/snippets/package.json deleted file mode 100644 index 6c3e767..0000000 --- a/snippets/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "My snippets", - "contributes": { - "snippets": [ - { - "language": [ - "all" - ], - "path": "./all.json" - }, - { - "language": [ - "c" - ], - "path": "./c.json" - }, - { - "language": [ - "asm" - ], - "path": "./asm.json" - } - - ] - } -}