Add neo-tree on startup and set nerdfont to true
This commit is contained in:
parent
2813899aba
commit
b442836cc2
2
init.lua
2
init.lua
|
|
@ -91,7 +91,7 @@ vim.g.mapleader = ' '
|
|||
vim.g.maplocalleader = ' '
|
||||
|
||||
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
||||
vim.g.have_nerd_font = false
|
||||
vim.g.have_nerd_font = true
|
||||
|
||||
-- [[ Setting options ]]
|
||||
-- See `:help vim.opt`
|
||||
|
|
|
|||
|
|
@ -13,8 +13,29 @@ return {
|
|||
keys = {
|
||||
{ '\\', ':Neotree reveal<CR>', { desc = 'NeoTree reveal' } },
|
||||
},
|
||||
-- sourced from here https://github.com/LazyVim/LazyVim/blob/4d706f1bdc687f1d4d4cd962ec166c65c453633e/lua/lazyvim/plugins/editor.lua#L46-L64
|
||||
init = function()
|
||||
-- FIX: use `autocmd` for lazy-loading neo-tree instead of directly requiring it,
|
||||
-- because `cwd` is not set up properly.
|
||||
vim.api.nvim_create_autocmd('BufEnter', {
|
||||
group = vim.api.nvim_create_augroup('Neotree_start_directory', { clear = true }),
|
||||
desc = 'Start Neo-tree with directory',
|
||||
once = true,
|
||||
callback = function()
|
||||
if package.loaded['neo-tree'] then
|
||||
return
|
||||
else
|
||||
local stats = vim.uv.fs_stat(vim.fn.argv(0))
|
||||
if stats and stats.type == 'directory' then
|
||||
require 'neo-tree'
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
opts = {
|
||||
filesystem = {
|
||||
filtered_items = { hide_dotfiles = false },
|
||||
window = {
|
||||
mappings = {
|
||||
['\\'] = 'close_window',
|
||||
|
|
|
|||
Loading…
Reference in New Issue