Removing some unnecessary comments and lines
This commit is contained in:
parent
84120d10e8
commit
7c3a4bd063
|
|
@ -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 {}
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
-- mason and mason-lspconfig released version 2.0.
|
||||
-- with some breaking changes, multiple methods have been changed
|
||||
-- therefore (for now) a workaround is needed for Mason to still work in LazyVim
|
||||
-- THIS WILL PIN the VERSION number, remove this file later, when it's no longer needed
|
||||
-- https://www.reddit.com/r/neovim/comments/1kgu748/masonnvim_20_has_been_released/mr41tkr/
|
||||
return {
|
||||
{ "mason-org/mason.nvim", version = "1.11.0" },
|
||||
{ "mason-org/mason-lspconfig.nvim", version = "1.32.0" },
|
||||
}
|
||||
-- after adding/saving this file run :Lazy to potentially 're-install' the versions above
|
||||
|
|
@ -3,9 +3,7 @@ return {
|
|||
---@module 'oil'
|
||||
---@type oil.SetupOpts
|
||||
opts = {},
|
||||
-- Optional dependencies
|
||||
dependencies = { { 'nvim-mini/mini.icons', opts = {} } },
|
||||
-- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
|
||||
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
|
||||
lazy = false,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,13 +4,8 @@ return {
|
|||
lazy = false,
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
bigfile = { enabled = true },
|
||||
--dashboard = { enabled = true },
|
||||
input = { enabled = true },
|
||||
--notifier = { enabled = true },
|
||||
statuscolumn = { enabled = true },
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
return {
|
||||
'folke/trouble.nvim',
|
||||
opts = {}, -- for default options, refer to the configuration section for custom setup.
|
||||
opts = {},
|
||||
cmd = 'Trouble',
|
||||
keys = {
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
return {
|
||||
'windwp/nvim-ts-autotag',
|
||||
-- event = { 'BufReadPre', 'BufNewFile' },
|
||||
opts = {
|
||||
-- Defaults
|
||||
-- enable_close = true, -- Auto close tags
|
||||
-- enable_rename = true, -- Auto rename pairs of tags
|
||||
-- enable_close_on_slash = false, -- Auto close on trailing </
|
||||
},
|
||||
-- config = function(_, opts)
|
||||
-- require('nvim-ts-autotag').setup(opts)
|
||||
-- end,
|
||||
-- opts = {
|
||||
-- Defaults
|
||||
-- enable_close = true, -- Auto close tags
|
||||
-- enable_rename = true, -- Auto rename pairs of tags
|
||||
-- enable_close_on_slash = false, -- Auto close on trailing </
|
||||
-- },
|
||||
config = function(_, opts)
|
||||
require('nvim-ts-autotag').setup(opts)
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,8 +47,6 @@ return {
|
|||
-- 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
|
||||
|
|
@ -58,39 +56,32 @@ return {
|
|||
--
|
||||
-- See :h 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
|
||||
['<CR>'] = { 'accept', 'fallback' },
|
||||
},
|
||||
|
||||
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', 'lazydev' },
|
||||
providers = {
|
||||
lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 },
|
||||
},
|
||||
},
|
||||
|
||||
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 :h blink-cmp-config-fuzzy for more information
|
||||
fuzzy = { implementation = 'lua' },
|
||||
|
||||
|
|
|
|||
|
|
@ -30,21 +30,15 @@ return {
|
|||
{ 'j-hui/fidget.nvim', opts = {} },
|
||||
|
||||
-- Allows extra capabilities provided by blink.cmp
|
||||
-- Already installed in another file
|
||||
'saghen/blink.cmp',
|
||||
},
|
||||
config = function()
|
||||
-- Brief aside: **What is LSP?**
|
||||
--
|
||||
-- LSP is an initialism you've probably heard, but might not understand what it is.
|
||||
--
|
||||
-- LSP stands for Language Server Protocol. It's a protocol that helps editors
|
||||
-- and language tooling communicate in a standardized fashion.
|
||||
--
|
||||
-- In general, you have a "server" which is some tool built to understand a particular
|
||||
-- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers
|
||||
-- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone
|
||||
-- processes that communicate with some "client" - in this case, Neovim!
|
||||
--
|
||||
-- LSP provides Neovim with features like:
|
||||
-- - Go to definition
|
||||
-- - Find references
|
||||
|
|
@ -65,11 +59,6 @@ return {
|
|||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
|
||||
callback = function(event)
|
||||
-- NOTE: Remember that Lua is a real programming language, and as such it is possible
|
||||
-- to define small helper and utility functions so you don't have to repeat yourself.
|
||||
--
|
||||
-- In this case, we create a function that lets us more easily define mappings specific
|
||||
-- for LSP related items. It sets the mode, buffer and description for us each time.
|
||||
local map = function(keys, func, desc, mode)
|
||||
mode = mode or 'n'
|
||||
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
||||
|
|
@ -84,18 +73,15 @@ return {
|
|||
map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' })
|
||||
|
||||
-- Find references for the word under your cursor.
|
||||
-- map('grr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||
map('grr', require('fzf-lua').lsp_references, '[G]oto [R]eferences')
|
||||
|
||||
-- Jump to the implementation of the word under your cursor.
|
||||
-- Useful when your language has ways of declaring types without an actual implementation.
|
||||
-- map('gri', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
||||
map('gri', require('fzf-lua').lsp_implementations, '[G]oto [I]mplementation')
|
||||
|
||||
-- Jump to the definition of the word under your cursor.
|
||||
-- This is where a variable was first declared, or where a function is defined, etc.
|
||||
-- To jump back, press <C-t>.
|
||||
-- map('grd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
||||
map('grd', require('fzf-lua').lsp_definitions, '[G]oto [D]efinition')
|
||||
|
||||
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
||||
|
|
@ -104,18 +90,15 @@ return {
|
|||
|
||||
-- Fuzzy find all the symbols in your current document.
|
||||
-- Symbols are things like variables, functions, types, etc.
|
||||
-- map('gO', require('telescope.builtin').lsp_document_symbols, 'Open Document Symbols')
|
||||
map('gO', require('fzf-lua').lsp_document_symbols, 'Open Document Symbols')
|
||||
|
||||
-- Fuzzy find all the symbols in your current workspace.
|
||||
-- Similar to document symbols, except searches over your entire project.
|
||||
-- map('gW', require('telescope.builtin').lsp_dynamic_workspace_symbols, 'Open Workspace Symbols')
|
||||
map('gW', require('fzf-lua').lsp_workspace_symbols, 'Open Workspace Symbols')
|
||||
|
||||
-- Jump to the type of the word under your cursor.
|
||||
-- Useful when you're not sure what type a variable is and you want to see
|
||||
-- the definition of its *type*, not where it was *defined*.
|
||||
-- map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition')
|
||||
map('grt', require('fzf-lua').lsp_typedefs, '[G]oto [T]ype Definition')
|
||||
|
||||
-- The following two autocommands are used to highlight references of the
|
||||
|
|
@ -129,7 +112,6 @@ return {
|
|||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.document_highlight,
|
||||
})
|
||||
|
||||
-- When you move your cursor, the highlights will be cleared
|
||||
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
|
||||
buffer = event.buf,
|
||||
|
|
@ -148,7 +130,6 @@ return {
|
|||
|
||||
-- The following code creates a keymap to toggle inlay hints in your
|
||||
-- code, if the language server you are using supports them
|
||||
--
|
||||
-- This may be unwanted, since they displace some of your code
|
||||
if client and client:supports_method('textDocument/inlayHint', event.buf) then
|
||||
map('<leader>th', function()
|
||||
|
|
@ -191,7 +172,8 @@ return {
|
|||
-- By default, Neovim doesn't support everything that is in the LSP specification.
|
||||
-- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
|
||||
-- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
|
||||
-- local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
vim.lsp.config('*', { capabilities = capabilities })
|
||||
|
||||
-- Add any additional override configuration in the following tables. Available keys are:
|
||||
-- - cmd (table): Override the default command used to start the server
|
||||
|
|
@ -199,43 +181,24 @@ return {
|
|||
-- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features.
|
||||
-- - 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/
|
||||
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
||||
local servers = {
|
||||
clangd = {},
|
||||
gopls = {},
|
||||
pyright = {},
|
||||
rust_analyzer = {},
|
||||
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
||||
stylua = {},
|
||||
lua_ls = {
|
||||
-- cmd = { ... },
|
||||
-- filetypes = { ... },
|
||||
-- capabilities = {},
|
||||
on_init = function(client)
|
||||
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,
|
||||
-- on_init = function(client)
|
||||
-- end,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = 'LuaJIT',
|
||||
},
|
||||
completion = {
|
||||
callSnippet = 'Replace',
|
||||
},
|
||||
|
|
@ -248,17 +211,13 @@ return {
|
|||
},
|
||||
},
|
||||
ts_ls = {},
|
||||
-- TODO: make biome work as lsp fot ts, js, tsx, jsx files instead of ts_ls
|
||||
-- TODO: make biome work as lsp for ts, js, tsx, jsx files instead of ts_ls
|
||||
biome = {
|
||||
-- cmd = { 'biome', 'lsp-proxy' },
|
||||
-- root_dir = require('lspconfig').util.root_pattern('package.json', '.git'),
|
||||
-- cmd = { 'biome', 'lsp-proxy' },
|
||||
-- root_dir = require('lspconfig').util.root_pattern('package.json', '.git'),
|
||||
},
|
||||
}
|
||||
|
||||
-- Ensure the servers and tools above are installed
|
||||
-- To check the current status of installed tools and/or manually install
|
||||
-- other tools, you can run
|
||||
-- :Mason
|
||||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
vim.list_extend(ensure_installed, {
|
||||
-- add any other tools we want from mason
|
||||
|
|
|
|||
|
|
@ -5,15 +5,6 @@ return {
|
|||
branch = 'main',
|
||||
build = ':TSUpdate',
|
||||
opts = {},
|
||||
-- dependencies = {
|
||||
-- 'windwp/nvim-ts-autotag', -- auto close tsx tags
|
||||
-- },
|
||||
-- opts = {
|
||||
-- autotag = {
|
||||
-- -- Setup autotag using treesitter config.
|
||||
-- enable = true,
|
||||
-- },
|
||||
-- },
|
||||
-- main = 'nvim-treesitter.configs', -- Sets main module to use for opts
|
||||
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
||||
config = function(_, opts)
|
||||
|
|
@ -35,9 +26,10 @@ return {
|
|||
'elixir',
|
||||
'toml',
|
||||
'yaml',
|
||||
'ecma',
|
||||
'typescript',
|
||||
'javascript',
|
||||
'tsx',
|
||||
'jsx',
|
||||
}
|
||||
local alreadyInstalled = require('nvim-treesitter').get_installed 'parsers'
|
||||
local parsersToInstall = vim
|
||||
|
|
@ -46,7 +38,7 @@ return {
|
|||
return not vim.tbl_contains(alreadyInstalled, parser)
|
||||
end)
|
||||
:totable()
|
||||
-- print(parsersToInstall)
|
||||
|
||||
if #parsersToInstall > 0 then
|
||||
require('nvim-treesitter').install(parsersToInstall)
|
||||
end
|
||||
|
|
@ -58,7 +50,6 @@ return {
|
|||
group = vim.api.nvim_create_augroup('EnableTreesitterHighlighting', { clear = true }),
|
||||
pattern = filetypes,
|
||||
callback = function(event)
|
||||
print(event.buf)
|
||||
local parser_installed = pcall(vim.treesitter.get_parser, event.buf, parser)
|
||||
if parser_installed then
|
||||
pcall(vim.treesitter.start, event.buf, parser)
|
||||
|
|
@ -73,11 +64,6 @@ return {
|
|||
end
|
||||
end
|
||||
end,
|
||||
-- There are additional nvim-treesitter modules that you can use to interact
|
||||
-- with nvim-treesitter. You should go explore a few and see what interests you:
|
||||
--
|
||||
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
|
||||
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
|
||||
},
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
|
|
|
|||
|
|
@ -3,23 +3,10 @@
|
|||
-- To check the current status of your plugins, run
|
||||
-- :Lazy
|
||||
--
|
||||
-- You can press `?` in this menu for help. Use `:q` to close the window
|
||||
--
|
||||
-- To update plugins you can run
|
||||
-- :Lazy update
|
||||
--
|
||||
-- NOTE: Here is where you install your plugins.
|
||||
require('lazy').setup({
|
||||
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
|
||||
'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically
|
||||
|
||||
-- NOTE: Plugins can also be added by using a table,
|
||||
-- with the first argument being the link and the following
|
||||
-- keys can be used to configure plugin behavior/loading/etc.
|
||||
--
|
||||
-- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded.
|
||||
--
|
||||
|
||||
-- modular approach: using `require 'path/name'` will
|
||||
-- include a plugin definition from file lua/path/name.lua
|
||||
require 'kickstart/plugins/git',
|
||||
|
|
@ -33,16 +20,6 @@ require('lazy').setup({
|
|||
require 'kickstart/plugins/mini',
|
||||
require 'kickstart/plugins/treesitter',
|
||||
require 'kickstart/plugins/undotree',
|
||||
|
||||
-- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the
|
||||
-- init.lua. If you want these files, they are in the repository, so you can just download them and
|
||||
-- place them in the correct locations.
|
||||
|
||||
-- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart
|
||||
--
|
||||
-- Here are some example plugins that I've included in the Kickstart repository.
|
||||
-- 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',
|
||||
|
|
@ -51,7 +28,6 @@ require('lazy').setup({
|
|||
|
||||
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
||||
-- 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' },
|
||||
require 'custom/plugins/snacks',
|
||||
|
|
@ -63,14 +39,8 @@ require('lazy').setup({
|
|||
require 'custom/plugins/noice',
|
||||
require 'custom/plugins/theme',
|
||||
require 'custom/plugins/indent-blankline',
|
||||
require 'custom/plugins/leetcode',
|
||||
-- require 'custom/plugins/leetcode',
|
||||
require 'custom/plugins/ts-tag-autoclose',
|
||||
|
||||
--
|
||||
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
|
||||
-- Or use telescope!
|
||||
-- In normal mode type `<space>sh` then write `lazy.nvim-plugin`
|
||||
-- you can continue same window with `<space>sr` which resumes last telescope search
|
||||
}, {
|
||||
ui = {
|
||||
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
-- Make line numbers default
|
||||
vim.o.number = true
|
||||
-- You can also add relative line numbers, to help with jumping.
|
||||
-- Experiment for yourself to see if you like it!
|
||||
vim.o.relativenumber = true
|
||||
|
||||
-- Enable mouse mode, can be useful for resizing splits for example!
|
||||
|
|
|
|||
Loading…
Reference in New Issue