mirror of
https://github.com/nvim-lua/kickstart.nvim.git
synced 2025-08-06 11:05:05 +02:00
Messy upgrades
This commit is contained in:
parent
4af126e14e
commit
b3f3fc70f0
2 changed files with 108 additions and 23 deletions
100
init.lua
100
init.lua
|
@ -90,14 +90,24 @@ P.S. You can delete this when you're done too. It's your config now! :)
|
|||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
|
||||
vim.api.nvim_exec(
|
||||
[[
|
||||
autocmd BufNewFile,BufRead *.mdx set filetype=markdown.mdx
|
||||
]],
|
||||
false
|
||||
)
|
||||
|
||||
-- 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.opt`
|
||||
-- NOTE: You can change these options as you wish!
|
||||
-- For more options, you can see `:help option-list`
|
||||
|
||||
-- Make fish the default shell
|
||||
vim.opt.shell = vim.fn.executable 'fish' == 1 and 'fish' or vim.env.SHELL
|
||||
|
||||
-- Make line numbers default
|
||||
vim.opt.number = true
|
||||
-- You can also add relative line numbers, to help with jumping.
|
||||
|
@ -145,9 +155,11 @@ vim.opt.splitbelow = true
|
|||
-- See `:help 'list'`
|
||||
-- and `:help 'listchars'`
|
||||
vim.opt.list = true
|
||||
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
||||
vim.opt.listchars = { tab = ' ', trail = '·', nbsp = '␣' }
|
||||
vim.opt.tabstop = 2 -- Always 8 (see :h tabstop)
|
||||
vim.opt.softtabstop = 2 -- Tabs should be 2 spaces wide
|
||||
vim.opt.shiftwidth = 2 -- Tabs should be 2 spaces wide
|
||||
|
||||
-- Preview substitutions live, as you type!
|
||||
vim.opt.inccommand = 'split'
|
||||
|
||||
-- Show which line your cursor is on
|
||||
|
@ -194,6 +206,15 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
|
|||
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
||||
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
||||
|
||||
-- Keybinds for custom plugins
|
||||
-- NvimTree
|
||||
vim.api.nvim_set_keymap('n', '<C-n>', ':NvimTreeToggle<cr>', { silent = true, noremap = true })
|
||||
|
||||
-- NvTerm
|
||||
vim.keymap.set('n', '<leader>tt', function()
|
||||
require('nvterm.terminal').toggle 'horizontal'
|
||||
end, { desc = '[T]oggle [T]erminal' })
|
||||
|
||||
-- NOTE: Some terminals have coliding keymaps or are not able to send distinct keycodes
|
||||
-- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
|
||||
-- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
|
||||
|
@ -519,6 +540,7 @@ require('lazy').setup({
|
|||
-- That is to say, every time a new file is opened that is associated with
|
||||
-- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this
|
||||
-- function will be executed to configure the current buffer
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
|
||||
callback = function(event)
|
||||
|
@ -659,6 +681,16 @@ require('lazy').setup({
|
|||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
|
||||
|
||||
-- Setup Swift
|
||||
require('lspconfig').sourcekit.setup {
|
||||
capabilities = {
|
||||
workspace = {
|
||||
didChangeWatchedFiles = {
|
||||
dynamicRegistration = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
-- Enable the following language servers
|
||||
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
||||
--
|
||||
|
@ -679,9 +711,8 @@ require('lazy').setup({
|
|||
-- https://github.com/pmizio/typescript-tools.nvim
|
||||
--
|
||||
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
||||
-- ts_ls = {},
|
||||
--
|
||||
|
||||
ts_ls = {},
|
||||
jdtls = {},
|
||||
lua_ls = {
|
||||
-- cmd = { ... },
|
||||
-- filetypes = { ... },
|
||||
|
@ -714,6 +745,7 @@ require('lazy').setup({
|
|||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
vim.list_extend(ensure_installed, {
|
||||
'stylua', -- Used to format Lua code
|
||||
'prettierd',
|
||||
})
|
||||
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||
|
||||
|
@ -770,11 +802,20 @@ require('lazy').setup({
|
|||
-- python = { "isort", "black" },
|
||||
--
|
||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||
markdown = { 'prettierd', 'prettier', stop_after_first = true },
|
||||
javascript = { 'prettierd', 'prettier', stop_after_first = true },
|
||||
typescript = { 'prettierd', 'prettier', stop_after_first = true },
|
||||
typescriptreact = { 'prettierd', 'prettier', stop_after_first = true },
|
||||
json = { 'prettierd', 'prettier', stop_after_first = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{ -- highlight color strings
|
||||
'brenoprata10/nvim-highlight-colors',
|
||||
config = function()
|
||||
require('nvim-highlight-colors').setup {}
|
||||
end,
|
||||
},
|
||||
{ -- Autocompletion
|
||||
'hrsh7th/nvim-cmp',
|
||||
event = 'InsertEnter',
|
||||
|
@ -825,7 +866,9 @@ require('lazy').setup({
|
|||
end,
|
||||
},
|
||||
completion = { completeopt = 'menu,menuone,noinsert' },
|
||||
|
||||
formatting = {
|
||||
format = require('nvim-highlight-colors').format,
|
||||
},
|
||||
-- For an understanding of why these mappings were
|
||||
-- chosen, you will need to read `:help ins-completion`
|
||||
--
|
||||
|
@ -843,7 +886,7 @@ require('lazy').setup({
|
|||
-- Accept ([y]es) the completion.
|
||||
-- This will auto-import if your LSP supports it.
|
||||
-- This will expand snippets if the LSP sent a snippet.
|
||||
['<C-y>'] = cmp.mapping.confirm { select = true },
|
||||
['<S-CR>'] = cmp.mapping.confirm { select = true },
|
||||
|
||||
-- If you prefer more traditional completion keymaps,
|
||||
-- you can uncomment the following lines
|
||||
|
@ -890,6 +933,8 @@ require('lazy').setup({
|
|||
{ name = 'nvim_lsp_signature_help' },
|
||||
},
|
||||
}
|
||||
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
|
||||
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -955,6 +1000,40 @@ require('lazy').setup({
|
|||
-- Check out: https://github.com/echasnovski/mini.nvim
|
||||
end,
|
||||
},
|
||||
{
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
version = '*',
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
config = function()
|
||||
require('nvim-tree').setup {}
|
||||
end,
|
||||
},
|
||||
{
|
||||
'NvChad/nvterm',
|
||||
config = function()
|
||||
require('nvterm').setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
'davidmh/mdx.nvim',
|
||||
config = true,
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter' },
|
||||
},
|
||||
{
|
||||
'windwp/nvim-autopairs',
|
||||
event = 'InsertEnter',
|
||||
config = true,
|
||||
-- use opts = {} for passing setup options
|
||||
-- this is equivalent to setup({}) function
|
||||
},
|
||||
{
|
||||
'windwp/nvim-ts-autotag',
|
||||
lazy = false,
|
||||
config = true,
|
||||
},
|
||||
{ -- Highlight, edit, and navigate code
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
|
@ -1030,4 +1109,3 @@ require('lazy').setup({
|
|||
})
|
||||
|
||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue