Add more language servers

This commit is contained in:
Thomas Avé 2022-07-03 14:30:11 +02:00
parent f557c593f9
commit 99c77a446a
5 changed files with 62 additions and 18 deletions

View File

@ -1,13 +1,14 @@
" vim-plug " vim-plug
call plug#begin() call plug#begin()
Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' }
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'williamboman/nvim-lsp-installer' Plug 'williamboman/nvim-lsp-installer'
Plug 'nixprime/cpsm', {'do': './install.sh'}
Plug 'kien/ctrlp.vim'
Plug 'prabirshrestha/vim-lsp' Plug 'prabirshrestha/vim-lsp'
Plug 'prabirshrestha/asyncomplete-lsp.vim' Plug 'prabirshrestha/asyncomplete-lsp.vim'
Plug 'ConradIrwin/vim-bracketed-paste' Plug 'ConradIrwin/vim-bracketed-paste'
Plug 'christoomey/vim-tmux-navigator' Plug 'christoomey/vim-tmux-navigator'
Plug 'cohama/lexima.vim', {'do': 'sed -i \"s/has(.nvim.) && //\" autoload/lexima/insmode.vim'} Plug 'cohama/lexima.vim'
Plug 'editorconfig/editorconfig-vim' Plug 'editorconfig/editorconfig-vim'
Plug 'kristijanhusak/vim-hybrid-material' Plug 'kristijanhusak/vim-hybrid-material'
Plug 'lervag/vimtex' Plug 'lervag/vimtex'
@ -32,6 +33,12 @@ Plug 'hrsh7th/vim-vsnip'
call plug#end() call plug#end()
:lua require('lsp_config') :lua require('lsp_config')
:lua require('telescope-config')
let python_highlight_all=1
let g:solarized_termcolors=256
let g:airline_powerline_fonts = 1
let mapleader=","
set autoindent set autoindent
set background=dark set background=dark
@ -78,11 +85,8 @@ vnoremap u y
nnoremap <C-U> <C-O> nnoremap <C-U> <C-O>
nnoremap <C-E> <C-U> nnoremap <C-E> <C-U>
nnoremap <leader><space> :noh<CR> nnoremap <leader><space> :noh<CR>
nnoremap <C-o> <cmd>Telescope buffers<cr>
let python_highlight_all=1 nnoremap <leader>/ <cmd>lua require('telescope.builtin').live_grep{ cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] }<cr>
let g:solarized_termcolors=256
let g:airline_powerline_fonts = 1
let mapleader=","
colorscheme hybrid_material colorscheme hybrid_material
syntax enable syntax enable
@ -95,13 +99,6 @@ let g:vimwiki_markdown_link_ext = 1
autocmd FileType vimwiki setlocal shiftwidth=2 softtabstop=2 expandtab autocmd FileType vimwiki setlocal shiftwidth=2 softtabstop=2 expandtab
" CtrlP
let g:ctrlp_match_func = {'match': 'cpsm#CtrlPMatch'}
nnoremap <silent> <C-o> :CtrlPBuffer<CR>
let g:cpsm_unicode=1
let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard']
" Allow xterm-key usage inside tmux " Allow xterm-key usage inside tmux
execute "set <xUp>=\e[1;*A" execute "set <xUp>=\e[1;*A"
execute "set <xDown>=\e[1;*B" execute "set <xDown>=\e[1;*B"

View File

@ -82,17 +82,41 @@ local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protoco
require("nvim-lsp-installer").setup({ require("nvim-lsp-installer").setup({
automatic_installation = true, -- automatically detect which servers to install (based on which servers are set up via lspconfig) automatic_installation = true, -- automatically detect which servers to install (based on which servers are set up via lspconfig)
}) })
require('lspconfig').pyright.setup { require('lspconfig').pyright.setup {
capabilities = capabilities capabilities = capabilities
} }
require('lspconfig').texlab.setup { require('lspconfig').texlab.setup {
capabilities = capabilities capabilities = capabilities
} }
require('lspconfig').clangd.setup {
capabilities = capabilities
}
require('lspconfig').bashls.setup {
capabilities = capabilities
}
require('lspconfig').cmake.setup {
capabilities = capabilities
}
require('lspconfig').dockerls.setup {
capabilities = capabilities
}
require('lspconfig').vimls.setup {
capabilities = capabilities
}
require('lspconfig').ltex.setup { require('lspconfig').ltex.setup {
capabilities = capabilities, capabilities = capabilities,
on_attach = function(client, bufnr) on_attach = function(client, bufnr)
require("ltex_extra").setup{ require("ltex_extra").setup{
load_langs = {"nl-BE", "en-US"}, load_langs = {"nl-BE", "en-GB"},
init_check = true, init_check = true,
} }
end, end,

View File

@ -10,7 +10,7 @@ end
-- PUBLIC FUNCTIONS -- PUBLIC FUNCTIONS
M.writeFile = function(type, lang, lines) M.writeFile = function(type, lang, lines)
local filename = table.concat({ "ltex", type, lang, "txt" }, ".") local filename = "/home/user/.config/nvim/spell/" .. table.concat({ "ltex", type, lang, "txt" }, ".")
local file = io.open(filename, "a+") local file = io.open(filename, "a+")
io.output(file) io.output(file)
for _, line in ipairs(lines) do for _, line in ipairs(lines) do
@ -20,7 +20,8 @@ M.writeFile = function(type, lang, lines)
end end
M.readFile = function(type, lang) M.readFile = function(type, lang)
local filename = table.concat({ "ltex", type, lang, "txt" }, ".") local filename = "/home/user/.config/nvim/spell/" .. table.concat({ "ltex", type, lang, "txt" }, ".")
print(vim.inspect(filename))
local lines = {} local lines = {}
if M.file_exists(filename) then if M.file_exists(filename) then
local file = io.open(filename, "r") local file = io.open(filename, "r")

View File

@ -0,0 +1,21 @@
local M = {}
local telescope = require("telescope")
M.project_files = function()
local opts = {show_untracked = false} -- define here if you want to define something
local ok = pcall(require"telescope.builtin".git_files, opts)
if not ok then require"telescope.builtin".find_files(opts) end
end
M.project_live_files = function()
local opts = {search_dirs = { "file_b", "file_a" }} -- define here if you want to define something
local ok = pcall(require"telescope.builtin".git_files, opts)
if not ok then require"telescope.builtin".find_files(opts) end
end
telescope.load_extension('fzf')
vim.api.nvim_set_keymap("n", "<C-p>", "<CMD>lua require'telescope-config'.project_files()<CR>", {noremap = true, silent = true})
return M

View File

@ -0,0 +1 @@
Avé