mirror of
https://github.com/josean-dev/dev-environment-files.git
synced 2025-01-06 16:31:16 +01:00
Added requires to lspsaga and fixed nvim-tree open on setup
This commit is contained in:
parent
64490de2c0
commit
f6b02f16dd
2 changed files with 32 additions and 1 deletions
|
@ -76,7 +76,14 @@ return packer.startup(function(use)
|
|||
-- configuring lsp servers
|
||||
use("neovim/nvim-lspconfig") -- easily configure language servers
|
||||
use("hrsh7th/cmp-nvim-lsp") -- for autocompletion
|
||||
use({ "glepnir/lspsaga.nvim", branch = "main" }) -- enhanced lsp uis
|
||||
use({
|
||||
"glepnir/lspsaga.nvim",
|
||||
branch = "main",
|
||||
requires = {
|
||||
{ "nvim-tree/nvim-web-devicons" },
|
||||
{ "nvim-treesitter/nvim-treesitter" },
|
||||
},
|
||||
}) -- enhanced lsp uis
|
||||
use("jose-elias-alvarez/typescript.nvim") -- additional functionality for typescript server (e.g. rename file & update imports)
|
||||
use("onsails/lspkind.nvim") -- vs-code like icons for autocompletion
|
||||
|
||||
|
|
|
@ -38,3 +38,27 @@ nvimtree.setup({
|
|||
-- ignore = false,
|
||||
-- },
|
||||
})
|
||||
|
||||
-- open nvim-tree on setup
|
||||
|
||||
local function open_nvim_tree(data)
|
||||
-- buffer is a [No Name]
|
||||
local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
|
||||
|
||||
-- buffer is a directory
|
||||
local directory = vim.fn.isdirectory(data.file) == 1
|
||||
|
||||
if not no_name and not directory then
|
||||
return
|
||||
end
|
||||
|
||||
-- change to the directory
|
||||
if directory then
|
||||
vim.cmd.cd(data.file)
|
||||
end
|
||||
|
||||
-- open the tree
|
||||
require("nvim-tree.api").tree.open()
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })
|
||||
|
|
Loading…
Reference in a new issue