feat(nvim): configure new statuscolumn
This commit is contained in:
@@ -33,6 +33,20 @@ autocmd("BufWinEnter", {
|
||||
group = save_fold,
|
||||
})
|
||||
|
||||
autocmd({ "BufWinEnter","BufAdd" }, {
|
||||
desc = 'hide statuscolumn in nvimtree',
|
||||
group = vim.api.nvim_create_augroup('hide_nvimtree_stc', { clear = true }),
|
||||
callback = function(opts)
|
||||
if vim.bo[opts.buf].filetype == 'NvimTree' then
|
||||
vim.o.statuscolumn = ''
|
||||
else
|
||||
vim.o.statuscolumn = '%=%r%s%#FoldColumn#%{foldlevel(v:lnum) > foldlevel(v:lnum - 1) ? (foldclosed(v:lnum) == -1 ? "" : "") : " " } %*'
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.cmd [[au BufWinEnter NvimTree setlocal statuscolumn=""]]
|
||||
|
||||
vim.cmd([[
|
||||
augroup filetypedetect
|
||||
au BufNewFile,BufRead *.frag setl ft=glsl
|
||||
@@ -41,12 +55,6 @@ augroup filetypedetect
|
||||
augroup END
|
||||
]])
|
||||
|
||||
-- autocmd({ "BufReadPost" }, {
|
||||
-- pattern = "*",
|
||||
-- group = config_group,
|
||||
-- command = "filetype detect",
|
||||
-- })
|
||||
|
||||
autocmd("BufReadPost", {
|
||||
callback = function()
|
||||
local mark = vim.api.nvim_buf_get_mark(0, '"')
|
||||
|
@@ -2,8 +2,6 @@
|
||||
local map = vim.keymap.set
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
local saga = require("lspsaga")
|
||||
saga.init_lsp_saga()
|
||||
|
||||
-- Set Leader key
|
||||
vim.g.mapleader = " "
|
||||
@@ -28,11 +26,13 @@ map("n", "<Leader>a", ":Alpha<CR>", opts);
|
||||
map("n", "<Leader>n", ":lua vim.diagnostic.goto_next()<CR>", opts)
|
||||
map("n", "<Leader>p", ":lua vim.diagnostic.goto_prev()<CR>", opts)
|
||||
map("n", "<Leader>e", ":lua vim.diagnostic.open_float()<CR>", opts)
|
||||
map("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
map("n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
map("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
map("n", "gD", ":lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
map("n", "gd", ":lua vim.lsp.buf.definition()<CR>", opts)
|
||||
map("n", "gi", ":lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
map("n", "K", ":lua vim.lsp.buf.hover()<CR>", opts)
|
||||
|
||||
map("n", "K", "<cmd>Lspsaga hover_doc<CR>", { silent = true })
|
||||
map("n", "<Leader>ii", ":Lspsaga incomming_calls<CR>", opts)
|
||||
map("n", "<Leader>io", ":Lspsaga outgoing_calls<CR>", opts)
|
||||
map("n", "<Leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
|
||||
map({ "n", "v" }, "<Leader>c", "<cmd>Lspsaga code_action<CR>", { silent = true })
|
||||
map({ "n", "v" }, "gr", "<cmd>Lspsaga lsp_finder<CR>", opts)
|
||||
|
@@ -22,11 +22,10 @@ local plugins = {
|
||||
--------------------
|
||||
-- Layout Plugins --
|
||||
--------------------
|
||||
{ 'akinsho/bufferline.nvim', lazy = false, config = true },
|
||||
{ "shortcuts/no-neck-pain.nvim", cmd = "NoNeckPain", config = true },
|
||||
{
|
||||
"stevearc/dressing.nvim",
|
||||
lazy = false,
|
||||
event = "VeryLazy",
|
||||
config = true
|
||||
},
|
||||
{
|
||||
@@ -41,7 +40,7 @@ local plugins = {
|
||||
cmd = "SymbolsOutline",
|
||||
config = true,
|
||||
},
|
||||
{ "mbbill/undotree", lazy = false },
|
||||
{ "mbbill/undotree", event = "VeryLazy" },
|
||||
{
|
||||
"petertriho/nvim-scrollbar",
|
||||
config = function()
|
||||
@@ -80,9 +79,6 @@ local plugins = {
|
||||
vim.o.foldlevel = 99
|
||||
vim.o.foldlevelstart = 99
|
||||
vim.o.foldenable = true
|
||||
-- vim.o.statuscolumn = "%=%l%s%C"
|
||||
vim.o.statuscolumn = '%=%l%s%{foldlevel(v:lnum) > foldlevel(v:lnum - 1) ? (foldclosed(v:lnum) == -1 ? "" : "") : " " }'
|
||||
-- vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
|
||||
end,
|
||||
},
|
||||
{
|
||||
@@ -131,13 +127,18 @@ local plugins = {
|
||||
-- Lsp Setup --
|
||||
---------------
|
||||
{
|
||||
"glepnir/lspsaga.nvim",
|
||||
'glepnir/lspsaga.nvim',
|
||||
event = 'BufRead',
|
||||
config = function()
|
||||
require('lspsaga').setup({})
|
||||
require('lspsaga').setup({
|
||||
symbol_in_winbar = {
|
||||
enable = false,
|
||||
},
|
||||
})
|
||||
end
|
||||
},
|
||||
{ "neovim/nvim-lspconfig",
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"arkav/lualine-lsp-progress",
|
||||
"williamboman/mason.nvim",
|
||||
@@ -149,7 +150,8 @@ local plugins = {
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("max.configs.lsp")
|
||||
end },
|
||||
end
|
||||
},
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
cmd = "TroubleToggle",
|
||||
@@ -201,7 +203,7 @@ local plugins = {
|
||||
-------------------------
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = "BufReadPost",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
"JoosepAlviste/nvim-ts-context-commentstring"
|
||||
@@ -211,6 +213,11 @@ local plugins = {
|
||||
end,
|
||||
run = ":TSUpdate",
|
||||
},
|
||||
{
|
||||
'ckolkey/ts-node-action',
|
||||
dependencies = { 'nvim-treesitter' },
|
||||
opts = {},
|
||||
},
|
||||
--------------------
|
||||
-- IDE Type Stuff --
|
||||
--------------------
|
||||
|
Reference in New Issue
Block a user