From 4f369493c0e824b1e603ac11f25c88b733dd83fc Mon Sep 17 00:00:00 2001 From: Kuah Hong Xuan Date: Sun, 21 Dec 2025 17:22:03 +0800 Subject: [PATCH 1/5] initial commit --- init.lua | 104 +++++-------------------------------------------------- 1 file changed, 9 insertions(+), 95 deletions(-) diff --git a/init.lua b/init.lua index b98ffc6198a..94992e054d7 100644 --- a/init.lua +++ b/init.lua @@ -1,89 +1,3 @@ ---[[ - -===================================================================== -==================== READ THIS BEFORE CONTINUING ==================== -===================================================================== -======== .-----. ======== -======== .----------------------. | === | ======== -======== |.-""""""""""""""""""-.| |-----| ======== -======== || || | === | ======== -======== || KICKSTART.NVIM || |-----| ======== -======== || || | === | ======== -======== || || |-----| ======== -======== ||:Tutor || |:::::| ======== -======== |'-..................-'| |____o| ======== -======== `"")----------------(""` ___________ ======== -======== /::::::::::| |::::::::::\ \ no mouse \ ======== -======== /:::========| |==hjkl==:::\ \ required \ ======== -======== '""""""""""""' '""""""""""""' '""""""""""' ======== -======== ======== -===================================================================== -===================================================================== - -What is Kickstart? - - Kickstart.nvim is *not* a distribution. - - Kickstart.nvim is a starting point for your own configuration. - The goal is that you can read every line of code, top-to-bottom, understand - what your configuration is doing, and modify it to suit your needs. - - Once you've done that, you can start exploring, configuring and tinkering to - make Neovim your own! That might mean leaving Kickstart just the way it is for a while - or immediately breaking it into modular pieces. It's up to you! - - If you don't know anything about Lua, I recommend taking some time to read through - a guide. One possible example which will only take 10-15 minutes: - - https://learnxinyminutes.com/docs/lua/ - - After understanding a bit more about Lua, you can use `:help lua-guide` as a - reference for how Neovim integrates Lua. - - :help lua-guide - - (or HTML version): https://neovim.io/doc/user/lua-guide.html - -Kickstart Guide: - - TODO: The very first thing you should do is to run the command `:Tutor` in Neovim. - - If you don't know what this means, type the following: - - - - : - - Tutor - - - - (If you already know the Neovim basics, you can skip this step.) - - Once you've completed that, you can continue working through **AND READING** the rest - of the kickstart init.lua. - - Next, run AND READ `:help`. - This will open up a help window with some basic information - about reading, navigating and searching the builtin help documentation. - - This should be the first place you go to look when you're stuck or confused - with something. It's one of my favorite Neovim features. - - MOST IMPORTANTLY, we provide a keymap "sh" to [s]earch the [h]elp documentation, - which is very useful when you're not exactly sure of what you're looking for. - - I have left several `:help X` comments throughout the init.lua - These are hints about where to find more information about the relevant settings, - plugins or Neovim features used in Kickstart. - - NOTE: Look for lines like this - - Throughout the file. These are for you, the reader, to help you understand what is happening. - Feel free to delete them once you know what you're doing, but they should serve as a guide - for when you are first encountering a few different constructs in your Neovim config. - -If you experience any errors while trying to install kickstart, run `:checkhealth` for more info. - -I hope you enjoy your Neovim journey, -- TJ - -P.S. You can delete this when you're done too. It's your config now! :) ---]] - -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) @@ -91,7 +5,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.o` @@ -185,10 +99,10 @@ vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagn vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) -- TIP: Disable arrow keys in normal mode --- vim.keymap.set('n', '', 'echo "Use h to move!!"') --- vim.keymap.set('n', '', 'echo "Use l to move!!"') --- vim.keymap.set('n', '', 'echo "Use k to move!!"') --- vim.keymap.set('n', '', 'echo "Use j to move!!"') +vim.keymap.set('n', '', 'echo "Use h to move!!"') +vim.keymap.set('n', '', 'echo "Use l to move!!"') +vim.keymap.set('n', '', 'echo "Use k to move!!"') +vim.keymap.set('n', '', 'echo "Use j to move!!"') -- Keybinds to make split navigation easier. -- Use CTRL+ to switch between windows @@ -671,10 +585,10 @@ require('lazy').setup({ -- - settings (table): Override the default settings passed when initializing the server. -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { - -- clangd = {}, - -- gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, + clangd = {}, + gopls = {}, + pyright = {}, + rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- -- Some languages (like typescript) have entire language plugins that can be useful: From 0967fc559e3f73335486682191ceb697fccc608f Mon Sep 17 00:00:00 2001 From: Kuah Hong Xuan Date: Sun, 21 Dec 2025 17:37:26 +0800 Subject: [PATCH 2/5] enabled linter and neotree --- init.lua | 2 +- lua/kickstart/plugins/lint.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 94992e054d7..7662d4f9bb4 100644 --- a/init.lua +++ b/init.lua @@ -891,7 +891,7 @@ require('lazy').setup({ -- require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', + require 'kickstart.plugins.neo-tree', -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index dec42f097c6..9bc065ea289 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -7,6 +7,7 @@ return { local lint = require 'lint' lint.linters_by_ft = { markdown = { 'markdownlint' }, + rst = { 'vale' }, } -- To allow other plugins to add linters to require('lint').linters_by_ft, @@ -23,7 +24,6 @@ return { -- janet = { "janet" }, -- json = { "jsonlint" }, -- markdown = { "vale" }, - -- rst = { "vale" }, -- ruby = { "ruby" }, -- terraform = { "tflint" }, -- text = { "vale" } From 54ed2f66bc1c7b9946a869b02ddfd851c8af0a19 Mon Sep 17 00:00:00 2001 From: Kuah Hong Xuan Date: Mon, 29 Dec 2025 16:44:38 +0800 Subject: [PATCH 3/5] cfg update --- init.lua | 20 +++++++------------- lua/custom/plugins/init.lua | 4 ---- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/init.lua b/init.lua index 7662d4f9bb4..ef85a944ba4 100644 --- a/init.lua +++ b/init.lua @@ -589,14 +589,8 @@ require('lazy').setup({ gopls = {}, pyright = {}, rust_analyzer = {}, - -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs - -- - -- 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 = {}, - -- + ts_ls = {}, + -- See `:help lspconfig-all` for a list of all the pre-configured LSPs lua_ls = { -- cmd = { ... }, @@ -866,7 +860,7 @@ require('lazy').setup({ -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. -- If you are experiencing weird indenting issues, add the language to -- the list of additional_vim_regex_highlighting and disabled languages for indent. - additional_vim_regex_highlighting = { 'ruby' }, + additional_vim_regex_highlighting = { 'ruby', 'python' }, }, indent = { enable = true, disable = { 'ruby' } }, }, @@ -888,9 +882,9 @@ require('lazy').setup({ -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- -- require 'kickstart.plugins.debug', - -- require 'kickstart.plugins.indent_line', - -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.indent_line', + require 'kickstart.plugins.lint', + require 'kickstart.plugins.autopairs', require 'kickstart.plugins.neo-tree', -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps @@ -898,7 +892,7 @@ require('lazy').setup({ -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8d7a..a564707544f 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -1,5 +1 @@ --- You can add your own plugins here or in other files in this directory! --- I promise not to create any merge conflicts in this directory :) --- --- See the kickstart.nvim README for more information return {} From 8295147a8334714bd0a7f7e81e93af32b20ec1eb Mon Sep 17 00:00:00 2001 From: Kuah Hong Xuan Date: Fri, 23 Jan 2026 15:05:20 +0800 Subject: [PATCH 4/5] ruff setup --- init.lua | 35 ++++++++++++++++++++++++++-- lua/custom/plugins/lsp_overrides.lua | 26 +++++++++++++++++++++ lua/custom/plugins/refactoring.lua | 10 ++++++++ 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 lua/custom/plugins/lsp_overrides.lua create mode 100644 lua/custom/plugins/refactoring.lua diff --git a/init.lua b/init.lua index ef85a944ba4..f19b921abc7 100644 --- a/init.lua +++ b/init.lua @@ -587,7 +587,31 @@ require('lazy').setup({ local servers = { clangd = {}, gopls = {}, - pyright = {}, + basedpyright = { + settings = { + basedpyright = { + analysis = { + autoImportCompletions = true, + autoSearchPaths = true, -- auto serach command paths like 'src' + diagnosticMode = 'openFilesOnly', + useLibraryCodeForTypes = true, + diagnosticSeverityOverrides = { + reportUnknownMemberType = 'none', -- ignore warning : cannot infer member type of object like matplot + }, + }, + }, + }, + }, + ruff = { + init_options = { + settings = { + lint = { + enable = false, + }, + }, + }, + }, + rust_analyzer = {}, ts_ls = {}, -- See `:help lspconfig-all` for a list of all the pre-configured LSPs @@ -677,7 +701,14 @@ require('lazy').setup({ formatters_by_ft = { lua = { 'stylua' }, -- Conform can also run multiple formatters sequentially - -- python = { "isort", "black" }, + python = { + -- To fix auto-fixable lint errors. + 'ruff_fix', + -- To run the Ruff formatter. + 'ruff_format', + -- To organize the imports. + 'ruff_organize_imports', + }, -- -- You can use 'stop_after_first' to run the first available formatter from the list -- javascript = { "prettierd", "prettier", stop_after_first = true }, diff --git a/lua/custom/plugins/lsp_overrides.lua b/lua/custom/plugins/lsp_overrides.lua new file mode 100644 index 00000000000..b1458a1d620 --- /dev/null +++ b/lua/custom/plugins/lsp_overrides.lua @@ -0,0 +1,26 @@ +return { + { + 'neovim/nvim-lspconfig', + opts = { + setup = { + ruff = function(_, _) + -- This runs when ruff is being set up + -- We can return true to skip default setup, but we don't want that + -- Instead we hook later + end, + }, + }, + config = function() + -- Hook into existing LspAttach (kickstart already created the group) + vim.api.nvim_create_autocmd('LspAttach', { + callback = function(args) + local client = vim.lsp.get_client_by_id(args.data.client_id) + if client and client.name == 'ruff' then + client.server_capabilities.diagnosticProvider = false + end + end, + group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = false }), + }) + end, + }, +} diff --git a/lua/custom/plugins/refactoring.lua b/lua/custom/plugins/refactoring.lua new file mode 100644 index 00000000000..8b200fea609 --- /dev/null +++ b/lua/custom/plugins/refactoring.lua @@ -0,0 +1,10 @@ +return { + 'ThePrimeagen/refactoring.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-treesitter/nvim-treesitter', + }, + config = function() + require('refactoring').setup {} + end, +} From 1ee1f2d9c03c59f6edb5fef014f87a7ee7352801 Mon Sep 17 00:00:00 2001 From: Kuah Hong Xuan Date: Fri, 3 Apr 2026 18:35:47 +0800 Subject: [PATCH 5/5] updated formatting --- init.lua | 45 +++++++++++++++++----------- lua/custom/formatting.lua | 26 ++++++++++++++++ lua/custom/plugins/lsp_overrides.lua | 26 ---------------- lua/custom/plugins/refactoring.lua | 10 ------- 4 files changed, 54 insertions(+), 53 deletions(-) create mode 100644 lua/custom/formatting.lua delete mode 100644 lua/custom/plugins/lsp_overrides.lua delete mode 100644 lua/custom/plugins/refactoring.lua diff --git a/init.lua b/init.lua index f19b921abc7..1fa11a50845 100644 --- a/init.lua +++ b/init.lua @@ -133,6 +133,24 @@ vim.api.nvim_create_autocmd('TextYankPost', { end, }) +local formatting = require 'custom.formatting' + +vim.api.nvim_create_autocmd('FileType', { + desc = 'Apply per-filetype indentation settings', + group = vim.api.nvim_create_augroup('kickstart-indent-rules', { clear = true }), + callback = function() + local width = formatting.indent_by_ft[vim.bo.filetype] + if not width then + return + end + + vim.opt_local.expandtab = true + vim.opt_local.tabstop = width + vim.opt_local.softtabstop = width + vim.opt_local.shiftwidth = width + end, +}) + -- [[ Install `lazy.nvim` plugin manager ]] -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' @@ -405,6 +423,7 @@ require('lazy').setup({ -- Allows extra capabilities provided by blink.cmp 'saghen/blink.cmp', + { 'AstroNvim/astrolsp', opts = {} }, }, config = function() -- Brief aside: **What is LSP?** @@ -648,12 +667,18 @@ require('lazy').setup({ local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { 'stylua', -- Used to format Lua code + 'prettierd', -- Used to format JavaScript and TypeScript + 'prettier', -- Fallback formatter when prettierd is unavailable + 'astro', + 'html', + 'cssls', + 'tailwindcss', }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } require('mason-lspconfig').setup { ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer) - automatic_installation = false, + automatic_installation = true, handlers = { function(server_name) local server = servers[server_name] or {} @@ -698,21 +723,7 @@ require('lazy').setup({ } end end, - formatters_by_ft = { - lua = { 'stylua' }, - -- Conform can also run multiple formatters sequentially - python = { - -- To fix auto-fixable lint errors. - 'ruff_fix', - -- To run the Ruff formatter. - 'ruff_format', - -- To organize the imports. - 'ruff_organize_imports', - }, - -- - -- You can use 'stop_after_first' to run the first available formatter from the list - -- javascript = { "prettierd", "prettier", stop_after_first = true }, - }, + formatters_by_ft = formatting.formatters_by_ft, }, }, @@ -883,7 +894,7 @@ require('lazy').setup({ main = 'nvim-treesitter.configs', -- Sets main module to use for opts -- [[ Configure Treesitter ]] See `:help nvim-treesitter` opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, + ensure_installed = { 'astro', 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, -- Autoinstall languages that are not installed auto_install = true, highlight = { diff --git a/lua/custom/formatting.lua b/lua/custom/formatting.lua new file mode 100644 index 00000000000..40703187ddd --- /dev/null +++ b/lua/custom/formatting.lua @@ -0,0 +1,26 @@ +local M = {} + +M.indent_by_ft = { + javascript = 2, + javascriptreact = 2, + typescript = 2, + typescriptreact = 2, + json = 2, + html = 2, + css = 2, + scss = 2, +} + +M.formatters_by_ft = { + html = { 'prettier' }, + lua = { 'stylua' }, + python = { + 'ruff_fix', + 'ruff_format', + 'ruff_organize_imports', + }, + javascript = { 'prettierd', 'prettier', stop_after_first = true }, + typescript = { 'prettierd', 'prettier', stop_after_first = true }, +} + +return M diff --git a/lua/custom/plugins/lsp_overrides.lua b/lua/custom/plugins/lsp_overrides.lua deleted file mode 100644 index b1458a1d620..00000000000 --- a/lua/custom/plugins/lsp_overrides.lua +++ /dev/null @@ -1,26 +0,0 @@ -return { - { - 'neovim/nvim-lspconfig', - opts = { - setup = { - ruff = function(_, _) - -- This runs when ruff is being set up - -- We can return true to skip default setup, but we don't want that - -- Instead we hook later - end, - }, - }, - config = function() - -- Hook into existing LspAttach (kickstart already created the group) - vim.api.nvim_create_autocmd('LspAttach', { - callback = function(args) - local client = vim.lsp.get_client_by_id(args.data.client_id) - if client and client.name == 'ruff' then - client.server_capabilities.diagnosticProvider = false - end - end, - group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = false }), - }) - end, - }, -} diff --git a/lua/custom/plugins/refactoring.lua b/lua/custom/plugins/refactoring.lua deleted file mode 100644 index 8b200fea609..00000000000 --- a/lua/custom/plugins/refactoring.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - 'ThePrimeagen/refactoring.nvim', - dependencies = { - 'nvim-lua/plenary.nvim', - 'nvim-treesitter/nvim-treesitter', - }, - config = function() - require('refactoring').setup {} - end, -}