Update init.lua
This commit is contained in:
parent
2df5137e59
commit
bdcf55a34b
101
init.lua
101
init.lua
|
@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
|
|||
vim.opt.number = true
|
||||
-- You can also add relative line numbers, to help with jumping.
|
||||
-- Experiment for yourself to see if you like it!
|
||||
-- vim.opt.relativenumber = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
-- Enable mouse mode, can be useful for resizing splits for example!
|
||||
vim.opt.mouse = 'a'
|
||||
|
@ -209,10 +209,7 @@ vim.api.nvim_create_autocmd('TextYankPost', {
|
|||
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
||||
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
|
||||
if vim.v.shell_error ~= 0 then
|
||||
error('Error cloning lazy.nvim:\n' .. out)
|
||||
end
|
||||
vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
|
||||
end ---@diagnostic disable-next-line: undefined-field
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
|
@ -230,7 +227,7 @@ vim.opt.rtp:prepend(lazypath)
|
|||
require('lazy').setup({
|
||||
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
|
||||
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
||||
|
||||
'github/copilot.vim',
|
||||
-- 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.
|
||||
|
@ -283,15 +280,19 @@ require('lazy').setup({
|
|||
require('which-key').setup()
|
||||
|
||||
-- Document existing key chains
|
||||
require('which-key').add {
|
||||
{ '<leader>c', group = '[C]ode' },
|
||||
{ '<leader>d', group = '[D]ocument' },
|
||||
{ '<leader>r', group = '[R]ename' },
|
||||
{ '<leader>s', group = '[S]earch' },
|
||||
{ '<leader>w', group = '[W]orkspace' },
|
||||
{ '<leader>t', group = '[T]oggle' },
|
||||
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
|
||||
require('which-key').register {
|
||||
['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
|
||||
['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' },
|
||||
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
|
||||
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
|
||||
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
|
||||
['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' },
|
||||
['<leader>h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' },
|
||||
}
|
||||
-- visual mode
|
||||
require('which-key').register({
|
||||
['<leader>h'] = { 'Git [H]unk' },
|
||||
}, { mode = 'v' })
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -564,10 +565,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 = {},
|
||||
clangd = {},
|
||||
-- gopls = {},
|
||||
-- pyright = {},
|
||||
-- rust_analyzer = {},
|
||||
ruff = {},
|
||||
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:
|
||||
|
@ -651,9 +652,8 @@ require('lazy').setup({
|
|||
end,
|
||||
formatters_by_ft = {
|
||||
lua = { 'stylua' },
|
||||
json = { 'jq' },
|
||||
-- Conform can also run multiple formatters sequentially
|
||||
-- python = { "isort", "black" },
|
||||
--
|
||||
-- You can use a sub-list to tell conform to run *until* a formatter
|
||||
-- is found.
|
||||
-- javascript = { { "prettierd", "prettier" } },
|
||||
|
@ -777,15 +777,33 @@ require('lazy').setup({
|
|||
-- change the command in the config to whatever the name of that colorscheme is.
|
||||
--
|
||||
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
|
||||
'folke/tokyonight.nvim',
|
||||
'rebelot/kanagawa.nvim',
|
||||
lazy = false,
|
||||
priority = 1000, -- Make sure to load this before all the other start plugins.
|
||||
init = function()
|
||||
-- Load the colorscheme here.
|
||||
-- Like many other themes, this one has different styles, and you could load
|
||||
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
|
||||
vim.cmd.colorscheme 'tokyonight-night'
|
||||
|
||||
-- You can configure highlights by doing something like:
|
||||
config = function()
|
||||
-- Default options:
|
||||
require('kanagawa').setup {
|
||||
compile = false, -- enable compiling the colorscheme
|
||||
undercurl = true, -- enable undercurls
|
||||
commentStyle = { italic = true },
|
||||
functionStyle = {},
|
||||
keywordStyle = { italic = true },
|
||||
statementStyle = { bold = true },
|
||||
typeStyle = {},
|
||||
transparent = false, -- do not set background color
|
||||
dimInactive = false, -- dim inactive window `:h hl-NormalNC`
|
||||
terminalColors = true, -- define vim.g.terminal_color_{0,17}
|
||||
colors = { -- add/modify theme and palette colors
|
||||
palette = {},
|
||||
theme = { wave = {}, lotus = {}, dragon = {}, all = {} },
|
||||
},
|
||||
background = { -- map the value of 'background' option to a theme
|
||||
dark = 'wave', -- try "dragon" !
|
||||
light = 'wave',
|
||||
},
|
||||
}
|
||||
-- setup must be called before loading
|
||||
vim.cmd 'colorscheme kanagawa-wave'
|
||||
vim.cmd.hi 'Comment gui=none'
|
||||
end,
|
||||
},
|
||||
|
@ -834,7 +852,7 @@ require('lazy').setup({
|
|||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
opts = {
|
||||
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
|
||||
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc', 'python', 'rust', 'zig' },
|
||||
-- Autoinstall languages that are not installed
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
|
@ -862,6 +880,33 @@ require('lazy').setup({
|
|||
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
||||
end,
|
||||
},
|
||||
{
|
||||
'cameron-wags/rainbow_csv.nvim',
|
||||
config = true,
|
||||
ft = {
|
||||
'csv',
|
||||
'tsv',
|
||||
'csv_semicolon',
|
||||
'csv_whitespace',
|
||||
'csv_pipe',
|
||||
'rfc_csv',
|
||||
'rfc_semicolon',
|
||||
},
|
||||
cmd = {
|
||||
'RainbowDelim',
|
||||
'RainbowDelimSimple',
|
||||
'RainbowDelimQuoted',
|
||||
'RainbowMultiDelim',
|
||||
},
|
||||
},
|
||||
{
|
||||
'iamcco/markdown-preview.nvim',
|
||||
cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' },
|
||||
ft = { 'markdown' },
|
||||
build = function()
|
||||
vim.fn['mkdp#util#install']()
|
||||
end,
|
||||
},
|
||||
|
||||
-- The following two 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
|
||||
|
|
Loading…
Reference in New Issue