mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-25 06:36:46 +00:00
Compare commits
3 commits
3965ab15c3
...
0974c192d7
Author | SHA1 | Date | |
---|---|---|---|
|
0974c192d7 | ||
|
b6785f8218 | ||
|
73cc5edd31 |
2 changed files with 10 additions and 2 deletions
|
@ -58,6 +58,9 @@ in {
|
||||||
-- buffer is a real file on the disk
|
-- buffer is a real file on the disk
|
||||||
local real_file = vim.fn.filereadable(data.file) == 1
|
local real_file = vim.fn.filereadable(data.file) == 1
|
||||||
|
|
||||||
|
-- buffer is a directory
|
||||||
|
local directory = vim.fn.isdirectory(data.file) == 1
|
||||||
|
|
||||||
-- buffer is a [No Name]
|
-- buffer is a [No Name]
|
||||||
local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
|
local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
|
||||||
|
|
||||||
|
@ -65,7 +68,7 @@ in {
|
||||||
local filetype = vim.bo[data.buf].ft
|
local filetype = vim.bo[data.buf].ft
|
||||||
|
|
||||||
-- only files please
|
-- only files please
|
||||||
if not real_file and not no_name then
|
if not real_file and not directory and not no_name then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -74,6 +77,10 @@ in {
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- cd if buffer is a directory
|
||||||
|
if directory then
|
||||||
|
vim.cmd.cd(data.file)
|
||||||
|
end
|
||||||
-- open the tree but don't focus it
|
-- open the tree but don't focus it
|
||||||
require("nvim-tree.api").tree.toggle({ focus = false })
|
require("nvim-tree.api").tree.toggle({ focus = false })
|
||||||
end
|
end
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
lspConfig = ''
|
lspConfig = ''
|
||||||
lspconfig.tinymist.setup {
|
lspconfig.tinymist.setup {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
|
single_file_support = true,
|
||||||
on_attach = default_on_attach,
|
on_attach = default_on_attach,
|
||||||
cmd = ${
|
cmd = ${
|
||||||
if isList cfg.lsp.package
|
if isList cfg.lsp.package
|
||||||
|
|
Loading…
Reference in a new issue