Set bufferline

This commit is contained in:
DefectingCat
2022-08-25 09:54:09 +08:00
parent 6db214cc4e
commit 8dd929d8d5
21 changed files with 365 additions and 428 deletions

View File

@ -1,9 +1,7 @@
local status, autopairs = pcall(require, "nvim-autopairs")
if (not status) then
return
end
if (not status) then return end
autopairs.setup({
disable_filetype = {"TelescopePrompt", "vim"}
disable_filetype = { "TelescopePrompt" , "vim" },
})

View File

@ -1,37 +1,15 @@
local status, bufferline = pcall(require, "bufferline")
if (not status) then
return
end
if (not status) then return end
bufferline.setup({
options = {
mode = "tabs",
separator_style = 'slant',
always_show_bufferline = false,
show_buffer_close_icons = false,
show_close_icon = false,
color_icons = true
},
highlights = {
separator = {
fg = '#073642',
bg = '#002b36'
},
separator_selected = {
fg = '#073642'
},
background = {
fg = '#657b83',
bg = '#002b36'
},
buffer_selected = {
fg = '#fdf6e3',
bold = true
},
fill = {
bg = '#073642'
}
}
options = {
mode = "buffers",
separator_style = 'slant',
always_show_bufferline = true,
show_buffer_close_icons = false,
show_close_icon = false,
color_icons = true
},
})
vim.keymap.set('n', '<Tab>', '<Cmd>BufferLineCycleNext<CR>', {})

View File

@ -1,36 +1,30 @@
local status, cmp = pcall(require, "cmp")
if (not status) then
return
end
if (not status) then return end
local lspkind = require 'lspkind'
cmp.setup({
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end
},
mapping = cmp.mapping.preset.insert({
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = true
})
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = true
}),
sources = cmp.config.sources({{
name = 'nvim_lsp'
}, {
name = 'buffer'
}}),
formatting = {
format = lspkind.cmp_format({
with_text = false,
maxwidth = 50
})
}
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'buffer' },
}),
formatting = {
format = lspkind.cmp_format({ with_text = false, maxwidth = 50 })
}
})
vim.cmd [[

View File

@ -1,6 +1,6 @@
local status, colorizer = pcall(require, "colorizer")
if (not status) then
return
end
if (not status) then return end
colorizer.setup({'*'})
colorizer.setup({
'*';
})

View File

@ -1,13 +1,11 @@
local status, git = pcall(require, "git")
if (not status) then
return
end
if (not status) then return end
git.setup({
keymaps = {
-- Open blame window
blame = "<Leader>gb",
-- Open file/folder in git repository
browse = "<Leader>go"
}
keymaps = {
-- Open blame window
blame = "<Leader>gb",
-- Open file/folder in git repository
browse = "<Leader>go",
}
})

View File

@ -1,11 +1,9 @@
local status, colors = pcall(require, "lsp-colors")
if (not status) then
return
end
if (not status) then return end
colors.setup {
Error = "#db4b4b",
Warning = "#e0af68",
Information = "#0db9d7",
Hint = "#10B981"
Error = "#db4b4b",
Warning = "#e0af68",
Information = "#0db9d7",
Hint = "#10B981"
}

View File

@ -1,49 +1,47 @@
local status, lspkind = pcall(require, "lspkind")
if (not status) then
return
end
if (not status) then return end
lspkind.init({
-- enables text annotations
--
-- default: true
mode = 'symbol',
-- enables text annotations
--
-- default: true
mode = 'symbol',
-- default symbol map
-- can be either 'default' (requires nerd-fonts font) or
-- 'codicons' for codicon preset (requires vscode-codicons font)
--
-- default: 'default'
preset = 'codicons',
-- default symbol map
-- can be either 'default' (requires nerd-fonts font) or
-- 'codicons' for codicon preset (requires vscode-codicons font)
--
-- default: 'default'
preset = 'codicons',
-- override preset symbols
--
-- default: {}
symbol_map = {
Text = "",
Method = "",
Function = "",
Constructor = "",
Field = "",
Variable = "",
Class = "",
Interface = "",
Module = "",
Property = "",
Unit = "",
Value = "",
Enum = "",
Keyword = "",
Snippet = "",
Color = "",
File = "",
Reference = "",
Folder = "",
EnumMember = "",
Constant = "",
Struct = "",
Event = "",
Operator = "",
TypeParameter = ""
}
-- override preset symbols
--
-- default: {}
symbol_map = {
Text = "",
Method = "",
Function = "",
Constructor = "",
Field = "",
Variable = "",
Class = "",
Interface = "",
Module = "",
Property = "",
Unit = "",
Value = "",
Enum = "",
Keyword = "",
Snippet = "",
Color = "",
File = "",
Reference = "",
Folder = "",
EnumMember = "",
Constant = "",
Struct = "",
Event = "",
Operator = "",
TypeParameter = ""
},
})

View File

@ -1,56 +1,44 @@
local status, lualine = pcall(require, "lualine")
if (not status) then
return
end
if (not status) then return end
lualine.setup {
options = {
icons_enabled = true,
theme = 'dracula-nvim',
section_separators = {
left = '',
right = ''
},
component_separators = {
left = '',
right = ''
},
disabled_filetypes = {}
options = {
icons_enabled = true,
theme = 'dracula-nvim',
section_separators = { left = '', right = '' },
component_separators = { left = '', right = '' },
disabled_filetypes = {}
},
sections = {
lualine_a = { 'mode' },
lualine_b = { 'branch' },
lualine_c = { {
'filename',
file_status = true, -- displays file status (readonly status, modified status)
path = 0 -- 0 = just filename, 1 = relative path, 2 = absolute path
} },
lualine_x = {
{ 'diagnostics', sources = { "nvim_diagnostic" }, symbols = { error = '', warn = '', info = '',
hint = '' } },
'encoding',
'filetype'
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch'},
lualine_c = {{
'filename',
file_status = true, -- displays file status (readonly status, modified status)
path = 0 -- 0 = just filename, 1 = relative path, 2 = absolute path
}},
lualine_x = {{
'diagnostics',
sources = {"nvim_diagnostic"},
symbols = {
error = '',
warn = '',
info = '',
hint = ''
}
}, 'encoding', 'filetype'},
lualine_y = {'progress'},
lualine_z = {'location'}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {{
'filename',
file_status = true, -- displays file status (readonly status, modified status)
path = 1 -- 0 = just filename, 1 = relative path, 2 = absolute path
}},
lualine_x = {'location'},
lualine_y = {},
lualine_z = {}
},
tabline = {},
extensions = {'fugitive'}
lualine_y = { 'progress' },
lualine_z = { 'location' }
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { {
'filename',
file_status = true, -- displays file status (readonly status, modified status)
path = 1 -- 0 = just filename, 1 = relative path, 2 = absolute path
} },
lualine_x = { 'location' },
lualine_y = {},
lualine_z = {}
},
tabline = {},
extensions = { 'fugitive' }
}

View File

@ -1,14 +1,12 @@
local status, mason = pcall(require, "mason")
if (not status) then
return
end
if (not status) then return end
local status2, lspconfig = pcall(require, "mason-lspconfig")
if (not status2) then
return
end
if (not status2) then return end
mason.setup({})
mason.setup({
})
lspconfig.setup {
ensure_installed = {"sumneko_lua", "tailwindcss"}
ensure_installed = { "sumneko_lua", "tailwindcss" },
}

View File

@ -1,9 +1,16 @@
local status, prettier = pcall(require, "prettier")
if (not status) then
return
end
if (not status) then return end
prettier.setup {
bin = 'prettierd',
filetypes = {"css", "javascript", "javascriptreact", "typescript", "typescriptreact", "json", "scss", "less"}
bin = 'prettierd',
filetypes = {
"css",
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"json",
"scss",
"less"
}
}

View File

@ -1,83 +1,78 @@
local status, telescope = pcall(require, "telescope")
if (not status) then
return
end
if (not status) then return end
local actions = require('telescope.actions')
local builtin = require("telescope.builtin")
local function telescope_buffer_dir()
return vim.fn.expand('%:p:h')
return vim.fn.expand('%:p:h')
end
local fb_actions = require"telescope".extensions.file_browser.actions
local fb_actions = require "telescope".extensions.file_browser.actions
telescope.setup {
defaults = {
mappings = {
n = {
["q"] = actions.close
}
}
defaults = {
mappings = {
n = {
["q"] = actions.close
},
},
extensions = {
file_browser = {
theme = "dropdown",
-- disables netrw and use telescope-file-browser in its place
hijack_netrw = true,
mappings = {
-- your custom insert mode mappings
["i"] = {
["<C-w>"] = function()
vim.cmd('normal vbd')
end
},
["n"] = {
-- your custom normal mode mappings
["N"] = fb_actions.create,
["h"] = fb_actions.goto_parent_dir,
["/"] = function()
vim.cmd('startinsert')
end
}
}
}
}
},
extensions = {
file_browser = {
theme = "dropdown",
-- disables netrw and use telescope-file-browser in its place
hijack_netrw = true,
mappings = {
-- your custom insert mode mappings
["i"] = {
["<C-w>"] = function() vim.cmd('normal vbd') end,
},
["n"] = {
-- your custom normal mode mappings
["N"] = fb_actions.create,
["h"] = fb_actions.goto_parent_dir,
["/"] = function()
vim.cmd('startinsert')
end
},
},
},
},
}
telescope.load_extension("file_browser")
vim.keymap.set('n', ';f', function()
vim.keymap.set('n', ';f',
function()
builtin.find_files({
no_ignore = false,
hidden = true
no_ignore = false,
hidden = true
})
end)
end)
vim.keymap.set('n', ';r', function()
builtin.live_grep()
builtin.live_grep()
end)
vim.keymap.set('n', '\\\\', function()
builtin.buffers()
builtin.buffers()
end)
vim.keymap.set('n', ';t', function()
builtin.help_tags()
builtin.help_tags()
end)
vim.keymap.set('n', ';;', function()
builtin.resume()
builtin.resume()
end)
vim.keymap.set('n', ';e', function()
builtin.diagnostics()
builtin.diagnostics()
end)
vim.keymap.set("n", "sf", function()
telescope.extensions.file_browser.file_browser({
path = "%:p:h",
cwd = telescope_buffer_dir(),
respect_gitignore = false,
hidden = true,
grouped = true,
previewer = false,
initial_mode = "normal",
layout_config = {
height = 40
}
})
telescope.extensions.file_browser.file_browser({
path = "%:p:h",
cwd = telescope_buffer_dir(),
respect_gitignore = false,
hidden = true,
grouped = true,
previewer = false,
initial_mode = "normal",
layout_config = { height = 40 }
})
end)

View File

@ -1,22 +1,30 @@
local status, ts = pcall(require, "nvim-treesitter.configs")
if (not status) then
return
end
if (not status) then return end
ts.setup {
highlight = {
enable = true,
disable = {}
},
indent = {
enable = true,
disable = {}
},
ensure_installed = {"tsx", "toml", "json", "yaml", "css", "html", "lua", "go", "rust"},
autotag = {
enable = true
}
highlight = {
enable = true,
disable = {},
},
indent = {
enable = true,
disable = {},
},
ensure_installed = {
"tsx",
"toml",
"json",
"yaml",
"css",
"html",
"lua",
"go",
"rust"
},
autotag = {
enable = true,
},
}
local parser_config = require"nvim-treesitter.parsers".get_parser_configs()
parser_config.tsx.filetype_to_parsername = {"javascript", "typescript.tsx"}
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.tsx.filetype_to_parsername = { "javascript", "typescript.tsx" }

View File

@ -1,6 +1,4 @@
local status, autotag = pcall(require, "nvim-ts-autotag")
if (not status) then
return
end
if (not status) then return end
autotag.setup({})

View File

@ -1,13 +1,12 @@
local status, icons = pcall(require, "nvim-web-devicons")
if (not status) then
return
end
if (not status) then return end
icons.setup {
-- your personnal icons can go here (to override)
-- DevIcon will be appended to `name`
override = {},
-- globally enable default icons (default to false)
-- will get overriden by `get_icons` option
default = true
-- your personnal icons can go here (to override)
-- DevIcon will be appended to `name`
override = {
},
-- globally enable default icons (default to false)
-- will get overriden by `get_icons` option
default = true
}

View File

@ -1,10 +1,7 @@
local status, zenMode = pcall(require, "zen-mode")
if (not status) then
return
end
if (not status) then return end
zenMode.setup {}
zenMode.setup {
}
vim.keymap.set('n', '<C-w>o', '<cmd>ZenMode<cr>', {
silent = true
})
vim.keymap.set('n', '<C-w>o', '<cmd>ZenMode<cr>', { silent = true })

View File

@ -16,8 +16,8 @@ vim.opt.cmdheight = 1
vim.opt.laststatus = 2
vim.opt.expandtab = true
vim.opt.scrolloff = 10
vim.opt.shell = '/usr/bin/zsh'
vim.opt.backupskip = {'/tmp/*', '/private/tmp/*'}
vim.opt.shell = 'zsh'
vim.opt.backupskip = { '/tmp/*', '/private/tmp/*' }
vim.opt.inccommand = 'split'
vim.opt.ignorecase = true -- Case insensitive searching UNLESS /C or capital in search
vim.opt.smarttab = true
@ -25,10 +25,10 @@ vim.opt.breakindent = true
vim.opt.shiftwidth = 2
vim.opt.tabstop = 2
vim.opt.wrap = false -- No Wrap lines
vim.opt.backspace = {'start', 'eol', 'indent'}
vim.opt.path:append{'**'} -- Finding files - Search down into subfolders
vim.opt.wildignore:append{'*/node_modules/*'}
vim.opt.clipboard:append{'unnamedplus'}
vim.opt.backspace = { 'start', 'eol', 'indent' }
vim.opt.path:append { '**' } -- Finding files - Search down into subfolders
vim.opt.wildignore:append { '*/node_modules/*' }
vim.opt.clipboard:append { 'unnamedplus' }
-- Undercurl
vim.cmd([[let &t_Cs = "\e[4:3m"]])
@ -36,12 +36,12 @@ vim.cmd([[let &t_Ce = "\e[4:0m"]])
-- Turn off paste mode when leaving insert
vim.api.nvim_create_autocmd("InsertLeave", {
pattern = '*',
command = "set nopaste"
pattern = '*',
command = "set nopaste"
})
-- Add asterisks in block comments
vim.opt.formatoptions:append{'r'}
vim.opt.formatoptions:append { 'r' }
-- Use color theme
vim.cmd [[colorscheme dracula]]
vim.cmd[[colorscheme dracula]]

View File

@ -1 +1 @@
vim.opt.clipboard:append{'unnamedplus'}
vim.opt.clipboard:append { 'unnamedplus' }

View File

@ -13,7 +13,7 @@ keymap.set('n', 'dw', 'vb"_d')
keymap.set('n', '<C-a>', 'gg<S-v>G')
-- Save with root permission (not working for now)
-- vim.api.nvim_create_user_command('W', 'w !sudo tee > /dev/null %', {})
--vim.api.nvim_create_user_command('W', 'w !sudo tee > /dev/null %', {})
-- New tab
keymap.set('n', 'te', ':tabedit')

View File

@ -1,52 +1,50 @@
local status, packer = pcall(require, "packer")
if (not status) then
print("Packer is not installed")
return
print("Packer is not installed")
return
end
vim.cmd [[packadd packer.nvim]]
packer.startup(function(use)
use 'wbthomason/packer.nvim'
use 'wbthomason/packer.nvim'
use 'Mofiqul/dracula.nvim' -- Color scheme
use 'nvim-lualine/lualine.nvim' -- Statusline
use 'nvim-lua/plenary.nvim' -- Common utilities
use 'Mofiqul/dracula.nvim' -- Color scheme
use 'nvim-lualine/lualine.nvim' -- Statusline
use 'nvim-lua/plenary.nvim' -- Common utilities
use 'onsails/lspkind-nvim' -- vscode-like pictograms
use 'hrsh7th/cmp-buffer' -- nvim-cmp source for buffer words
use 'hrsh7th/cmp-nvim-lsp' -- nvim-cmp source for neovim's built-in LSP
use 'hrsh7th/nvim-cmp' -- Completion
use 'neovim/nvim-lspconfig' -- LSP
use 'jose-elias-alvarez/null-ls.nvim' -- Use Neovim as a language server to inject LSP diagnos
use 'MunifTanjim/prettier.nvim' -- Prettier plugin for Neovim's built-in LSP client
use 'onsails/lspkind-nvim' -- vscode-like pictograms
use 'hrsh7th/cmp-buffer' -- nvim-cmp source for buffer words
use 'hrsh7th/cmp-nvim-lsp' -- nvim-cmp source for neovim's built-in LSP
use 'hrsh7th/nvim-cmp' -- Completion
use 'neovim/nvim-lspconfig' -- LSP
use 'jose-elias-alvarez/null-ls.nvim' -- Use Neovim as a language server to inject LSP diagnos
use 'MunifTanjim/prettier.nvim' -- Prettier plugin for Neovim's built-in LSP client
use 'williamboman/mason.nvim'
use 'williamboman/mason-lspconfig.nvim'
use 'williamboman/mason.nvim'
use 'williamboman/mason-lspconfig.nvim'
use 'glepnir/lspsaga.nvim' -- LSP UIs
use 'L3MON4D3/LuaSnip'
use {
'nvim-treesitter/nvim-treesitter',
run = ':TSUpdate'
}
use 'glepnir/lspsaga.nvim' -- LSP UIs
use 'L3MON4D3/LuaSnip'
use {
'nvim-treesitter/nvim-treesitter',
run = ':TSUpdate'
}
use 'kyazdani41/nvim-web-devicons' -- File icons
use 'nvim-telescope/telescope.nvim'
use 'nvim-telescope/telescope-file-browser.nvim'
use 'windwp/nvim-autopairs'
use 'windwp/nvim-ts-autotag'
use 'norcalli/nvim-colorizer.lua'
use 'folke/zen-mode.nvim'
use({
"iamcco/markdown-preview.nvim",
run = function()
vim.fn["mkdp#util#install"]()
end
})
use 'akinsho/nvim-bufferline.lua'
-- use 'github/copilot.vim'
use 'kyazdani41/nvim-web-devicons' -- File icons
use 'nvim-telescope/telescope.nvim'
use 'nvim-telescope/telescope-file-browser.nvim'
use 'windwp/nvim-autopairs'
use 'windwp/nvim-ts-autotag'
use 'norcalli/nvim-colorizer.lua'
use 'folke/zen-mode.nvim'
use({
"iamcco/markdown-preview.nvim",
run = function() vim.fn["mkdp#util#install"]() end,
})
use 'akinsho/nvim-bufferline.lua'
-- use 'github/copilot.vim'
use 'lewis6991/gitsigns.nvim'
use 'dinhhuy258/git.nvim' -- For git blame & browse
use 'lewis6991/gitsigns.nvim'
use 'dinhhuy258/git.nvim' -- For git blame & browse
end)

View File

@ -1 +1 @@
vim.opt.clipboard:prepend{'unnamed', 'unnamedplus'}
vim.opt.clipboard:prepend { 'unnamed', 'unnamedplus' }

View File

@ -1,136 +1,121 @@
-- vim.lsp.set_log_level("debug")
--vim.lsp.set_log_level("debug")
local status, nvim_lsp = pcall(require, "lspconfig")
if (not status) then
return
end
if (not status) then return end
local protocol = require('vim.lsp.protocol')
-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
local function buf_set_keymap(...)
vim.api.nvim_buf_set_keymap(bufnr, ...)
end
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
local function buf_set_option(...)
vim.api.nvim_buf_set_option(bufnr, ...)
end
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
-- Enable completion triggered by <c-x><c-o>
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
--Enable completion triggered by <c-x><c-o>
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
-- Mappings.
local opts = {
noremap = true,
silent = true
}
-- Mappings.
local opts = { noremap = true, silent = true }
-- See `:help vim.lsp.*` for documentation on any of the below functions
buf_set_keymap('n', 'gD', '<Cmd>lua vim.lsp.buf.declaration()<CR>', opts)
-- buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
-- buf_set_keymap('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
-- See `:help vim.lsp.*` for documentation on any of the below functions
buf_set_keymap('n', 'gD', '<Cmd>lua vim.lsp.buf.declaration()<CR>', opts)
--buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
--buf_set_keymap('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
end
protocol.CompletionItemKind = {'', -- Text
'', -- Method
'', -- Function
'', -- Constructor
'', -- Field
'', -- Variable
'', -- Class
'', -- Interface
'', -- Module
'', -- Property
'', -- Unit
'', -- Value
'', -- Enum
'', -- Keyword
'', -- Snippet
'', -- Color
'', -- File
'', -- Reference
'', -- Folder
'', -- EnumMember
'', -- Constant
'', -- Struct
'', -- Event
'', -- Operator
'' -- TypeParameter
protocol.CompletionItemKind = {
'', -- Text
'', -- Method
'', -- Function
'', -- Constructor
'', -- Field
'', -- Variable
'', -- Class
'', -- Interface
'', -- Module
'', -- Property
'', -- Unit
'', -- Value
'', -- Enum
'', -- Keyword
'', -- Snippet
'', -- Color
'', -- File
'', -- Reference
'', -- Folder
'', -- EnumMember
'', -- Constant
'', -- Struct
'', -- Event
'', -- Operator
'', -- TypeParameter
}
-- Set up completion using nvim_cmp with LSP source
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
local capabilities = require('cmp_nvim_lsp').update_capabilities(
vim.lsp.protocol.make_client_capabilities()
)
nvim_lsp.flow.setup {
on_attach = on_attach,
capabilities = capabilities
on_attach = on_attach,
capabilities = capabilities
}
nvim_lsp.tsserver.setup {
on_attach = on_attach,
filetypes = {"typescript", "typescriptreact", "typescript.tsx"},
cmd = {"typescript-language-server", "--stdio"},
capabilities = capabilities
on_attach = on_attach,
filetypes = { "typescript", "typescriptreact", "typescript.tsx" },
cmd = { "typescript-language-server", "--stdio" },
capabilities = capabilities
}
nvim_lsp.sourcekit.setup {
on_attach = on_attach
on_attach = on_attach,
}
nvim_lsp.sumneko_lua.setup {
on_attach = on_attach,
settings = {
Lua = {
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = {'vim'}
},
on_attach = on_attach,
settings = {
Lua = {
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { 'vim' },
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
checkThirdParty = false
}
}
}
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
checkThirdParty = false
},
},
},
}
nvim_lsp.tailwindcss.setup {}
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
underline = true,
update_in_insert = false,
virtual_text = {
spacing = 4,
prefix = ""
},
severity_sort = true
})
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
underline = true,
update_in_insert = false,
virtual_text = { spacing = 4, prefix = "" },
severity_sort = true,
}
)
-- Diagnostic symbols in the sign column (gutter)
local signs = {
Error = "",
Warn = "",
Hint = "",
Info = ""
}
local signs = { Error = "", Warn = "", Hint = "", Info = "" }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, {
text = icon,
texthl = hl,
numhl = ""
})
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
end
vim.diagnostic.config({
virtual_text = {
prefix = ''
},
update_in_insert = true,
float = {
source = "always" -- Or "if_many"
}
virtual_text = {
prefix = ''
},
update_in_insert = true,
float = {
source = "always", -- Or "if_many"
},
})