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
|
-- auto install packer if not installed
local ensure_packer = function()
local fn = vim.fn
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path })
vim.cmd([[packadd packer.nvim]])
return true
end
return false
end
local packer_bootstrap = ensure_packer() -- true if packer was just installed
-- autocommand that reloads neovim and installs/updates/removes plugins
-- when file is saved
vim.cmd([[
augroup packer_user_config
autocmd!
autocmd BufWritePost plugins-setup.lua source <afile> | PackerSync
augroup end
]])
-- import packer safely
local status, packer = pcall(require, "packer")
if not status then
return
end
-- add list of plugins to install
return packer.startup(function(use)
-- packer can manage itself
use("wbthomason/packer.nvim")
use("nvim-lua/plenary.nvim") -- lua functions that many plugins use
-- transparent background
use("xiyaowong/transparent.nvim")
-- Color Scheme is here!!!
use("webhooked/kanso.nvim") -- preferred colorscheme atm
use("szw/vim-maximizer") -- maximizes and restores current window
use("tpope/vim-surround") -- add, delete, change surroundings (it's awesome)
use("inkarkat/vim-ReplaceWithRegister") -- replace with register contents using motion (gr + motion)
-- file explorer
use({ "stevearc/oil.nvim" })
-- extension(s) to oil
use({
"JezerM/oil-lsp-diagnostics.nvim",
"nvim-tree/nvim-web-devicons", -- actually important
requires = { "stevearc/oil.nvim" },
})
-- statusline
use("nvim-lualine/lualine.nvim")
-- fuzzy finding w/ telescope
use({ "nvim-telescope/telescope-fzf-native.nvim", run = "make" }) -- dependency for better sorting performance
use({
"nvim-telescope/telescope.nvim",
branch = "0.1.x",
}) -- fuzzy finder
-- autocompletion
use("hrsh7th/nvim-cmp") -- completion plugin
use("hrsh7th/cmp-buffer") -- source for text in buffer
use("hrsh7th/cmp-path") -- source for file system paths
-- snippets
use("L3MON4D3/LuaSnip") -- snippet engine
use("saadparwaiz1/cmp_luasnip") -- for autocompletion
use("rafamadriz/friendly-snippets") -- useful snippets
-- managing & installing lsp servers, linters & formatters
use("williamboman/mason.nvim") -- in charge of managing lsp servers, linters & formatters
use("williamboman/mason-lspconfig.nvim") -- bridges gap b/w mason & lspconfig
use("mfussenegger/nvim-lint") -- installed because of mypy linter
-- configuring lsp servers
use("neovim/nvim-lspconfig") -- easily configure language servers
use("hrsh7th/cmp-nvim-lsp") -- for autocompletion
use({
"nvimdev/lspsaga.nvim",
after = "nvim-lspconfig",
config = function()
require("lspsaga").setup({
-- keybinds for navigation in lspsaga window
scroll_preview = { scroll_down = "<C-f>", scroll_up = "<C-b>" },
-- use enter to open file with definition preview
definition = {
edit = "<CR>",
},
ui = {
colors = {
normal_bg = "#022746",
},
},
})
end,
})
-- vs-code like icons for autocompletion
use("onsails/lspkind.nvim")
-- treesitter configuration
use({
"nvim-treesitter/nvim-treesitter",
run = function()
local ts_update = require("nvim-treesitter.install").update({ with_sync = true })
ts_update()
end,
})
-- dadbod for Databases
use({
"kristijanhusak/vim-dadbod-ui",
requires = { "tpope/vim-dadbod" },
})
-- auto closing
use("windwp/nvim-autopairs") -- autoclose parens, brackets, quotes, etc...
use({
"windwp/nvim-ts-autotag", -- autoclose tags
requires = {
"nvim-treesitter/nvim-treesitter",
},
config = function()
require("nvim-ts-autotag").setup()
end,
})
-- git integration
use("lewis6991/gitsigns.nvim") -- show line modifications on left hand side
-- nvim-formatter
require("packer").use({ "mhartington/formatter.nvim" })
-- toggle terminal
use({
"akinsho/toggleterm.nvim",
tag = "*",
config = function()
require("toggleterm").setup({
size = 15,
direction = "horizontal",
autochdir = false,
})
end,
})
-- Markdown Preview
use({
"iamcco/markdown-preview.nvim",
run = "cd app && npm install",
setup = function()
vim.g.mkdp_filetypes = { "markdown" }
end,
ft = { "markdown" },
})
-- vimtex for LaTeX files
use("lervag/vimtex")
-- dap and dapui
use({
"rcarriga/nvim-dap-ui",
requires = {
"mfussenegger/nvim-dap",
"nvim-neotest/nvim-nio",
},
})
if packer_bootstrap then
require("packer").sync()
end
end)
|