summaryrefslogblamecommitdiffstats
path: root/.config/nvim/lua/plugins.lua
blob: bb7a7b47258be5a4abc80d49b722bf1bf1bfdeb2 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
                









                                                                             
             

                          
          


                    


                                                  

                                      
                                                 




                                                        




                         





                           









                                 
             








                                                                              


                                            



             
























                                                                          
 
                    











                                                                       
                                                          





                                        





                               
               


                






                                 








                               






                         

                     
    
 



                         


                          
                                                                                                     





                                                                                                              
-- 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({
    'git', 'clone', '--depth=1',
    'https://github.com/savq/paq-nvim.git',
    install_path
  })
  vim.cmd 'packadd paq-nvim'
end

-- enable paq
vim.cmd 'packadd paq-nvim'

-- plugins
require('paq') {
  {'savq/paq-nvim'};

  -- treesiter / lsp
  {'nvim-treesitter/playground'};
  {'nvim-treesitter/nvim-treesitter-textobjects'};
  {
    'nvim-treesitter/nvim-treesitter',
    run=vim.api.nvim_command(':silent! TSUpdate')
  };
  {
    'neovim/nvim-lspconfig',
    run='python3 -m pipx install python-lsp-server[all]'
  };

  -- utils
  {'folke/trouble.nvim'};
  {'hrsh7th/nvim-compe'};

  {'hrsh7th/cmp-nvim-lsp'};
  {'hrsh7th/cmp-cmdline'};
  {'hrsh7th/cmp-buffer'};
  {'hrsh7th/cmp-path'};
  {'hrsh7th/cmp-calc'};
  {'hrsh7th/nvim-cmp'};

  -- indent
  {'lewis6991/gitsigns.nvim'};
  {'glepnir/indent-guides.nvim'};
  {'darazaki/indent-o-matic'};

  -- dep
  {'nvim-lua/plenary.nvim'};
}

-- treesitter

local parser_configs = require('nvim-treesitter.parsers').get_parser_configs()

require('nvim-treesitter.configs').setup {
  ensure_installed = 'maintained',
  ignore_install =  {
    'verilog',
    'kotlin'
  },
  highlight = { enable = true },
  incremental_selection = { enable = true },
  textobjects = { enable = true }
}

-- completion

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

local lsputil = require('lspconfig/util')
local python_venv = require('utils').get_python_venv()
require('lspconfig').pylsp.setup{
  cmd = {'pylsp', '-v'},
  cmd_env = {
    VIRTUAL_ENV = python_venv,
    PATH = lsputil.path.join(python_venv, 'bin') .. ':' .. vim.env.PATH
  },
}

require('lspconfig').clangd.setup{}
require('lspconfig').elixirls.setup{ cmd = {'elixir-ls'} }
require('lspconfig').eslint.setup{}
require('lspconfig').terraformls.setup{}

-- org

require('trouble').setup{}

-- syntactic sugar

require('indent_guides').setup{
  indent_enable=true;
  exclude_filetypes={
    'calendar',
    'gitcommit',
    'help',
    'NvimTree',
  };
}

require('indent-o-matic').setup {
  max_lines = 0,
  standard_widths = { 2, 4, 8 },

  filetype_ = {
    standard_widths = { 2, 4 },
  },

  filetype_css = {
    max_lines = 4096,
  },

  filetype_scss = {
    max_lines = 4096,
  },

  filetype_javascript = {
    max_lines = 4096,
  },

  filetype_json = {
    max_lines = 4096,
  },

  filetype_typescript = {
    max_lines = 4096,
  },
}

require('gitsigns').setup{
  signs = {
    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'},
    changedelete = {hl = 'GitSignsChange', text = '▍', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
  }
}
remember that computers suck.