Skip to content

Commit 69d5a97

Browse files
committed
improve neotree
1 parent 1f2e5c5 commit 69d5a97

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

init.lua

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ require('lazy').setup({
206206
'rebelot/kanagawa.nvim',
207207
config = function()
208208
require('kanagawa').setup {
209-
-- Set a style preset. 'dark' is default.
210-
theme = 'dragon', -- dark, darker, cool, deep, warm, warmer, light
209+
theme = 'dragon', -- wave, dragon, lotus
211210
}
212211
require('kanagawa').load()
213212
end,
@@ -294,6 +293,9 @@ vim.o.hlsearch = false
294293
-- Make line numbers default
295294
vim.wo.number = true
296295

296+
-- Make relative numbers default
297+
vim.wo.relativenumber = true
298+
297299
-- Enable mouse mode
298300
vim.o.mouse = 'a'
299301

@@ -325,6 +327,8 @@ vim.o.completeopt = 'menuone,noselect'
325327
-- NOTE: You should make sure your terminal supports this
326328
vim.o.termguicolors = true
327329

330+
vim.o.shiftwidth = 4
331+
vim.o.tabstop = 4
328332
-- [[ Basic Keymaps ]]
329333

330334
-- Keymaps for better default experience
@@ -546,6 +550,14 @@ local on_attach = function(_, bufnr)
546550
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
547551
end, '[W]orkspace [L]ist Folders')
548552

553+
-- Add key map for organising imports
554+
nmap('<leader>li', function()
555+
vim.lsp.buf.execute_command({
556+
command = "_typescript.organizeImports",
557+
arguments = {vim.api.nvim_buf_get_name(0)},
558+
})
559+
end, '[L]ay Out [I]mports')
560+
549561
-- Create a command `:Format` local to the LSP buffer
550562
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
551563
vim.lsp.buf.format()
@@ -588,10 +600,10 @@ local servers = {
588600
-- gopls = {},
589601
-- pyright = {},
590602
-- rust_analyzer = {},
591-
-- tsserver = {},
592603
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
593604
-- phpactor = {},
594-
-- intelephense = {},
605+
tsserver = {},
606+
intelephense = {},
595607
lua_ls = {
596608
Lua = {
597609
workspace = { checkThirdParty = false },

lua/custom/plugins/filetree.lua

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ return {
1010
"MunifTanjim/nui.nvim",
1111
},
1212
config = function ()
13-
require('neo-tree').setup {}
13+
require('neo-tree').setup {
14+
default_component_configs = {
15+
icon = {
16+
folder_closed = "",
17+
folder_open = "",
18+
folder_empty = "󰜌",
19+
-- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there
20+
-- then these will never be used.
21+
default = "*",
22+
highlight = "NeoTreeFileIcon"
23+
},
24+
}
25+
}
1426
end,
1527
}

0 commit comments

Comments
 (0)