added borders to the hover and diagnostics; improved telescope visuals
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
local lspkind = require("lspkind")
|
local lspkind = require("lspkind")
|
||||||
|
local border = require('409.ui').border
|
||||||
|
|
||||||
local cmp_select = { behavior = cmp.SelectBehavior.Select }
|
local cmp_select = { behavior = cmp.SelectBehavior.Select }
|
||||||
local border = { "┌", "─", "┐", "│", "┘", "─", "└", "│" }
|
|
||||||
local winhighlight = "Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None"
|
local winhighlight = "Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None"
|
||||||
|
|
||||||
|
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ function Color(color)
|
|||||||
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
||||||
vim.api.nvim_set_hl(0, "NormalNC", { bg = "none" })
|
vim.api.nvim_set_hl(0, "NormalNC", { bg = "none" })
|
||||||
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
||||||
|
vim.api.nvim_set_hl(0, "FloatBorder", { fg = catppuccin_colors.surface2 })
|
||||||
vim.api.nvim_set_hl(0, "StatusLine", { bg = "none" })
|
vim.api.nvim_set_hl(0, "StatusLine", { bg = "none" })
|
||||||
-- If Vim thinks StatusLine and StatusLineNC are the same it overrides these settings
|
-- If Vim thinks StatusLine and StatusLineNC are the same it overrides these settings
|
||||||
vim.api.nvim_set_hl(0, "StatusLineNC", { ctermbg = 0, bg = "none" })
|
vim.api.nvim_set_hl(0, "StatusLineNC", { ctermbg = 0, bg = "none" })
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
local default_capabilities = require("cmp_nvim_lsp").default_capabilities()
|
local default_capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
local lsp_default_capabilities = vim.lsp.protocol.make_client_capabilities()
|
local lsp_default_capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
@@ -9,7 +11,7 @@ require("mason-lspconfig").setup({
|
|||||||
ensure_installed = { "tsserver", "rust_analyzer" },
|
ensure_installed = { "tsserver", "rust_analyzer" },
|
||||||
handlers = {
|
handlers = {
|
||||||
function(server_name)
|
function(server_name)
|
||||||
require("lspconfig")[server_name].setup({
|
lspconfig[server_name].setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
@@ -28,7 +30,7 @@ require("mason-lspconfig").setup({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
require("lspconfig").yamlls.setup({
|
lspconfig.yamlls.setup({
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
client.resolved_capabilities.document_formatting = true
|
client.resolved_capabilities.document_formatting = true
|
||||||
end,
|
end,
|
||||||
@@ -43,7 +45,7 @@ require("lspconfig").yamlls.setup({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
require("lspconfig").tsserver.setup({
|
lspconfig.tsserver.setup({
|
||||||
settings = {
|
settings = {
|
||||||
typescript = {
|
typescript = {
|
||||||
preferences = {
|
preferences = {
|
||||||
@@ -101,11 +103,16 @@ vim.diagnostic.config({
|
|||||||
virtual_text = true,
|
virtual_text = true,
|
||||||
update_in_insert = true,
|
update_in_insert = true,
|
||||||
float = {
|
float = {
|
||||||
focusable = false,
|
border = "single",
|
||||||
style = "minimal",
|
|
||||||
border = "rounded",
|
|
||||||
source = "always",
|
|
||||||
header = "",
|
|
||||||
prefix = "",
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
|
||||||
|
vim.lsp.handlers.hover, {
|
||||||
|
border = "single"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
require("lspconfig.ui.windows").default_options = {
|
||||||
|
border = "single",
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,18 +1,44 @@
|
|||||||
local builtin = require('telescope.builtin')
|
require("telescope").setup({
|
||||||
vim.keymap.set('n', '<leader>pf', builtin.find_files, {})
|
defaults = {
|
||||||
vim.keymap.set('n', '<C-p>', builtin.git_files, {})
|
layout_strategy = "horizontal",
|
||||||
vim.keymap.set('n', '<leader>pt', ':TodoTelescope<CR>')
|
layout_config = {
|
||||||
vim.keymap.set('n', '<leader>ps', function()
|
horizontal = {
|
||||||
local status, result = pcall(function() return vim.fn.input('Grep > ') end)
|
prompt_position = "bottom",
|
||||||
--
|
preview_width = 0.55,
|
||||||
-- prevent keyboard interrupt error
|
results_width = 0.8,
|
||||||
if not status then
|
},
|
||||||
return
|
vertical = {
|
||||||
end
|
mirror = false,
|
||||||
|
},
|
||||||
|
width = 0.87,
|
||||||
|
height = 0.80,
|
||||||
|
preview_cutoff = 120,
|
||||||
|
},
|
||||||
|
borderchars = require("409.ui").telescope_border,
|
||||||
|
prompt_prefix = " ",
|
||||||
|
color_devicons = true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
builtin.grep_string({ search = result });
|
local builtin = require("telescope.builtin")
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>pf", builtin.find_files, {})
|
||||||
|
vim.keymap.set("n", "<C-p>", builtin.git_files, {})
|
||||||
|
vim.keymap.set("n", "<leader>pt", ":TodoTelescope<CR>")
|
||||||
|
vim.keymap.set("n", "<leader>ps", function()
|
||||||
|
local status, result = pcall(function()
|
||||||
|
return vim.fn.input("Grep > ")
|
||||||
|
end)
|
||||||
|
--
|
||||||
|
-- prevent keyboard interrupt error
|
||||||
|
if not status then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
builtin.grep_string({ search = result })
|
||||||
end)
|
end)
|
||||||
|
vim.keymap.set("n", "<leader>pl", builtin.live_grep)
|
||||||
|
|
||||||
vim.keymap.set('n', '<C-b>', ':Telescope buffers<CR>');
|
vim.keymap.set("n", "<C-b>", ":Telescope buffers<CR>")
|
||||||
|
|
||||||
vim.api.nvim_set_hl(0, 'TelescopeSelection', { link = 'Visual' })
|
vim.api.nvim_set_hl(0, "TelescopeSelection", { link = "Visual" })
|
||||||
|
|||||||
6
lua/409/ui.lua
Normal file
6
lua/409/ui.lua
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.border = { "┌", "─", "┐", "│", "┘", "─", "└", "│" }
|
||||||
|
M.telescope_border = { "─", "│", "─", "│", "┌", "┐", "┘", "└" }
|
||||||
|
|
||||||
|
return M
|
||||||
@@ -254,14 +254,14 @@ _G.packer_plugins = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
time([[Defining packer_plugins]], false)
|
time([[Defining packer_plugins]], false)
|
||||||
-- Config for: barbecue.nvim
|
|
||||||
time([[Config for barbecue.nvim]], true)
|
|
||||||
try_loadstring("\27LJ\2\n6\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\rbarbecue\frequire\0", "config", "barbecue.nvim")
|
|
||||||
time([[Config for barbecue.nvim]], false)
|
|
||||||
-- Config for: Comment.nvim
|
-- Config for: Comment.nvim
|
||||||
time([[Config for Comment.nvim]], true)
|
time([[Config for Comment.nvim]], true)
|
||||||
try_loadstring("\27LJ\2\n5\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\fComment\frequire\0", "config", "Comment.nvim")
|
try_loadstring("\27LJ\2\n5\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\fComment\frequire\0", "config", "Comment.nvim")
|
||||||
time([[Config for Comment.nvim]], false)
|
time([[Config for Comment.nvim]], false)
|
||||||
|
-- Config for: barbecue.nvim
|
||||||
|
time([[Config for barbecue.nvim]], true)
|
||||||
|
try_loadstring("\27LJ\2\n6\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\rbarbecue\frequire\0", "config", "barbecue.nvim")
|
||||||
|
time([[Config for barbecue.nvim]], false)
|
||||||
|
|
||||||
_G._packer.inside_compile = false
|
_G._packer.inside_compile = false
|
||||||
if _G._packer.needs_bufread == true then
|
if _G._packer.needs_bufread == true then
|
||||||
|
|||||||
Reference in New Issue
Block a user