add telescope, haskell-tools and a C language server

This commit is contained in:
Nydragon 2023-02-14 23:59:58 +01:00
parent 724ebb9838
commit 25c57ba788
5 changed files with 59 additions and 2 deletions

View file

@ -8,6 +8,7 @@ set expandtab
set shiftwidth=4
set autoindent
set completeopt=menu,menuone,noselect
filetype plugin on
lua require('plugins')

View file

@ -0,0 +1,21 @@
local ht = require('haskell-tools')
local def_opts = { noremap = true, silent = true, }
ht.setup {
hls = {
on_attach = function(client, bufnr)
local opts = vim.tbl_extend('keep', def_opts, { buffer = bufnr, })
-- haskell-language-server relies heavily on codeLenses,
-- so auto-refresh (see advanced configuration) is enabled by default
vim.keymap.set('n', '<space>ca', vim.lsp.codelens.run, opts)
vim.keymap.set('n', '<space>hs', ht.hoogle.hoogle_signature, opts)
end,
},
}
-- Suggested keymaps that do not depend on haskell-language-server
-- Toggle a GHCi repl for the current package
vim.keymap.set('n', '<leader>rr', ht.repl.toggle, def_opts)
-- Toggle a GHCi repl for the current buffer
vim.keymap.set('n', '<leader>rf', function()
ht.repl.toggle(vim.api.nvim_buf_get_name(0))
end, def_opts)
vim.keymap.set('n', '<leader>rq', ht.repl.quit, def_opts)

View file

@ -41,3 +41,5 @@ require('lspconfig')['pyright'].setup {
on_attach = on_attach,
flags = lsp_flags,
}
require'lspconfig'.clangd.setup{}

View file

@ -34,14 +34,22 @@ return require('packer').startup(function(use)
use 'nvim-treesitter/nvim-treesitter'
use 'neovim/nvim-lspconfig' -- Configurations for Nvim LSP
-- (batch)commenting tool
use 'preservim/nerdcommenter'
use "lukas-reineke/indent-blankline.nvim"
-- themeing
use "EdenEast/nightfox.nvim"
-- thin bar indicating an arbitray character limit
use "lukas-reineke/virt-column.nvim"
-- fuzzy file finder
use 'nvim-telescope/telescope.nvim'
-- autocompletion engine, plugs into lsp
use {
"hrsh7th/nvim-cmp",
requires = {
@ -53,6 +61,7 @@ return require('packer').startup(function(use)
}
}
-- renders images in nvim
use {
'samodostal/image.nvim',
requires = {
@ -61,6 +70,17 @@ return require('packer').startup(function(use)
},
}
use {
'mrcjkb/haskell-tools.nvim',
requires = {
'nvim-lua/plenary.nvim',
'nvim-telescope/telescope.nvim'
},
branch = '1.x.x',
}
use 'dense-analysis/ale'
vim.cmd([[
augroup packer_user_config
autocmd!
@ -74,9 +94,14 @@ return require('packer').startup(function(use)
require('nvim-tree-config')
require('nvim-cmp-config')
require('image-config')
require('haskell-config')
require('telescope-config')
require('lualine').setup()
require("virt-column").setup()
vim.g.ale_linters = { haskell = {'hlint', 'hdevtools', 'hfmt'} }
if packer_bootstrap then
require('packer').sync()
end

View file

@ -0,0 +1,8 @@
require('telescope').setup()
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})