-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
170 lines (142 loc) · 3.62 KB
/
init.lua
File metadata and controls
170 lines (142 loc) · 3.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
-- setting reasonable quality-of-life defaluts
-- this is a straightforward translation of the vimscript
-- I had before adding/dealing with external plugins
vim.o.ignorecase = true
vim.api.nvim_command('set nohlsearch')
vim.o.number = true
vim.o.relativenumber = true
vim.o.showcmd = true
vim.o.shiftwidth = 4
vim.o.smarttab = true
vim.o.encoding = "utf-8"
vim.o.hidden = true
-- Custom Colors
vim.o.termguicolors = true
-- Setting Mapleader
vim.g.mapleader = ","
-- vim.highlight.priorities = 100;
-- Adding Mappings
-- Ctrl-w to <leader>w so I don't use control for moving windows.
vim.api.nvim_set_keymap('n', '<leader>w', '<C-w>', { noremap = true })
-- remapping term -> normal to Escape
vim.api.nvim_set_keymap('t', '<Esc>', '<C-\\><C-n>', { noremap = true })
-- Using API to create "Initialize Config" Command
vim.api.nvim_create_user_command(
"InitalizeConfig",
function()
vim.fn.mkdir(vim.fn.stdpath("config"), "p")
end,
{}
)
-- Using API to create "EditConfig" command
vim.api.nvim_create_user_command(
"EditConfig",
function()
vim.cmd("edit " .. vim.fn.stdpath("config") .. "/init.lua")
end,
{}
)
-- Setting up lazy package manager
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate"
},
{
'nvim-telescope/telescope.nvim', tag = '0.1.5',
requires = { 'nvim-lua/plenary.nvim' }
},
{
"jiaoshijie/undotree",
dependencies = "nvim-lua/plenary.nvim",
config = true,
keys = {
{ "<leader>u", "cmdlua require('undotree').toggle()<cr>" },
},
},
{
"EdenEast/nightfox.nvim",
},
{
"folke/todo-comments.nvim",
dependencies = {"nvim-lua/plenary.nvim"}
},
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
},
{
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' }
},
{
'NvChad/nvim-colorizer.lua'
},
{
'akinsho/toggleterm.nvim', version = "*", config = true
}
-- {
-- FIXME This doesn't work as expected
-- I commented it out until I can figure it out
-- "NeogitOrg/neogit",
-- dependencies = {
-- "nvim-lua/plenary.nvim",
-- "sindrets/diffview.nvim",
-- "nvim-telescope/telescope.nvim"
-- },
-- config = true
-- }
})
-- Commands that need to be called after plugins are loaded
-- Setting Duskfox Colorscheme
vim.cmd("colorscheme duskfox")
-- Configuring lualine
require('lualine').setup{
-- TODO: Add a better configuration here
options = {
icons_enabled = true,
theme = "dracula",
component_separators = { left = '', right = '' }
}
}
-- Configuring neogit
-- TODO: decide how to configure Neogit
-- registering parser to filetypes
vim.treesitter.language.register('python', '.py')
-- nvim colorizer
require 'colorizer'.setup{
filetypes = { "*" },
user_default_options = {
RGB = true,
RRGGBB = true,
RRGGBBAA = true,
AARRGGBB = true,
},
buftypes = {
"*",
"!prompt",
"!popup",
},
}
require("colorizer").attach_to_buffer(0, { mode = "background", css = true})
-- ToggleTerm
require("toggleterm").setup{
shell = vim.o.shell
}