diff options
Diffstat (limited to '')
-rw-r--r-- | lua/core/auto.lua | 8 | ||||
-rw-r--r-- | lua/core/maps.lua | 9 | ||||
-rw-r--r-- | lua/core/opts.lua | 8 | ||||
-rw-r--r-- | lua/core/overrides/init.lua | 1 | ||||
-rw-r--r-- | lua/core/overrides/scrollbar.lua | 1 | ||||
-rw-r--r-- | lua/core/overrides/sfm.lua | 40 | ||||
-rw-r--r-- | lua/core/plugins.lua | 3 |
7 files changed, 58 insertions, 12 deletions
diff --git a/lua/core/auto.lua b/lua/core/auto.lua index 81270bf..2403c5e 100644 --- a/lua/core/auto.lua +++ b/lua/core/auto.lua @@ -71,11 +71,3 @@ a.nvim_create_autocmd('FileType', { pattern = '*', command = 'hi NonText guifg=bg' }) - --- source and compile lua conf when written -local packer_group = a.nvim_create_augroup('Packer', { clear = true }) -vim.api.nvim_create_autocmd('BufWritePost', { - command = 'source <afile>', - group = packer_group, - pattern = vim.fn.expand '$MYVIMRC', -}) diff --git a/lua/core/maps.lua b/lua/core/maps.lua index 954e25d..7958785 100644 --- a/lua/core/maps.lua +++ b/lua/core/maps.lua @@ -53,8 +53,7 @@ a.nvim_create_autocmd('FileType', { a.nvim_set_keymap('i', '<tab>', '<cmd>lua require("intellitab").indent()<CR>', opts) -- open Trouble buffer -a.nvim_set_keymap("n", "<leader>tt", -"<cmd>TroubleToggle document_diagnostics<CR>", opts) +a.nvim_set_keymap("n", "<leader>tt", "<cmd>TroubleToggle document_diagnostics<CR>", opts) a.nvim_set_keymap("n", "<leader>td", "<cmd>TodoTrouble<CR>", opts) -- dismiss notifications @@ -72,8 +71,7 @@ a.nvim_set_keymap("n", "<C-g>", [[<cmd>Gitsigns toggle_current_line_blame<CR>]], -- telescope a.nvim_set_keymap('n', '<leader>sf', '<cmd>Telescope find_files<CR>', opts) a.nvim_set_keymap('n', '<leader>sg', '<cmd>Telescope git_commits<CR>', opts) -a.nvim_set_keymap('n', '<leader>sb', - '<cmd>Telescope current_buffer_fuzzy_find<CR>', opts) +a.nvim_set_keymap('n', '<leader>sb', '<cmd>Telescope current_buffer_fuzzy_find<CR>', opts) a.nvim_set_keymap('n', '<leader>so', '<cmd>Telescope oldfiles<CR>', opts) a.nvim_set_keymap('n', '<leader>sc', '<cmd>Telescope neoclip unnamed<CR>', opts) a.nvim_set_keymap('n', '<leader>su', '<cmd>Telescope undo<CR>', opts) @@ -129,6 +127,9 @@ a.nvim_set_keymap('n', '<leader>ga', '<cmd>lua require("cosmic-ui").code_actions -- glow a.nvim_set_keymap('n', '<leader>gl', '<cmd>lua _glow()<CR>', opts) +-- open file tree +a.nvim_set_keymap('n', '<leader>to', '<cmd>SFMToggle<CR>', opts) + -- vbox note taking function _G.Toggle_venn() local venn_enabled = vim.inspect(vim.b.venn_enabled) diff --git a/lua/core/opts.lua b/lua/core/opts.lua index 7e71954..75e8c38 100644 --- a/lua/core/opts.lua +++ b/lua/core/opts.lua @@ -208,3 +208,11 @@ a.nvim_set_hl(0, "TelescopeResultsTitle", { bg = colors.black4, a.nvim_set_hl(0, "TelescopeSelection", { bg = colors.black2 }) a.nvim_set_hl(0, "TelescopeSelectionCaret", { bg = colors.black2, fg = colors.orange, bold = true }) + +-- sfm (tree view stuff) +a.nvim_set_hl(0, "SFMGitStaged", { fg = colors.green }) +a.nvim_set_hl(0, "SFMGitUnstaged", { fg = colors.green }) +a.nvim_set_hl(0, "SFMGitRenamed", { fg = colors.purple }) +a.nvim_set_hl(0, "SFMGitNew", { fg = colors.orange }) +a.nvim_set_hl(0, "SFMGitDeleted", { fg = colors.red }) +a.nvim_set_hl(0, "SFMGitIgnored", { fg = colors.grey }) diff --git a/lua/core/overrides/init.lua b/lua/core/overrides/init.lua index 3f9eef9..34df01f 100644 --- a/lua/core/overrides/init.lua +++ b/lua/core/overrides/init.lua @@ -21,3 +21,4 @@ require('core.overrides.notify') require('core.overrides.hover') require('core.overrides.scrollbar') require('core.overrides.toggleterm') +require('core.overrides.sfm') diff --git a/lua/core/overrides/scrollbar.lua b/lua/core/overrides/scrollbar.lua index c43e099..dbce04f 100644 --- a/lua/core/overrides/scrollbar.lua +++ b/lua/core/overrides/scrollbar.lua @@ -20,6 +20,7 @@ require("scrollbar").setup({ "TelescopePrompt", "noice", "alpha", + "sfm", }, handlers = { diagnostic = true, diff --git a/lua/core/overrides/sfm.lua b/lua/core/overrides/sfm.lua new file mode 100644 index 0000000..06c77d1 --- /dev/null +++ b/lua/core/overrides/sfm.lua @@ -0,0 +1,40 @@ +local sfm = require('sfm') + +sfm.setup { + view = { + side = "left", -- side of the tree, can be `left`, `right` + width = 30 + }, + mappings = { + custom_only = false, + }, + renderer = { + icons = { + file = { + default = "#", + symlink = "#", + }, + folder = { + default = "[|", + open = "[/", + symlink = "[|", + symlink_open = "[/", + }, + indicator = { + folder_closed = "", + folder_open = "", + file = "", + }, + } + }, +}:load_extension('sfm-git', { + icons = { + staged = "^", + unstaged = "+", + unmerged = "", + renamed = ">", + untracked = "?", + deleted = "x", + ignored = "#" + } +}) diff --git a/lua/core/plugins.lua b/lua/core/plugins.lua index c41bd9d..2844d8a 100644 --- a/lua/core/plugins.lua +++ b/lua/core/plugins.lua @@ -48,6 +48,9 @@ require('lazy').setup{ dependencies = { 'MunifTanjim/nui.nvim' }, config = true, }, + { 'dinhhuy258/sfm.nvim', + dependencies = { 'dinhhuy258/sfm-git.nvim' } + }, -- -- careful the following plugins might be considered useful proceed with caution |