forked from sohooo/nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
359 lines (323 loc) · 10.6 KB
/
Copy pathinit.lua
File metadata and controls
359 lines (323 loc) · 10.6 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
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
-- ===============================================
-- Who: Sven Sporer <<||>> sohooo
-- Where: https://github.com/sohooo/nvim
-- ===============================================
-- vim: fdm=marker ts=2 sts=2 sw=2 fdl=0
-- NVIM v0.10.0 Build type: Release LuaJIT 2.1.1713773202
-- util functions {{{
function Hifi()
-- non-nerdfont compatible signs
-- ⚠ ☒ ★ ☆ ☼♡ ♢ ► ⊗ ⊖ ⊙ ⊛ ⊠ ⊹ ⋇ ⋗ ⋯ ◌ ●
-- Ⓐ Ⓑ Ⓒ Ⓓ Ⓔ Ⓕ Ⓖ Ⓗ Ⓘ Ⓙ Ⓚ Ⓛ Ⓜ Ⓝ Ⓞ Ⓟ Ⓠ Ⓡ Ⓢ Ⓣ Ⓤ Ⓥ Ⓦ Ⓧ Ⓨ Ⓩ
local style = os.getenv("NVIM_STYLE")
return style ~= "plain"
end
-- custom settings based on GIT_USERNAME env variable
function MyColors()
local style = {
default = {
colorscheme = "neofusion",
lualine = require("neofusion.lualine"),
-- colorscheme = "tokyonight",
-- lualine = "tokyonight",
-- colorscheme = "oxocarbon",
-- lualine = "oxocarbon",
-- colorscheme catppuccin " catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha
-- lualine = "catppuccin"
--
-- https://github.com/rebelot/kanagawa.nvim
-- kanagawa-wave
-- kanagawa-dragon
-- kanagawa-lotus
--
-- colorscheme = "nordic",
-- colorscheme = "onenord",
-- colorscheme = "oxocarbon",
--
-- colorscheme = "onedark",
-- lualine = "onedark",
},
pUSER = {
colorscheme = "nord",
lualine = "nord",
}
}
local wanted = os.getenv("GIT_USERNAME")
return style[wanted] or style["default"]
end
-- }}}
-- plugins {{{
-- bootstrap lazy.nvim
-- https://github.com/folke/lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--single-branch",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
-- make sure to set `mapleader` before lazy so your mappings are correct
vim.g.maplocalleader = ','
vim.g.mapleader = ','
require("lazy").setup({
-- telescope {{{
{ 'nvim-telescope/telescope.nvim', dependencies = { 'nvim-lua/plenary.nvim' } },
{
'nvim-telescope/telescope-fzf-native.nvim',
build = 'make',
cond = function()
return vim.fn.executable 'make' == 1
end,
},
-- }}}
--
-- addons, layout {{{
'stevearc/dressing.nvim', -- improve default vim.ui interfaces
'tpope/vim-fugitive', -- Git commands in nvim
'tpope/vim-dispatch', -- async build/test dispatcher
'folke/which-key.nvim', -- key bindings
'folke/todo-comments.nvim',
'levouh/tint.nvim', -- dim inactive windows
'nacro90/numb.nvim', -- peeks lines of the buffer
'hoob3rt/lualine.nvim',
'kdheepak/tabline.nvim',
'famiu/bufdelete.nvim',
'kyazdani42/nvim-web-devicons',
'nvim-tree/nvim-tree.lua',
{
"HampusHauffman/block.nvim",
config = function()
require("block").setup({})
end
},
{ "lukas-reineke/indent-blankline.nvim", main = "ibl", opts = {}, },
"akinsho/toggleterm.nvim",
"samjwill/nvim-unception", --open via Neovim's terminal without nesting sessions
'rmagatti/goto-preview',
'norcalli/nvim-colorizer.lua',
{ 'beauwilliams/focus.nvim', lazy = true }, -- Auto-Focusing and Auto-Resizing Splits/Windows
{ 'folke/noice.nvim', dependencies = {
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
"MunifTanjim/nui.nvim",
-- OPTIONAL:
-- `nvim-notify` is only needed, if you want to use the notification view.
-- If not available, we use `mini` as the fallback
-- "rcarriga/nvim-notify",
}},
-- }}}
-- languages {{{
'rodjek/vim-puppet',
'fatih/vim-go',
'simrat39/rust-tools.nvim',
'mfussenegger/nvim-dap', -- Debugging
'PedramNavid/dbtpal', -- dbt features
{ 'folke/neodev.nvim', enabled = false },-- additional lua config for neovim root_dir
-- }}}
-- helpers {{{
'xorid/asciitree.nvim', -- :AsciiTree [2 #] [default]
-- }}}
-- editing tools {{{
{ 'lewis6991/gitsigns.nvim', dependencies = { 'nvim-lua/plenary.nvim' }},
'sindrets/diffview.nvim',
'tpope/vim-repeat', -- make '.' usable for plugins
'numToStr/Comment.nvim', -- smart commenting plugin
'ggandor/leap.nvim', -- fast jumping with s|S
{
'ggandor/flit.nvim', config = function()
-- Enhanced f/t motions for Leap
require('flit').setup {}
end
},
'sickill/vim-pasta', -- pasting with indentation adjusted
'stefandtw/quickfix-reflector.vim', -- Change code right in the quickfix window
'windwp/nvim-autopairs',
'abecodes/tabout.nvim',
'RRethy/vim-illuminate', -- highlight current word
{ 'jiaoshijie/undotree', dependencies = { 'nvim-lua/plenary.nvim' }},
{ 'echasnovski/mini.align', version = '*' },
{
"smjonas/live-command.nvim", config = function()
require("live-command").setup {
commands = {
Norm = { cmd = "norm" }, -- previewable :Norm
},
}
end,
},
{
"nvim-neotest/neotest",
lazy = true,
dependencies = {
"nvim-neotest/nvim-nio",
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"antoinemadec/FixCursorHold.nvim",
"olimorris/neotest-rspec",
},
},
{
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
end
},
{ "ThePrimeagen/refactoring.nvim", config = function()
require("refactoring").setup({})
end,
},
{
"simrat39/symbols-outline.nvim",
cmd = "SymbolsOutline",
init = function()
vim.keymap.set("n", "<leader>cs", "<cmd>SymbolsOutline<cr>", { desc = "Symbols Outline" })
end,
config = function()
require("symbols-outline").setup()
end,
},
{
"cshuaimin/ssr.nvim",
init = function()
vim.keymap.set({ "n", "x" }, "<leader>cR", function()
require("ssr").open()
end, { desc = "Structural Replace" })
end,
},
-- }}}
-- treesitter {{{
{ -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
dependencies = { 'nvim-treesitter/nvim-treesitter-textobjects', },
build = ":TSUpdate",
},
{ 'JoosepAlviste/nvim-ts-context-commentstring', dependencies = { 'nvim-treesitter' }},
{ 'RRethy/nvim-treesitter-textsubjects', dependencies = { 'nvim-treesitter' }},
{ 'RRethy/nvim-treesitter-endwise', dependencies = { 'nvim-treesitter' }},
{ 'romgrk/nvim-treesitter-context', dependencies = { 'nvim-treesitter' }},
{ 'ckolkey/ts-node-action', dependencies = { 'nvim-treesitter' }},
{ 'windwp/nvim-ts-autotag', dependencies = { 'nvim-treesitter' }},
{ 'p00f/nvim-ts-rainbow', dependencies = { 'nvim-treesitter' }},
-- }}}
-- lsp, completion, snippets {{{
'onsails/lspkind-nvim', -- icons in lsp popups etc
'j-hui/fidget.nvim', -- Standalone UI for nvim-lsp progress
'neovim/nvim-lspconfig',
-- Autocomplete
'hrsh7th/nvim-cmp',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'saadparwaiz1/cmp_luasnip',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-nvim-lua',
-- Snippets
'L3MON4D3/LuaSnip',
'rafamadriz/friendly-snippets',
-- linter, formatter, ...
'jose-elias-alvarez/null-ls.nvim',
-- colorschemes {{{
'arcticicestudio/nord-vim',
{ "catppuccin/nvim", name = "catppuccin" },
'nyoom-engineering/oxocarbon.nvim',
'navarasu/onedark.nvim',
'PHSix/nvim-hybrid',
'rmehri01/onenord.nvim',
'AlexvZyl/nordic.nvim',
'shaunsingh/moonlight.nvim',
'shaunsingh/doom-vibrant.nvim',
'folke/tokyonight.nvim',
'rebelot/kanagawa.nvim',
'diegoulloao/neofusion.nvim',
-- }}}
})
-- }}}
-- }}}
-- options {{{
vim.o.inccommand = 'split' -- show regex previews
vim.o.hlsearch = true -- set highlight on search
vim.o.incsearch = true -- show matches while typing
vim.o.showmatch = true -- show matching brackets
vim.o.matchtime = 2 -- how many tenths of a second to blink
vim.wo.number = true -- make line numbers default
vim.wo.relativenumber = true -- relative to current pos
vim.o.scrolloff=8 -- show 8 lines of context around cursor
vim.o.hidden = true -- do not save when switching buffers
vim.o.mouse = '' -- disable mouse
vim.o.breakindent = true -- wrapped line with same indentation
vim.opt.undofile = true -- save undo history
vim.o.ignorecase = true -- case insensitive searching
vim.o.smartcase = true -- ...unless /C or capital in search
vim.o.expandtab = true -- insert spaces on <tab>
vim.o.updatetime = 250 -- decrease update time (4000)
vim.o.timeout = true -- wait timeoutlen ms
vim.o.timeoutlen = 400 -- wait for seq. to complete (1000)
vim.wo.signcolumn = 'yes:1' -- always draw sign col
vim.o.laststatus = 2 -- set to 3 for global statusline
vim.o.splitbelow = true -- default: above
vim.o.splitright = true -- default: on the left
if Hifi() then
--Set colorscheme (order is important here)
vim.o.termguicolors = true
-- vim.cmd [[colorscheme tokyonight]]
vim.cmd('colorscheme ' .. MyColors()['colorscheme'])
vim.g.tokyonight_style = 'night' -- storm | night | day
else
vim.o.termguicolors = false
vim.cmd [[colorscheme nord]]
-- vim.cmd [[colorscheme iceberg]]
-- vim.g.onedark_terminal_italics = 2
-- vim.g.onedark_termcolors = 256
-- vim.cmd [[colorscheme onedark]]
end
-- Set completeopt to have a better completion experience
vim.o.completeopt = 'menu,menuone,noselect'
vim.cmd [[set iskeyword+=-]]
-- }}}
-- requires {{{
require('sohooo/misc')
require('sohooo/treesitter')
require('sohooo/todo-comments')
require('sohooo/telescope')
require('sohooo/lsp')
require('sohooo/null-ls')
require('sohooo/toggleterm')
require('sohooo/gitsigns')
require('sohooo/lualine')
require('sohooo/noice')
require('sohooo/nvim-tree')
require('sohooo/focus')
require('sohooo/neotest')
require('mini.align').setup()
require("ibl").setup()
require('undotree').setup()
require('tabout').setup()
-- https://github.com/j-hui/fidget.nvim/blob/main/doc/fidget.md
require('fidget').setup({
progress = {
display = {
done_ttl = 6, -- def: 3
}
}
})
require('sohooo/rust-tools') -- included now in lsp-zero
if Hifi() then
require('colorizer').setup()
end
require('Comment').setup()
require('goto-preview').setup{}
require('nvim-autopairs').setup{}
require('leap').set_default_keymaps()
require('tint').setup()
require('numb').setup()
-- require("ibl").setup() -- v3
require('sohooo/autocmds')
require('sohooo/which-key')
-- }}}