tangled
alpha
login
or
join now
vitorpy.com
/
dotfiles
0
fork
atom
vitorpy's Dotfiles
0
fork
atom
overview
issues
pulls
pipelines
Add nvim config with nvim-tree and toggleterm
vitorpy
5 months ago
a0d082a5
4965c813
+91
4 changed files
expand all
collapse all
unified
split
private_dot_config
nvim
init.lua
lua
plugins
nvim-tree.lua
theme.lua
toggleterm.lua
+32
private_dot_config/nvim/init.lua
···
1
1
+
-- Bootstrap lazy.nvim
2
2
+
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
3
3
+
if not vim.loop.fs_stat(lazypath) then
4
4
+
vim.fn.system({
5
5
+
"git",
6
6
+
"clone",
7
7
+
"--filter=blob:none",
8
8
+
"https://github.com/folke/lazy.nvim.git",
9
9
+
"--branch=stable",
10
10
+
lazypath,
11
11
+
})
12
12
+
end
13
13
+
vim.opt.rtp:prepend(lazypath)
14
14
+
15
15
+
-- Basic settings
16
16
+
vim.g.mapleader = " "
17
17
+
vim.g.maplocalleader = " "
18
18
+
19
19
+
vim.opt.number = true
20
20
+
vim.opt.relativenumber = true
21
21
+
vim.opt.mouse = "a"
22
22
+
vim.opt.ignorecase = true
23
23
+
vim.opt.smartcase = true
24
24
+
vim.opt.hlsearch = false
25
25
+
vim.opt.wrap = false
26
26
+
vim.opt.tabstop = 2
27
27
+
vim.opt.shiftwidth = 2
28
28
+
vim.opt.expandtab = true
29
29
+
vim.opt.termguicolors = true
30
30
+
31
31
+
-- Load plugins
32
32
+
require("lazy").setup("plugins")
+24
private_dot_config/nvim/lua/plugins/nvim-tree.lua
···
1
1
+
return {
2
2
+
"nvim-tree/nvim-tree.lua",
3
3
+
dependencies = {
4
4
+
"nvim-tree/nvim-web-devicons",
5
5
+
},
6
6
+
config = function()
7
7
+
require("nvim-tree").setup({
8
8
+
sort_by = "case_sensitive",
9
9
+
view = {
10
10
+
width = 30,
11
11
+
},
12
12
+
renderer = {
13
13
+
group_empty = true,
14
14
+
},
15
15
+
filters = {
16
16
+
dotfiles = false,
17
17
+
},
18
18
+
})
19
19
+
20
20
+
-- Keybindings
21
21
+
vim.keymap.set("n", "<leader>e", ":NvimTreeToggle<CR>", { desc = "Toggle file tree" })
22
22
+
vim.keymap.set("n", "<leader>f", ":NvimTreeFindFile<CR>", { desc = "Find current file in tree" })
23
23
+
end,
24
24
+
}
+8
private_dot_config/nvim/lua/plugins/theme.lua
···
1
1
+
return {
2
2
+
"phha/zenburn.nvim",
3
3
+
priority = 1000,
4
4
+
config = function()
5
5
+
require("zenburn").setup()
6
6
+
vim.cmd.colorscheme("zenburn")
7
7
+
end,
8
8
+
}
+27
private_dot_config/nvim/lua/plugins/toggleterm.lua
···
1
1
+
return {
2
2
+
"akinsho/toggleterm.nvim",
3
3
+
version = "*",
4
4
+
config = function()
5
5
+
require("toggleterm").setup({
6
6
+
size = 20,
7
7
+
open_mapping = [[<c-\>]],
8
8
+
hide_numbers = true,
9
9
+
shade_terminals = true,
10
10
+
start_in_insert = true,
11
11
+
insert_mappings = true,
12
12
+
terminal_mappings = true,
13
13
+
persist_size = true,
14
14
+
direction = "float",
15
15
+
close_on_exit = true,
16
16
+
shell = vim.o.shell,
17
17
+
float_opts = {
18
18
+
border = "curved",
19
19
+
winblend = 0,
20
20
+
},
21
21
+
})
22
22
+
23
23
+
-- Custom terminal keybindings
24
24
+
vim.keymap.set("n", "<leader>t", ":ToggleTerm<CR>", { desc = "Toggle terminal" })
25
25
+
vim.keymap.set("t", "<esc>", [[<C-\><C-n>]], { desc = "Exit terminal mode" })
26
26
+
end,
27
27
+
}