Update UI

This commit is contained in:
Ryan 2023-11-11 11:45:14 +08:00
parent 33f5805bee
commit 284511be86
Signed by: juan
GPG Key ID: 807ECD28A698D245
8 changed files with 44 additions and 88 deletions

View File

@ -18,6 +18,7 @@ local opts = {
} }
local plugins = { local plugins = {
-- main UI
{ {
"ellisonleao/gruvbox.nvim", "ellisonleao/gruvbox.nvim",
lazy = false, lazy = false,
@ -33,23 +34,22 @@ local plugins = {
require("plugins.statusline") require("plugins.statusline")
end end
}, },
-- TS, LSP, Completion
{ {
"williamboman/mason.nvim" "williamboman/mason.nvim"
}, },
{ {
"nvim-treesitter/nvim-treesitter-context",
dependencies = {
"nvim-treesitter/nvim-treesitter"
},
},
{
"HiPhish/nvim-ts-rainbow2",
dependencies = {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
config = function() config = function()
require("plugins.treesitter") require("plugins.treesitter")
end end
}, },
{
"nvim-treesitter/nvim-treesitter-context",
dependencies = {
"nvim-treesitter/nvim-treesitter",
},
}, },
{ {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
@ -110,15 +110,23 @@ local plugins = {
"jose-elias-alvarez/null-ls.nvim" "jose-elias-alvarez/null-ls.nvim"
} }
}, },
-- Code editing
{
"machakann/vim-sandwich", "machakann/vim-sandwich",
keys = "s"
},
{ {
"numToStr/Comment.nvim", "numToStr/Comment.nvim",
event = "BufEnter", keys = "g",
config = function() config = function()
require("Comment").setup() require("Comment").setup()
end end
}, },
{
"andymass/vim-matchup", "andymass/vim-matchup",
event = "BufEnter"
},
{ {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
dependencies = { 'nvim-lua/plenary.nvim' }, dependencies = { 'nvim-lua/plenary.nvim' },
@ -126,13 +134,26 @@ local plugins = {
require("plugins.telescope") require("plugins.telescope")
end end
}, },
{
"preservim/tagbar", -- Eye candy UI
cmd = "TagbarToggle"
},
{ {
"winston0410/range-highlight.nvim", "winston0410/range-highlight.nvim",
event = "CmdlineEnter" event = "CmdlineEnter"
},
{
'simrat39/symbols-outline.nvim',
cmd = { 'SymbolsOutline', 'SymbolsOutlineOpen' },
opts = { autofold_depth = 12 }
},
{
'stevearc/dressing.nvim'
},
{
"lewis6991/gitsigns.nvim",
event = "BufEnter",
config = function()
require('gitsigns').setup()
end
} }
} }

View File

@ -35,18 +35,9 @@ map('i', ',', ',<c-g>u', { noremap = true })
map('i', '.', '.<c-g>u', { noremap = true }) map('i', '.', '.<c-g>u', { noremap = true })
map('i', '!', '!<c-g>u', { noremap = true }) map('i', '!', '!<c-g>u', { noremap = true })
map('i', '?', '?<c-g>u', { noremap = true }) map('i', '?', '?<c-g>u', { noremap = true })
-- plugin mappings -- plugin mappings
-- gitsigns -- symbols outline
map('', '<leader>gs', ':Gitsigns toggle_signs<cr>', { silent = true }) map('n', '<leader>o', ':SymbolsOutline<cr>', { silent = true })
-- toggle tagbar -- telescope
map('', '<leader>tt', ':TagbarToggle<cr>', { silent = true })
-- toggle Hop
map('', '<leader>b', ':HopWordBC<cr>', { silent = true })
map('', '<leader>w', ':HopWordAC<cr>', { silent = true })
map('', '<leader>l', ':HopWordCurrentLine<cr>', { silent = true })
-- telescope stuff
map('', '<leader>fd', ':Telescope fd<cr>', { silent = true }) map('', '<leader>fd', ':Telescope fd<cr>', { silent = true })
map('', '<leader>tb', ':Telescope buffers<cr>', { silent = true }) map('', '<leader>bf', ':Telescope buffers<cr>', { silent = true })

View File

@ -1 +0,0 @@
vim.g.emmet_html5 = 1

View File

@ -1,33 +0,0 @@
require('gitsigns').setup {
-- signs
status_formatter = nil, -- Use default
numhl = false,
sign_priority = 10,
attach_to_untracked = false, -- fix gitsigns with yadm in ~
signs = {
add = {hl = "DiffAdd", text = "+", numhl = "GitSignsAddNr"},
change = {hl = "DiffChange", text = ">", numhl = "GitSignsChangeNr"},
changedelete = {
hl = "DiffChange",
text = "~",
numhl = "GitSignsChangeNr"
},
delete = {hl = "DiffDelete", text = "_", numhl = "GitSignsDeleteNr"},
topdelete = {
hl = "DiffDelete",
text = "",
numhl = "GitSignsDeleteNr"
}
},
-- yadm = {enable = true},
-- Current line blame
current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
delay = 250,
ignore_whitespace = false
},
current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>'
}

View File

@ -1,9 +0,0 @@
require("indent_blankline").setup {
buftype_exclude = {"terminal", "help", "packer", "NvimTree", "tagbar"},
char = "", -- also set as global env
space_char_blankline = ' ',
max_indent_increase = 2,
show_first_indent_level = false,
show_trailing_blankline_indent = false,
use_treesitter = true
}

View File

@ -30,7 +30,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts) vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts) vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
vim.keymap.set('n', '<space>f', function() vim.keymap.set('n', '<space>fm', function()
vim.lsp.buf.format { async = true } vim.lsp.buf.format { async = true }
end, opts) end, opts)
end, end,

View File

@ -0,0 +1 @@
require("symbols-outline").setup(opts)

View File

@ -1,4 +1,3 @@
local rainbow = require("ts-rainbow")
require("nvim-treesitter.configs").setup({ require("nvim-treesitter.configs").setup({
ensure_installed = { "lua" }, -- one of "all", "maintained" (parsers with maintainers), or a list of languages ensure_installed = { "lua" }, -- one of "all", "maintained" (parsers with maintainers), or a list of languages
highlight = { highlight = {
@ -11,17 +10,4 @@ require("nvim-treesitter.configs").setup({
use_languagetree = true, use_languagetree = true,
}, },
indent = { enable = true }, indent = { enable = true },
rainbow = {
enable = true,
strategy = rainbow.strategy['local'],
hlgroups = {
"TSRainbowYellow",
"TSRainbowBlue",
"TSRainbowOrange",
"TSRainbowGreen",
"TSRainbowViolet",
"TSRainbowCyan",
"TSRainbowRed",
},
},
}) })