-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
106 lines (88 loc) · 2.47 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
--[[ init.lua ]]
-- LEADER
-- These keybindings need to be defined before the first /
-- is called; otherwise, it will default to "\"
vim.g.mapleader = ","
vim.g.localleader = "\\"
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- Show whitespace characters
vim.wo.list = true
vim.wo.listchars = 'space:.,tab:>-,trail:~,extends:>,precedes:<'
-- IMPORTS
require('plug') -- Vim-Plug
require('vars') -- Variables
require('opts') -- Options
require('pack') -- Packer (Package manager)
require('keys') -- Keybindings
local is_wsl = (function()
local output = vim.fn.systemlist "uname -r"
return not not string.find(output[1] or "", "WSL")
end)()
-- CLIPBOARD
-- https://github.com/equalsraf/win32yank/releases
if is_wsl then
vim.g.clipboard = {
name = "win32yank-wsl",
copy = {
["+"] = "win32yank.exe -i --crlf",
["*"] = "win32yank.exe -i --crlf"
},
paste = {
["+"] = "win32yank.exe -o --lf",
["*"] = "win32yank.exe -o --lf"
},
cache_enable = 0,
}
end
-- THEME SETUP
-- https://github.com/navarasu/onedark.nvim
require('onedark').setup {
highlights = {
["Comment"] = {fg = '#999999'},
}
}
require('onedark').load()
-- TREE SETUP
-- https://github.com/nvim-tree/nvim-tree.lua
require("nvim-tree").setup()
-- TABS<A-,>
-- https://github.com/romgrk/barbar.nvim
require'bufferline'.setup {
animation = true,
icons = true,
auto_hide = true,
tabpages = true,
closable = true,
clickable = true,
}
-- Align tabs correctly when using the nvim-tree plugin.
-- https://github.com/romgrk/barbar.nvim#usage
local nvim_tree_events = require('nvim-tree.events')
local bufferline_api = require('bufferline.api')
local function get_tree_size()
return require'nvim-tree.view'.View.width
end
nvim_tree_events.subscribe('TreeOpen', function()
bufferline_api.set_offset(get_tree_size())
end)
nvim_tree_events.subscribe('Resize', function()
bufferline_api.set_offset(get_tree_size())
end)
nvim_tree_events.subscribe('TreeClose', function()
bufferline_api.set_offset(0)
end)
-- STATUSBAR
-- https://github.com/ojroques/nvim-hardline
require('hardline').setup {}
-- SCROLLBAR
-- https://github.com/petertriho/nvim-scrollbar
require("scrollbar").setup()
-- COMMAND AUTOCOMPLETION
-- https://github.com/gelguy/wilder.nvim
local wilder = require('wilder')
wilder.setup({modes = {':', '/', '?'}})
-- KEYBINDING HINTS
-- https://github.com/folke/which-key.nvim
local wk = require("which-key")
wk.register()