summaryrefslogtreecommitdiffstats
path: root/.config/nvim
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2022-02-03 21:31:55 +0100
committerRomain Gonçalves <me@rgoncalves.se>2022-02-03 21:31:55 +0100
commit703ed1915c69911a95cab6e1fb6524629c976800 (patch)
tree1e4063eeace827aa557e910aa502ee173dd6e4ab /.config/nvim
parentd64d4a6a3924e144fe49b3d956320b37786a738a (diff)
downloaddots-703ed1915c69911a95cab6e1fb6524629c976800.tar.gz
Thu Feb 3 09:31:55 PM CET 2022
Diffstat (limited to '.config/nvim')
-rwxr-xr-x.config/nvim/after/ftplugin/elixir.lua4
-rwxr-xr-x.config/nvim/after/ftplugin/tsplayground.lua3
-rwxr-xr-x.config/nvim/lua/plugins.lua107
3 files changed, 70 insertions, 44 deletions
diff --git a/.config/nvim/after/ftplugin/elixir.lua b/.config/nvim/after/ftplugin/elixir.lua
new file mode 100755
index 0000000..db9c53f
--- /dev/null
+++ b/.config/nvim/after/ftplugin/elixir.lua
@@ -0,0 +1,4 @@
+bo.tabstop = 2
+bo.shiftwidth = 2
+bo.expandtab = true
+o.colorcolumn = '98'
diff --git a/.config/nvim/after/ftplugin/tsplayground.lua b/.config/nvim/after/ftplugin/tsplayground.lua
new file mode 100755
index 0000000..b300057
--- /dev/null
+++ b/.config/nvim/after/ftplugin/tsplayground.lua
@@ -0,0 +1,3 @@
+bo.tabstop = 2
+bo.shiftwidth = 2
+bo.expandtab = true
diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua
index 24736eb..bb7a7b4 100755
--- a/.config/nvim/lua/plugins.lua
+++ b/.config/nvim/lua/plugins.lua
@@ -1,8 +1,4 @@
---[[
--- Plugins
---]]
-
--- Bootstrap for Paq
+-- bootstrap paq
local install_path = vim.fn.stdpath('data')..'/site/pack/paqs/start/paq-nvim'
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
vim.fn.system({
@@ -13,34 +9,35 @@ if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
vim.cmd 'packadd paq-nvim'
end
--- Enable Paq
+-- enable paq
vim.cmd 'packadd paq-nvim'
--- Plugin list
+-- plugins
require('paq') {
{'savq/paq-nvim'};
- -- lsp
+ -- treesiter / lsp
+ {'nvim-treesitter/playground'};
+ {'nvim-treesitter/nvim-treesitter-textobjects'};
{
'nvim-treesitter/nvim-treesitter',
- run=':TSUpdate'
+ run=vim.api.nvim_command(':silent! TSUpdate')
};
{
'neovim/nvim-lspconfig',
run='python3 -m pipx install python-lsp-server[all]'
};
- {
- 'numirias/semshi',
- run=':UpdateRemotePlugins'
- };
-- utils
{'folke/trouble.nvim'};
{'hrsh7th/nvim-compe'};
- -- org
- {'TimUntersberger/neogit'};
- {'kyazdani42/nvim-tree.lua'};
+ {'hrsh7th/cmp-nvim-lsp'};
+ {'hrsh7th/cmp-cmdline'};
+ {'hrsh7th/cmp-buffer'};
+ {'hrsh7th/cmp-path'};
+ {'hrsh7th/cmp-calc'};
+ {'hrsh7th/nvim-cmp'};
-- indent
{'lewis6991/gitsigns.nvim'};
@@ -51,7 +48,7 @@ require('paq') {
{'nvim-lua/plenary.nvim'};
}
--- Treesitter
+-- treesitter
local parser_configs = require('nvim-treesitter.parsers').get_parser_configs()
@@ -61,29 +58,40 @@ require('nvim-treesitter.configs').setup {
'verilog',
'kotlin'
},
- highlight = {
- enable = true,
- }
+ highlight = { enable = true },
+ incremental_selection = { enable = true },
+ textobjects = { enable = true }
}
-- completion
-require('compe').setup {
- enabled = true,
- source = {
- path = true;
- buffer = true;
- calc = true;
- nvim_lsp = true;
- nvim_lua = true;
- vsnip = true;
- ultisnips = true;
- luasnip = true;
- neorg = true;
- };
-}
+local cmp = require('cmp')
+
+cmp.setup({
+ mapping = {
+ ['<C-l>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
+ ['<C-j>'] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 'c' }),
+ ['<C-k>'] = cmp.mapping(cmp.mapping.select_prev_item(), { 'i', 'c' }),
+ ['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
+ },
+ sources = cmp.config.sources({
+ { name = 'nvim_lsp' },
+ { name = 'cmdline' },
+ { name = 'path' },
+ { name = 'calc' }
+ },
+ {
+ { name = 'buffer' }
+ })
+})
+
+cmp.setup.cmdline('/', {
+ sources = {
+ { name = 'buffer' }
+ }
+})
--- LSP configuration
+-- lsp configuration
local lsputil = require('lspconfig/util')
local python_venv = require('utils').get_python_venv()
@@ -96,22 +104,23 @@ require('lspconfig').pylsp.setup{
}
require('lspconfig').clangd.setup{}
+require('lspconfig').elixirls.setup{ cmd = {'elixir-ls'} }
require('lspconfig').eslint.setup{}
require('lspconfig').terraformls.setup{}
-- org
require('trouble').setup{}
-require('neogit').setup{}
-- syntactic sugar
require('indent_guides').setup{
indent_enable=true;
exclude_filetypes={
- 'help',
'calendar',
- 'NvimTree'
+ 'gitcommit',
+ 'help',
+ 'NvimTree',
};
}
@@ -119,7 +128,15 @@ require('indent-o-matic').setup {
max_lines = 0,
standard_widths = { 2, 4, 8 },
- filetype_typescript = {
+ filetype_ = {
+ standard_widths = { 2, 4 },
+ },
+
+ filetype_css = {
+ max_lines = 4096,
+ },
+
+ filetype_scss = {
max_lines = 4096,
},
@@ -127,16 +144,18 @@ require('indent-o-matic').setup {
max_lines = 4096,
},
- filetype_ = {
- standard_widths = { 2, 4 },
+ filetype_json = {
+ max_lines = 4096,
},
-}
-vim.g['semshi#update_delay_factor'] = 0.0001
+ filetype_typescript = {
+ max_lines = 4096,
+ },
+}
require('gitsigns').setup{
signs = {
- add = {hl = 'GitSignsAdd' , text = '▍', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'},
+ add = {hl = 'GitSignsAdd', text = '▍', numhl='GitSignsAddNr', linehl='GitSignsAddLn'},
change = {hl = 'GitSignsChange', text = '▍', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
delete = {hl = 'GitSignsDelete', text = '▍', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
topdelete = {hl = 'GitSignsDelete', text = '▍', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
remember that computers suck.