Merge branch 'master' into initv2
This commit is contained in:
commit
62c8f1b11c
|
@ -84,13 +84,13 @@ git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HO
|
||||||
If you're using `cmd.exe`:
|
If you're using `cmd.exe`:
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone https://github.com/nvim-lua/kickstart.nvim.git %localappdata%\nvim\
|
git clone https://github.com/nvim-lua/kickstart.nvim.git "%localappdata%\nvim"
|
||||||
```
|
```
|
||||||
|
|
||||||
If you're using `powershell.exe`
|
If you're using `powershell.exe`
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone https://github.com/nvim-lua/kickstart.nvim.git $env:LOCALAPPDATA\nvim\
|
git clone https://github.com/nvim-lua/kickstart.nvim.git "${env:LOCALAPPDATA}\nvim"
|
||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
62
init.lua
62
init.lua
|
@ -217,7 +217,7 @@ require('lazy').setup({
|
||||||
config = function()
|
config = function()
|
||||||
local mark = require('harpoon.mark')
|
local mark = require('harpoon.mark')
|
||||||
local ui = require('harpoon.ui')
|
local ui = require('harpoon.ui')
|
||||||
|
|
||||||
-- Keybindings
|
-- Keybindings
|
||||||
vim.keymap.set('n', '<leader>a', mark.add_file, { desc = 'Harpoon: Add file' })
|
vim.keymap.set('n', '<leader>a', mark.add_file, { desc = 'Harpoon: Add file' })
|
||||||
vim.keymap.set('n', '<C-e>', ui.toggle_quick_menu, { desc = 'Harpoon: Toggle menu' })
|
vim.keymap.set('n', '<C-e>', ui.toggle_quick_menu, { desc = 'Harpoon: Toggle menu' })
|
||||||
|
@ -230,7 +230,6 @@ require('lazy').setup({
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
@ -407,8 +406,9 @@ require('lazy').setup({
|
||||||
--
|
--
|
||||||
-- In this case, we create a function that lets us more easily define mappings specific
|
-- 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.
|
-- for LSP related items. It sets the mode, buffer and description for us each time.
|
||||||
local map = function(keys, func, desc)
|
local map = function(keys, func, desc, mode)
|
||||||
vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
mode = mode or 'n'
|
||||||
|
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Jump to the definition of the word under your cursor.
|
-- Jump to the definition of the word under your cursor.
|
||||||
|
@ -442,7 +442,7 @@ require('lazy').setup({
|
||||||
|
|
||||||
-- Execute a code action, usually your cursor needs to be on top of an error
|
-- Execute a code action, usually your cursor needs to be on top of an error
|
||||||
-- or a suggestion from your LSP for this to activate.
|
-- or a suggestion from your LSP for this to activate.
|
||||||
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' })
|
||||||
|
|
||||||
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
||||||
-- For example, in C this would take you to the header.
|
-- For example, in C this would take you to the header.
|
||||||
|
@ -516,8 +516,8 @@ require('lazy').setup({
|
||||||
-- Some languages (like typescript) have entire language plugins that can be useful:
|
-- Some languages (like typescript) have entire language plugins that can be useful:
|
||||||
-- https://github.com/pmizio/typescript-tools.nvim
|
-- https://github.com/pmizio/typescript-tools.nvim
|
||||||
--
|
--
|
||||||
-- But for many setups, the LSP (`tsserver`) will work just fine
|
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
||||||
-- tsserver = {},
|
-- ts_ls = {},
|
||||||
--
|
--
|
||||||
|
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
|
@ -558,7 +558,7 @@ require('lazy').setup({
|
||||||
local server = servers[server_name] or {}
|
local server = servers[server_name] or {}
|
||||||
-- 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 tsserver)
|
-- certain features of an LSP (for example, turning off formatting for ts_ls)
|
||||||
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
||||||
require('lspconfig')[server_name].setup(server)
|
require('lspconfig')[server_name].setup(server)
|
||||||
end,
|
end,
|
||||||
|
@ -566,10 +566,48 @@ require('lazy').setup({
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
{ -- Autoformat
|
||||||
|
'stevearc/conform.nvim',
|
||||||
|
event = { 'BufWritePre' },
|
||||||
|
cmd = { 'ConformInfo' },
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
'<leader>f',
|
||||||
|
function()
|
||||||
|
require('conform').format { async = true, lsp_format = 'fallback' }
|
||||||
|
end,
|
||||||
|
mode = '',
|
||||||
|
desc = '[F]ormat buffer',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
notify_on_error = false,
|
||||||
|
format_on_save = function(bufnr)
|
||||||
|
-- Disable "format_on_save lsp_fallback" for languages that don't
|
||||||
|
-- have a well standardized coding style. You can add additional
|
||||||
|
-- languages here or re-enable it for the disabled ones.
|
||||||
|
local disable_filetypes = { c = true, cpp = true }
|
||||||
|
local lsp_format_opt
|
||||||
|
if disable_filetypes[vim.bo[bufnr].filetype] then
|
||||||
|
lsp_format_opt = 'never'
|
||||||
|
else
|
||||||
|
lsp_format_opt = 'fallback'
|
||||||
|
end
|
||||||
|
return {
|
||||||
|
timeout_ms = 500,
|
||||||
|
lsp_format = lsp_format_opt,
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
formatters_by_ft = {
|
||||||
|
lua = { 'stylua' },
|
||||||
|
-- Conform can also run multiple formatters sequentially
|
||||||
|
-- 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 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Set colorscheme to catppuccin-macchinato
|
-- Set colorscheme to catppuccin-macchinato
|
||||||
|
|
|
@ -11,7 +11,7 @@ return {
|
||||||
},
|
},
|
||||||
cmd = 'Neotree',
|
cmd = 'Neotree',
|
||||||
keys = {
|
keys = {
|
||||||
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal' },
|
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
filesystem = {
|
filesystem = {
|
||||||
|
|
Loading…
Reference in New Issue