-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.lua
240 lines (219 loc) · 7.2 KB
/
init.lua
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
-- Clax.nvim written by spirizeon (berzi), redxdager
-- inspired by Josean Martinez
-- 2nd rewrite in lazy.nvim
-- keymaps
vim.g.mapleader = " "
local keymap = vim.keymap
keymap.set("i","jk","<ESC>", { desc = "Exit insert mode with jk" })
-- keymap.set("mode","keys","result", "descriptioon" )
keymap.set("n","<leader>pv",vim.cmd.Ex)
keymap.set("n","<leader>nt",vim.cmd.Neotree)
keymap.set("n","<leader>md",vim.cmd.MarkdownPreviewToggle) --only works on md files
keymap.set("n","<leader>cs","<cmd>Telescope colorscheme<cr>") -- added colorscheme keybind
keymap.set("n","<leader>ff","<cmd>Telescope find_files<cr>") -- find files
keymap.set("n","<leader>lg","<cmd>Telescope live_grep<cr>") -- find word
keymap.set("n","<leader>of","<cmd>Telescope oldfiles<cr>") -- recent files
keymap.set("n","<leader>nf","<cmd>new<cr>") -- new files
function open_terminal()
vim.cmd("vsplit")
vim.cmd("set nonumber")
vim.cmd("cd %:p:h")
vim.cmd("terminal")
vim.cmd("startinsert")
end
keymap.set("n","<leader>ot","<cmd>lua open_terminal()<cr>", { desc="open a vertical terminal with insert mode enabled, type SPACE + o + t"})
-- tab management (inspired by firefox)
keymap.set("n","<C-t>","<cmd>tabnew<cr>", { desc = "Open new tab" }) -- open new tab
keymap.set("n","<C-w>","<cmd>tabclose<cr>", { desc = "Close current tab" }) -- open new tab
keymap.set("n","<C-n>","<cmd>tabn<cr>", { desc = "Go to next tab" }) -- open new tab
-- options
vim.cmd('let g:netrw_liststyle = 3') -- for using tree listing style
local opt = vim.opt
opt.relativenumber = true
opt.number = true
-- tabs and indent
opt.tabstop = 2
opt.shiftwidth = 2
opt.autoindent = true -- copy indent from current line into new one
-- search settings
opt.ignorecase = true -- ignore case
opt.smartcase = true -- mixed case allowed
opt.cursorline = true -- wtf is this
opt.background = "dark"
opt.termguicolors = true
opt.signcolumn = "yes" --show sign column so that text doesn't shift
-- clipboard
opt.clipboard:append("unnamedplus") -- use system clipboard as default register
-- split controls
opt.splitright = true -- split vertically right
opt.splitbelow = true -- split horizontally to bottom
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", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require('lazy').setup({
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function ()
local configs = require("nvim-treesitter.configs")
configs.setup({
ensure_installed = { "c", "lua", "vim", "vimdoc", "sql","ssh_config", "python","rust","css", "javascript", "html" },
sync_install = true,
highlight = { enable = true },
indent = { enable = true },
})
end
},
-- lualine
{
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
require"startup".setup({
options = {
icons_enabled = true,
theme = 'gruvbox-material',
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
}
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_c = {'filename'},
lualine_x = {'encoding', 'fileformat', 'filetype'},
lualine_y = {'progress'},
lualine_z = {'location'}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_y = {},
lualine_z = {}
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {}
})
end
},
{ "catppuccin/nvim", name = "catppuccin", priority = 1000,
config = function()
require"startup".setup({
flavour = "auto", -- latte, frappe, macchiato, mocha
background = { -- :h background
light = "latte",
dark = "mocha",
},
transparent_background = true, -- disables setting the background color.
show_end_of_buffer = false, -- shows the '~' characters after the end of buffers
term_colors = false, -- sets terminal colors (e.g. `g:terminal_color_0`)
dim_inactive = {
enabled = false, -- dims the background color of inactive window
shade = "dark",
percentage = 0.15, -- percentage of the shade to apply to the inactive window
},
no_italic = false, -- Force no italic
no_bold = false, -- Force no bold
no_underline = false, -- Force no underline
styles = { -- Handles the styles of general hi groups (see `:h highlight-args`):
comments = { "italic" }, -- Change the style of comments
conditionals = { "italic" },
loops = {},
functions = {},
keywords = {},
strings = {},
variables = {},
numbers = {},
booleans = {},
properties = {},
types = {},
operators = {},
-- miscs = {}, -- Uncomment to turn off hard-coded styles
},
color_overrides = {},
custom_highlights = {},
default_integrations = true,
integrations = {
cmp = true,
gitsigns = true,
nvimtree = true,
treesitter = true,
notify = false,
mini = {
enabled = true,
indentscope_color = "",
},
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
},
})
end
},
{ 'andweeb/presence.nvim' }, --discord rich presence
{ "williamboman/mason.nvim" }, -- lsps
{ "ellisonleao/gruvbox.nvim", priority = 1000 , config = true, opts = ...},
{
'nvim-lua/plenary.nvim',
},
{
"startup-nvim/startup.nvim",
requires = {"nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim"},
config = function()
require"startup".setup({theme="clax"})
end
},
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
}
},
{'neoclide/coc.nvim', branch = 'release'},
{
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
ft = { "markdown" },
build = function() vim.fn["mkdp#util#install"]() end,
},
{
'nvim-telescope/telescope.nvim', tag = '0.1.6',
-- or , branch = '0.1.x',
dependencies = { 'nvim-lua/plenary.nvim' }
},
{
'windwp/nvim-autopairs',
event = "InsertEnter",
config = true
-- use opts = {} for passing setup options
-- this is equalent to setup({}) function
},
})
vim.cmd("colorscheme catppuccin") -- set default colorscheme
vim.cmd('highlight Normal guibg=NONE ctermbg=NONE') -- set background transparent