-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinit.lua
More file actions
155 lines (140 loc) · 4.04 KB
/
init.lua
File metadata and controls
155 lines (140 loc) · 4.04 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
local vimrc = vim.fn.stdpath("config") .. "/config.vim"
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
-- Add this to your init.lua
vim.o.autoread = true
-- Trigger checktime on various events
vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold", "CursorHoldI" }, {
callback = function()
if vim.fn.mode() ~= 'c' then
vim.cmd('checktime')
end
end,
})
-- Provider config
vim.g.loaded_perl_provider = 0
-- vim.g:python3_host_prog = '/usr/bin/python3'
-- vim.g:pip3_host_prog = '/usr/bin/pip3'
-- HACK: disable deprecation notices
--vim.deprecate = function() end
vim.lsp.set_log_level(vim.log.levels.ERROR)
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup(
{
{ "brentlintner/twilighted.vim", },
{ "sainnhe/everforest", },
{ "tribela/vim-transparent", },
{ "kchmck/vim-coffee-script", },
{ "tpope/vim-rails", },
{ "airblade/vim-gitgutter", },
{ "editorconfig/editorconfig-vim", },
{ "elzr/vim-json", },
{ "ctrlpvim/ctrlp.vim", },
{ "mileszs/ack.vim", },
{ "ntpeters/vim-better-whitespace", },
{ "scrooloose/nerdcommenter", },
{ "scrooloose/nerdtree", enabled = false },
{ "ryanoasis/vim-devicons", enabled = false },
{ "nvim-tree/nvim-tree.lua" },
{ "nvim-tree/nvim-web-devicons", opts = {} },
{ "tpope/vim-endwise", },
{ "tpope/vim-surround", },
{ "neoclide/coc.nvim", branch = "release", },
{ "brentlintner/vista.vim", },
{ "dense-analysis/ale", },
{ "tpope/vim-fugitive", },
{ "rhysd/git-messenger.vim", },
{ "slim-template/vim-slim", },
{ "brentlintner/RootIgnore", },
{ "HakonHarnes/img-clip.nvim", },
{ "github/copilot.vim", },
{ "nvim-treesitter/nvim-treesitter",
branch = "master", -- Use master for frozen backwards compatibility for now
config = function()
require("nvim-treesitter.configs").setup {
ensure_installed = {
"c",
"lua",
"vim",
"vimdoc",
"query",
"javascript",
"scss",
"bash",
"comment",
"dart",
"go",
"php",
"python",
"regex",
"sql",
"typescript",
--"ruby"
},
sync_install = false,
auto_install = false,
indent = {
enable = true,
},
highlight = {
enable = true,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
}
end,
},
},
{}
)
require("nvim-tree").setup({
renderer = {
group_empty = true,
},
filters = {
dotfiles = false,
},
filesystem_watchers = {
enable = false,
debounce_delay = 50,
ignore_dirs = {
"node_modules",
".git",
"build",
"dist",
"playright-report"
},
},
git = {
enable = false,
ignore = false,
},
view = {
centralize_selection = false,
cursorline = false,
cursorlineopt = "both",
},
renderer = {
root_folder_label = false
},
})
-- HACK: Disable statusline when nvim-tree is open (use lua-statusline or something)
require('nvim-tree.api').events.subscribe("TreeOpen", function ()
vim.wo.statusline = ' '
end)
vim.cmd.source(vimrc)