Skip to content

Commit

Permalink
Merge pull request #73 from TechDufus/neovim/neotree_fixes
Browse files Browse the repository at this point in the history
neovim/neotree fixes
  • Loading branch information
TechDufus authored Dec 27, 2023
2 parents 7bee7f8 + 4f5ffa8 commit f9d1691
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,9 @@ sudo apt-get update && sudo apt-get upgrade -y
## Setup

### values.yaml
### all.yaml values file

The `values.yaml` file allows you to personalize your setup to your needs. Create a file located at `~/.config/dotfiles/values.yaml` and include your desired settings.

```bash
cd $HOME && mkdir -p .config/dotfiles && vim .config/dotfiles/values.yaml
```
The `all.yaml` file allows you to personalize your setup to your needs. This file will be created in the file located at `~/.dotfiles/group_vars/all.yaml` after you [Install this dotfiles](#install) and include your desired settings.

Below is a list of all available values. Not all are required but incorrect values will break the playbook if not properly set.

Expand Down
26 changes: 25 additions & 1 deletion roles/neovim/files/lua/plugins/neo-tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,37 @@ return {
"thumbs.db",
},
},
components = {
harpoon_index = function(config, node, state)
local Marked = require("harpoon.mark")
local path = node:get_id()
local succuss, index = pcall(Marked.get_index_of, path)
if succuss and index and index > 0 then
return {
text = string.format(" ⥤ %d", index), -- <-- Add your favorite harpoon like arrow here
highlight = config.highlight or "NeoTreeDirectoryIcon",
}
else
return {}
end
end
},
renderers = {
file = {
{ "icon" },
{ "name", use_git_status_colors = true },
{ "harpoon_index" }, --> This is what actually adds the component in where you want it
{ "diagnostics" },
{ "git_status", highlight = "NeoTreeDimText" },
}
}
},
buffers = {
follow_current_file = {
enabled = true
},
},
event_handlers = { },
event_handlers = {},
})
end,
}
2 changes: 1 addition & 1 deletion roles/neovim/files/lua/techdufus/core/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ keymap(term_mode, "<C-k>", "<C-\\><C-N><C-w>k", term_opts)
keymap(term_mode, "<C-l>", "<C-\\><C-N><C-w>l", term_opts)

-- Telescope --
keymap(normal_mode, "<leader>pf", "<cmd>:Neotree close<cr><cmd>lua require'telescope.builtin'.find_files({ hidden = true })<cr>", opts)
keymap(normal_mode, "<leader>pf", "<cmd>:Neotree close<cr><cmd>lua require'telescope.builtin'.find_files({find_command = {'rg', '--files', '--hidden', '-g', '!.git' }})<cr>", opts)
keymap(normal_mode, "<leader>ps", "<cmd>lua require('telescope.builtin').live_grep({ hidden = true })<cr>", opts)

-- Telescope find files in nvim config directory
Expand Down

0 comments on commit f9d1691

Please sign in to comment.