aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/plugins/cmp.lua157
-rw-r--r--lua/plugins/colorizer.lua6
-rw-r--r--lua/plugins/colorscheme.lua6
-rw-r--r--lua/plugins/devicons.lua11
-rw-r--r--lua/plugins/fzf.lua4
-rw-r--r--lua/plugins/gitsigns.lua6
-rw-r--r--lua/plugins/lspsaga.lua10
-rw-r--r--lua/plugins/orgmode.lua11
-rw-r--r--lua/plugins/popup.lua5
-rw-r--r--lua/plugins/telescope.lua15
-rw-r--r--lua/plugins/treesitter.lua20
11 files changed, 251 insertions, 0 deletions
diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua
new file mode 100644
index 0000000..1eb9646
--- /dev/null
+++ b/lua/plugins/cmp.lua
@@ -0,0 +1,157 @@
1return {
2 {
3 'hrsh7th/nvim-cmp',
4 dependencies = {
5 'nvim-lua/popup.nvim',
6 'nvim-lua/plenary.nvim',
7 'saadparwaiz1/cmp_luasnip',
8 "hrsh7th/cmp-emoji",
9 'hrsh7th/cmp-nvim-lsp',
10 'hrsh7th/cmp-buffer',
11 'hrsh7th/cmp-path',
12 'hrsh7th/vim-vsnip',
13 'octaltree/cmp-look',
14 'folke/trouble.nvim',
15 {
16 'L3MON4D3/LuaSnip',
17 config = function()
18 vim.keymap.set(
19 {"i", "s"},
20 "<leader><Tab>",
21 function() require('luasnip').jump(1) end,
22 {silent = true}
23 )
24 vim.keymap.set(
25 {"i", "s"},
26 "<leader><S-Tab>",
27 function() require('luasnip').jump(-1) end,
28 {silent = true}
29 )
30 end,
31 },
32 },
33
34 config = function()
35 require('trouble').setup()
36
37 local cmp = require'cmp'
38 cmp.setup({
39 snippet = {
40 -- REQUIRED - you must specify a snippet engine
41 expand = function(args)
42 require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
43 -- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
44 end,
45 },
46 window = {
47 completion = cmp.config.window.bordered(),
48 documentation = cmp.config.window.bordered(),
49 },
50 mapping = cmp.mapping.preset.insert({
51 ['<C-b>'] = cmp.mapping.scroll_docs(-4),
52 ['<C-f>'] = cmp.mapping.scroll_docs(4),
53 ['<C-Space>'] = cmp.mapping.complete(),
54 ['<C-e>'] = cmp.mapping.abort(),
55 ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
56 }),
57 sources = cmp.config.sources({
58 { name = 'nvim_lsp' },
59 { name = 'luasnip' }, -- For luasnip users.
60 }, {
61 { name = 'buffer' },
62 })
63 })
64 end
65 },
66 {
67 'neovim/nvim-lspconfig',
68 dependencies = {
69 { "folke/neodev.nvim" }
70 },
71 config = function()
72 -- Set up lspconfig.
73 local keymap = vim.keymap
74 local on_attach = function(client, bufnr)
75 local opts = { noremap = true, silent = true, buffer = bufnr }
76 keymap.set("n", "gf", "<cmd>Lspsaga lsp_finder<CR>", opts) -- show definition, references
77 keymap.set("n", "gD", "<Cmd>Lspsaga goto_definition<CR>", opts) -- got to declaration
78 keymap.set("n", "gd", "<cmd>Lspsaga peek_definition<CR>", opts) -- see definition and make edits in window
79 keymap.set("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts) -- go to implementation
80 keymap.set("n", "<leader>ca", "<cmd>Lspsaga code_action<CR>", opts) -- see available code actions
81 keymap.set("n", "<leader>rn", "<cmd>Lspsaga rename<CR>", opts) -- smart rename
82 keymap.set("n", "<leader>D", "<cmd>Lspsaga show_line_diagnostics<CR>", opts) -- show diagnostics for line
83 keymap.set("n", "<leader>d", "<cmd>Lspsaga show_cursor_diagnostics<CR>", opts) -- show diagnostics for cursor
84 keymap.set("n", "[d", "<cmd>Lspsaga diagnostic_jump_prev<CR>", opts) -- jump to previous diagnostic in buffer
85 keymap.set("n", "]d", "<cmd>Lspsaga diagnostic_jump_next<CR>", opts) -- jump to next diagnostic in buffer
86 keymap.set("n", "K", "<cmd>Lspsaga hover_doc<CR>", opts) -- show documentation for what is under cursor
87 keymap.set("n", "<leader>o", "<cmd>LSoutlineToggle<CR>", opts) -- see outline on right hand side
88 keymap.set("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
89 vim.keymap.set("n", "<C-n>", ":cnext<CR>")
90 vim.keymap.set("n", "<C-p>", ":cprev<CR>")
91 end
92
93 local capabilities = require("cmp_nvim_lsp").default_capabilities()
94
95 -- # Language Servers
96 -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
97 for _,server in ipairs({
98 'bitbake_language_server',
99 "clangd", -- C/C++ | clang
100 "ts_ls", -- javascript | typescript-language-server
101 "lua_ls", -- lua (but not init.lua entirely, hence why neodev)
102 "jdtls",
103 "html",
104 "cssls", -- ccs | vscode-css-languageserver
105 "rust_analyzer", -- rust | rust-analyzer
106 "eslint", -- javascript | eslint
107 'vimls', -- vimscript | vim-language-server
108 'html', -- html
109 'jsonls', -- jsonls
110 "pyright", -- python
111 "bashls", -- bash | bash-language-server
112 "gopls",
113 "emmet_ls",
114 "marksman"}) do
115 require("lspconfig")[server].setup({
116 capabilities = capabilities,
117 on_attach = on_attach
118 })
119 end
120
121 -- # specialized config for some LSPs which have non-ideal defaults
122 --
123 -- require('lspconfig')['java_language_server'].setup{ cmd = { "/usr/share/java/java-language-server/lang_server_linux.sh" }, root_dir = function () return vim.fn.getcwd() end }
124 -- configure html server
125 require('lspconfig')["html"].setup({
126 init_options = {
127 configurationSection = { "html", "css", "javascript" },
128 embeddedLanguages = {
129 css = true,
130 javascript = true,
131 },
132 provideFormatter = true,
133 },
134 })
135 require('lspconfig')['pylsp'].setup{
136 settings = {
137 pylsp = {
138 plugins = {
139 pycodestyle = {
140 ignore = {'W391'},
141 maxLineLength = 100
142 }
143 }
144 }
145 }
146 }
147 require("lspconfig").clangd.setup {
148 on_attach = on_attach,
149 capabilities = capabilities,
150 cmd = {
151 "clangd",
152 "--offset-encoding=utf-16",
153 },
154 }
155 end
156 }
157}
diff --git a/lua/plugins/colorizer.lua b/lua/plugins/colorizer.lua
new file mode 100644
index 0000000..416f2d1
--- /dev/null
+++ b/lua/plugins/colorizer.lua
@@ -0,0 +1,6 @@
1return {
2 'norcalli/nvim-colorizer.lua',
3 config = function()
4 require('colorizer').setup()
5 end,
6}
diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua
new file mode 100644
index 0000000..a73b1e8
--- /dev/null
+++ b/lua/plugins/colorscheme.lua
@@ -0,0 +1,6 @@
1return {
2 'RRethy/base16-nvim',
3 config = function()
4 vim.cmd.colorscheme "base16-rebecca"
5 end,
6}
diff --git a/lua/plugins/devicons.lua b/lua/plugins/devicons.lua
new file mode 100644
index 0000000..9e69c5f
--- /dev/null
+++ b/lua/plugins/devicons.lua
@@ -0,0 +1,11 @@
1
2return {
3 'nvim-tree/nvim-web-devicons',
4 config = function()
5 require'nvim-web-devicons'.setup {
6 color_icons = true;
7 default = true;
8 strict = true;
9 }
10 end,
11}
diff --git a/lua/plugins/fzf.lua b/lua/plugins/fzf.lua
new file mode 100644
index 0000000..f3fc76b
--- /dev/null
+++ b/lua/plugins/fzf.lua
@@ -0,0 +1,4 @@
1return {
2 'junegunn/fzf',
3 'junegunn/fzf.vim',
4}
diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua
new file mode 100644
index 0000000..d88bf68
--- /dev/null
+++ b/lua/plugins/gitsigns.lua
@@ -0,0 +1,6 @@
1return {
2 'lewis6991/gitsigns.nvim',
3 config = function()
4 require('gitsigns').setup()
5 end,
6}
diff --git a/lua/plugins/lspsaga.lua b/lua/plugins/lspsaga.lua
new file mode 100644
index 0000000..ff7867b
--- /dev/null
+++ b/lua/plugins/lspsaga.lua
@@ -0,0 +1,10 @@
1return {
2 'nvimdev/lspsaga.nvim',
3 config = function()
4 require('lspsaga').setup({})
5 end,
6 dependencies = {
7 'nvim-treesitter/nvim-treesitter', -- optional
8 'nvim-tree/nvim-web-devicons', -- optional
9 }
10}
diff --git a/lua/plugins/orgmode.lua b/lua/plugins/orgmode.lua
new file mode 100644
index 0000000..a9d6ea0
--- /dev/null
+++ b/lua/plugins/orgmode.lua
@@ -0,0 +1,11 @@
1return {
2 'nvim-orgmode/orgmode',
3 event = 'VeryLazy',
4 ft = { 'org' },
5 config = function()
6 require('orgmode').setup({
7 org_agenda_files = '~/orgfiles/**/*',
8 org_default_notes_file = '~/orgfiles/refile.org',
9 })
10 end,
11}
diff --git a/lua/plugins/popup.lua b/lua/plugins/popup.lua
new file mode 100644
index 0000000..0ff2e3a
--- /dev/null
+++ b/lua/plugins/popup.lua
@@ -0,0 +1,5 @@
1return {
2 'nvim-lua/plenary.nvim',
3 'nvim-lua/popup.nvim',
4}
5
diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua
new file mode 100644
index 0000000..fee09df
--- /dev/null
+++ b/lua/plugins/telescope.lua
@@ -0,0 +1,15 @@
1return {
2 'nvim-telescope/telescope.nvim',
3 dependencies = {
4 'nvim-telescope/telescope-media-files.nvim'
5 },
6 config = function()
7 require('telescope').load_extension('media_files')
8
9 local builtin = require('telescope.builtin')
10 vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
11 vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
12 vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
13 vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
14 end,
15}
diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua
new file mode 100644
index 0000000..9673f63
--- /dev/null
+++ b/lua/plugins/treesitter.lua
@@ -0,0 +1,20 @@
1return {
2 -- treesitter is experimental and breaks indentation on xml, html with `=`
3 -- treesitter is optional for orgmode, but without it syntax highlighting in
4 -- org files is broken
5 'nvim-treesitter/nvim-treesitter',
6 config = function()
7 require'nvim-treesitter.configs'.setup {
8 ensure_installed = {"c", "html", "css", "javascript", "org"},
9 sync_install = false,
10 auto_install = true,
11 ignore_install = {},
12 disable = { },
13 modules = { "all" },
14 highlight = {
15 enable = true,
16 }
17 }
18 end
19}
20
..