my current config

This commit is contained in:
onlinemax 2024-10-09 13:51:59 -04:00
parent c9c2338359
commit 389244c001
5 changed files with 112 additions and 21 deletions

1
.gitignore vendored
View File

@ -4,4 +4,3 @@ test.sh
nvim nvim
spell/ spell/
lazy-lock.json

View File

@ -100,6 +100,7 @@ vim.g.have_nerd_font = false
-- Make line numbers default -- Make line numbers default
vim.opt.number = true vim.opt.number = true
vim.opt.relativenumber = true
-- You can also add relative line numbers, to help with jumping. -- You can also add relative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it! -- Experiment for yourself to see if you like it!
-- vim.opt.relativenumber = true -- vim.opt.relativenumber = true
@ -176,9 +177,9 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagn
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' }) vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
-- TIP: Disable arrow keys in normal mode -- TIP: Disable arrow keys in normal mode
-- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>') vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
-- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>') vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>') vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>') -- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
-- Keybinds to make split navigation easier. -- Keybinds to make split navigation easier.
@ -607,7 +608,7 @@ require('lazy').setup({
local servers = { local servers = {
-- clangd = {}, -- clangd = {},
-- gopls = {}, -- gopls = {},
-- pyright = {}, pyright = {},
-- rust_analyzer = {}, -- rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
-- --
@ -615,7 +616,7 @@ require('lazy').setup({
-- https://github.com/pmizio/typescript-tools.nvim -- https://github.com/pmizio/typescript-tools.nvim
-- --
-- But for many setups, the LSP (`ts_ls`) will work just fine -- But for many setups, the LSP (`ts_ls`) will work just fine
-- ts_ls = {}, ts_ls = {},
-- --
lua_ls = { lua_ls = {
@ -654,6 +655,55 @@ require('lazy').setup({
handlers = { handlers = {
function(server_name) function(server_name)
local server = servers[server_name] or {} local server = servers[server_name] or {}
if server_name == 'jsonls' then
server.settings = {
json = {
-- Schemas https://www.schemastore.org
schemas = {
{
fileMatch = { 'package.json' },
url = 'https://json.schemastore.org/package.json',
},
{
fileMatch = { 'tsconfig*.json' },
url = 'https://json.schemastore.org/tsconfig.json',
},
{
fileMatch = {
'.prettierrc',
'.prettierrc.json',
'prettier.config.json',
},
url = 'https://json.schemastore.org/prettierrc.json',
},
{
fileMatch = { '.eslintrc', '.eslintrc.json' },
url = 'https://json.schemastore.org/eslintrc.json',
},
{
fileMatch = { '.babelrc', '.babelrc.json', 'babel.config.json' },
url = 'https://json.schemastore.org/babelrc.json',
},
{
fileMatch = { 'lerna.json' },
url = 'https://json.schemastore.org/lerna.json',
},
{
fileMatch = { 'now.json', 'vercel.json' },
url = 'https://json.schemastore.org/now.json',
},
{
fileMatch = {
'.stylelintrc',
'.stylelintrc.json',
'stylelint.config.json',
},
url = 'http://json.schemastore.org/stylelintrc.json',
},
},
},
}
end
-- This handles overriding only values explicitly passed -- This handles overriding only values explicitly passed
-- by the server configuration above. Useful when disabling -- by the server configuration above. Useful when disabling
-- certain features of an LSP (for example, turning off formatting for ts_ls) -- certain features of an LSP (for example, turning off formatting for ts_ls)
@ -764,9 +814,9 @@ require('lazy').setup({
-- No, but seriously. Please read `:help ins-completion`, it is really good! -- No, but seriously. Please read `:help ins-completion`, it is really good!
mapping = cmp.mapping.preset.insert { mapping = cmp.mapping.preset.insert {
-- Select the [n]ext item -- Select the [n]ext item
['<C-n>'] = cmp.mapping.select_next_item(), ['<tab>'] = cmp.mapping.select_next_item(),
-- Select the [p]revious item -- Select the [p]revious item
['<C-p>'] = cmp.mapping.select_prev_item(), ['<S-Tab>'] = cmp.mapping.select_prev_item(),
-- Scroll the documentation window [b]ack / [f]orward -- Scroll the documentation window [b]ack / [f]orward
['<C-b>'] = cmp.mapping.scroll_docs(-4), ['<C-b>'] = cmp.mapping.scroll_docs(-4),
@ -775,7 +825,7 @@ require('lazy').setup({
-- Accept ([y]es) the completion. -- Accept ([y]es) the completion.
-- This will auto-import if your LSP supports it. -- This will auto-import if your LSP supports it.
-- This will expand snippets if the LSP sent a snippet. -- This will expand snippets if the LSP sent a snippet.
['<C-y>'] = cmp.mapping.confirm { select = true }, ['<CR>'] = cmp.mapping.confirm { select = true },
-- If you prefer more traditional completion keymaps, -- If you prefer more traditional completion keymaps,
-- you can uncomment the following lines -- you can uncomment the following lines
@ -917,19 +967,19 @@ require('lazy').setup({
-- Here are some example plugins that I've included in the Kickstart repository. -- 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). -- Uncomment any of the lines below to enable them (you will need to restart nvim).
-- --
-- require 'kickstart.plugins.debug', require 'kickstart.plugins.debug',
-- require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.indent_line',
-- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.lint',
-- require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.autopairs',
-- require 'kickstart.plugins.neo-tree', require 'kickstart.plugins.neo-tree',
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps 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` -- 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. -- 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. -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
-- { import = 'custom.plugins' }, { import = 'custom.plugins' },
}, { }, {
ui = { ui = {
-- If you are using a Nerd Font: set icons to an empty table which will use the -- If you are using a Nerd Font: set icons to an empty table which will use the

View File

@ -3,25 +3,34 @@
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"conform.nvim": { "branch": "master", "commit": "1a99fdc1d3aa9ccdf3021e67982a679a8c5c740c" }, "conform.nvim": { "branch": "master", "commit": "40d4e98fcc3e6f485f0e8924c63734bc7e305967" },
"fidget.nvim": { "branch": "main", "commit": "d855eed8a06531a7e8fd0684889b2943f373c469" }, "fidget.nvim": { "branch": "main", "commit": "d855eed8a06531a7e8fd0684889b2943f373c469" },
"gitsigns.nvim": { "branch": "main", "commit": "863903631e676b33e8be2acb17512fdc1b80b4fb" }, "gitsigns.nvim": { "branch": "main", "commit": "863903631e676b33e8be2acb17512fdc1b80b4fb" },
"lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, "lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" },
"lazydev.nvim": { "branch": "main", "commit": "491452cf1ca6f029e90ad0d0368848fac717c6d2" }, "lazydev.nvim": { "branch": "main", "commit": "491452cf1ca6f029e90ad0d0368848fac717c6d2" },
"live-server.nvim": { "branch": "main", "commit": "5fc8abb727827a09d0ce1b7757d0a4c7b5802b09" },
"luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" }, "luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"mini.nvim": { "branch": "main", "commit": "848c5e8f428faf843051768e0d56104cd02aea1f" }, "mini.nvim": { "branch": "main", "commit": "a535342b6105a684f16114f598d44318e6a1d20f" },
"neo-tree.nvim": { "branch": "main", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" },
"nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" },
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
"nvim-lspconfig": { "branch": "master", "commit": "e6569c18c21be5166e4b9cc7530e828b8285c84e" }, "nvim-dap": { "branch": "master", "commit": "7ff6936010b7222fea2caea0f67ed77f1b7c60dd" },
"nvim-treesitter": { "branch": "master", "commit": "98a33cc524c85a78a1ff5a707998629b24cbf8c2" }, "nvim-dap-go": { "branch": "main", "commit": "6aa88167ea1224bcef578e8c7160fe8afbb44848" },
"nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" },
"nvim-lspconfig": { "branch": "master", "commit": "ba1057cba0e5910163fbf2ee3f43b2224b3e5df7" },
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
"nvim-treesitter": { "branch": "master", "commit": "86c10df7ef77daf45a0e4a918934bb59083db1e1" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
"tokyonight.nvim": { "branch": "main", "commit": "efd1417aa01af618426fe1cf507c5458090458f2" }, "tokyonight.nvim": { "branch": "main", "commit": "2c85fad417170d4572ead7bf9fdd706057bd73d7" },
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
"which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" } "which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" }
} }

View File

@ -2,4 +2,20 @@
-- I promise not to create any merge conflicts in this directory :) -- I promise not to create any merge conflicts in this directory :)
-- --
-- See the kickstart.nvim README for more information -- See the kickstart.nvim README for more information
return {} return {
{
'iamcco/markdown-preview.nvim',
cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' },
ft = { 'markdown' },
build = 'cd app && yarn install',
init = function()
vim.g.mkdp_filetypes = { 'markdown' }
end,
},
{
'barrett-ruth/live-server.nvim',
build = 'pnpm add -g live-server',
cmd = { 'LiveServerStart', 'LiveServerStop' },
config = true,
},
}

17
lua/kickstart/dump.lua Normal file
View File

@ -0,0 +1,17 @@
local function dump(o)
if type(o) == 'table' then
local s = '{ '
for k, v in pairs(o) do
if type(k) ~= 'number' then
k = '"' .. k .. '"'
end
s = s .. '[' .. k .. '] = ' .. dump(v) .. ','
end
return s .. '} '
else
return tostring(o)
end
end
function PrintTable(o)
print(dump(o))
end