]> localhost Git - nvim.git/commitdiff
feat: best style and code format
authorjj <[email protected]>
Wed, 18 Jun 2025 01:42:13 +0000 (21:42 -0400)
committerjj <[email protected]>
Wed, 18 Jun 2025 01:42:13 +0000 (21:42 -0400)
colors/codeclocks.lua
init.lua
lazy-lock.json
lua/lsp.lua
lua/plugins.lua
lua/treesitter.lua [new file with mode: 0644]

index 9147cb3e197482f598d5d520cc86566a980880d3..3ec092703bd9bc00501d6906bf447ae4f90c7a71 100644 (file)
@@ -52,9 +52,9 @@ end
 
 -- Groups
 local base = {
-  Normal      = { fg = c.fg2, bg = "NONE" },
-  NormalNC    = { fg = c.fg2, bg = "NONE" },
-  NormalSB    = { fg = c.fg2, bg = "NONE" },
+  Normal      = { fg = c.fg2, bg = c.bg1 },
+  NormalNC    = { fg = c.fg2, bg = c.bg1 },
+  NormalSB    = { fg = c.fg2, bg = c.bg1 },
 
   -- Line Number
   LineNr       = { fg = c.fg0 },
index bf75ff41da8b1754c8700e64d4f3540a122491fd..c47be2446fd0f241453e3757684f0ae56ba5213a 100644 (file)
--- a/init.lua
+++ b/init.lua
@@ -23,7 +23,7 @@ if vim.g.neovide then
   require('neovide')
 end
 
-vim.cmd.colorscheme('codeclocks')
+vim.cmd.colorscheme("gruber-darker")
 
 -- Autocmd ============================================================================================================
 vim.api.nvim_create_autocmd("BufRead", {
index 8dd1c50b2c7530a22c21f3196b6b0bc9718e01c6..16d874cfaa85ce80998c9236e40837ec131899ac 100644 (file)
@@ -1,6 +1,7 @@
 {
   "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
   "fzf-lua": { "branch": "main", "commit": "ac6a34ea39831ec71c14f72075facf377ea9a00d" },
+  "gruber-darker.nvim": { "branch": "main", "commit": "a2dda61d9c1225e16951a51d6b89795b0ac35cd6" },
   "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
   "leetcode.nvim": { "branch": "master", "commit": "db7e1cd6b9191b34b4c1f2f96e4e3949cde9f951" },
   "lualine.nvim": { "branch": "master", "commit": "1517caa8fff05e4b4999857319d3b0609a7f57fa" },
index 91e18e75f054480a3bf0df92977090be7922ca1a..fc3f7fbfa258a3040f0a7c1c92e94a170a939c9d 100644 (file)
@@ -6,9 +6,11 @@ local function automatic_setup(lsps)
   local lspconfig = require("lspconfig")
 
   for i in pairs(lsps) do
-    lspconfig[lsps[i]].setup { 
-      on_attach = lsp_keymaps_on_attach 
-    }
+    if vim.fn.executable(lsps[i]) == 1 then 
+      lspconfig[lsps[i]].setup { 
+        on_attach = lsp_keymaps_on_attach 
+      } 
+    end
   end
 end
 
@@ -17,12 +19,16 @@ local function manual_setup_zig()
 end
 
 local function manual_setup_rust()
+  if vim.fn.executable('lua-language-server') == 0 then return end
+
   require("lspconfig")['rust_analyzer'].setup {
     on_attach = lsp_keymaps_on_attach
   }
 end
 
 local function manual_setup_lua() 
+  if vim.fn.executable('lua-language-server') == 0 then return end
+
   require("lspconfig").lua_ls.setup {
     on_attach = lsp_keymaps_on_attach,
     settings = {
@@ -38,6 +44,8 @@ local function manual_setup_lua()
 end
 
 local function manual_setup_deno()
+  if vim.fn.executable('denols') == 0 then return end
+
   local lspconfig = require('lspconfig')
 
   lspconfig.denols.setup {
@@ -47,6 +55,8 @@ local function manual_setup_deno()
 end
 
 local function manual_setup_node()
+  if vim.fn.executable('tsserver') == 0 then return end
+
   local lspconfig = require('lspconfig')
 
   lspconfig.ts_ls.setup {
@@ -65,8 +75,6 @@ local function manual_setup()
 end
 
 P.config = function() 
-  require('mason-lspconfig').setup({ automatic_installation = false })
-
   local automatic_setup_lsps = {
     "clangd",
     "gopls",
index 053b57433f58f156cddbf2b041f709512772097e..0a0adde8a2b59de8f6cddca4e848167b1e7e7f16 100644 (file)
@@ -14,9 +14,12 @@ end
 vim.opt.rtp:prepend(lazypath)
 
 require("lazy").setup({
+  { "blazkowolf/gruber-darker.nvim" },
   { "ibhagwan/fzf-lua" },
   { "shortcuts/no-neck-pain.nvim",               version = "*" },
   { 'MeanderingProgrammer/render-markdown.nvim', opts = {} },
+  { "nvim-treesitter/nvim-treesitter",           config = require('treesitter').config },
+  { "neovim/nvim-lspconfig",                     config = require('lsp').config },
   {
     'stevearc/oil.nvim',
     opts = {},
@@ -71,57 +74,4 @@ require("lazy").setup({
     },
     config = true
   },
-  {
-    "nvim-treesitter/nvim-treesitter",
-    config = function()
-      require("nvim-treesitter.configs").setup({
-        modules = {},
-        auto_install = true,
-        sync_install = false,
-        ignore_install = {},
-        ensure_installed = {
-          "asm", "bash", "c",
-          "comment", "cpp", "css",
-          "csv", "gitignore", "glsl",
-          "go", "html", "ini",
-          "java", "javascript", "json",
-          "lua", "make", "python",
-          "rust", "tmux", "toml",
-          "tsx", "typescript", "yaml",
-          "zig",
-        },
-        highlight = {
-          enable = true,
-          disable = { "help", "vimdoc" },
-        },
-        indent = {
-          enable = true,
-          disable = { "help", "vimdoc" },
-        },
-      })
-      vim.treesitter.language.register("html", "handlebars")
-
-      local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
-      parser_config.crystal = {
-        install_info = {
-          url = "/home/jj/.local/opt/tree-sitter-crystal",
-          files = { "src/parser.c", "src/scanner.c" },
-          branch = "main",
-        },
-        filetype = "cr",
-      }
-    end
-  },
-  {
-    "williamboman/mason.nvim",
-    lazy = false,
-    config = function()
-      require("mason").setup({ max_concurrent_installers = 10 })
-    end
-  },
-  {
-    "neovim/nvim-lspconfig",
-    dependencies = { "williamboman/mason-lspconfig.nvim", },
-    config = require('lsp').config
-  },
 })
diff --git a/lua/treesitter.lua b/lua/treesitter.lua
new file mode 100644 (file)
index 0000000..ac45f22
--- /dev/null
@@ -0,0 +1,43 @@
+local P = {}
+
+P.config = function()
+  require("nvim-treesitter.configs").setup({
+    modules = {},
+    auto_install = true,
+    sync_install = false,
+    ignore_install = {},
+    ensure_installed = {
+      "asm", "bash", "c",
+      "comment", "cpp", "css",
+      "csv", "gitignore", "glsl",
+      "go", "html", "ini",
+      "java", "javascript", "json",
+      "lua", "make", "python",
+      "rust", "tmux", "toml",
+      "tsx", "typescript", "yaml",
+      "zig",
+    },
+    highlight = {
+      enable = true,
+      disable = { "help", "vimdoc" },
+    },
+    indent = {
+      enable = true,
+      disable = { "help", "vimdoc" },
+    },
+  })
+
+  vim.treesitter.language.register("html", "handlebars")
+
+  local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
+  parser_config.crystal = {
+    install_info = {
+      url = "/home/jj/.local/opt/tree-sitter-crystal",
+      files = { "src/parser.c", "src/scanner.c" },
+      branch = "main",
+    },
+    filetype = "cr",
+  }
+end
+
+return P