-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add nvim-tree and oil for better file system interaction
- Loading branch information
1 parent
dc3bcdf
commit 7641232
Showing
9 changed files
with
102 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
|
||
require('options') | ||
require('keymaps') | ||
require('autocmds') | ||
require('lazy-nvim') | ||
|
||
vim.cmd[[ colorscheme tokyonight]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
local api = vim.api | ||
|
||
api.nvim_create_augroup("custom_buffer", { clear = true }) | ||
api.nvim_create_autocmd("TextYankPost", { | ||
group = "custom_buffer", | ||
pattern = "*", | ||
callback = function() vim.highlight.on_yank { timeout = 200 } end | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
return { | ||
"nvim-tree/nvim-tree.lua", | ||
version = "*", | ||
lazy = "false", | ||
dependencies = { | ||
"nvim-tree/nvim-web-devicons", | ||
}, | ||
config = function() | ||
local HEIGHT_RATIO = 0.8 -- You can change this | ||
local WIDTH_RATIO = 0.5 | ||
require("nvim-tree").setup({ | ||
view = { | ||
float = { | ||
enable = true, | ||
open_win_config = function() | ||
local screen_w = vim.opt.columns:get() | ||
local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get() | ||
local window_w = screen_w * WIDTH_RATIO | ||
local window_h = screen_h * HEIGHT_RATIO | ||
local window_w_int = math.floor(window_w) | ||
local window_h_int = math.floor(window_h) | ||
local center_x = (screen_w - window_w) / 2 | ||
local center_y = ((vim.opt.lines:get() - window_h) / 2) | ||
- vim.opt.cmdheight:get() | ||
return { | ||
border = 'rounded', | ||
relative = 'editor', | ||
row = center_y, | ||
col = center_x, | ||
width = window_w_int, | ||
height = window_h_int, | ||
} | ||
end, | ||
}, | ||
width = function() | ||
return math.floor(vim.opt.columns:get() * WIDTH_RATIO) | ||
end, | ||
}, | ||
}) | ||
end | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
return { | ||
'stevearc/oil.nvim', | ||
opts = {}, | ||
-- Optional dependencies | ||
dependencies = { "nvim-tree/nvim-web-devicons" }, | ||
config = function() | ||
require("oil").setup() | ||
end, | ||
} |