no coq for latex

This commit is contained in:
EvilMuffinHa 2022-11-08 20:32:39 -05:00
parent 5989e4213d
commit 914b98ff69
4 changed files with 492 additions and 439 deletions

View File

@ -1,5 +1,5 @@
vim.g.coq_settings = {
auto_start = 'shut-up',
-- auto_start = 'shut-up',
keymap = {
eval_snips = "<Leader>se",
},
@ -26,9 +26,9 @@ vim.g.coq_settings = {
local coq = require('coq')
require('coq_3p') {
{ src = 'vimtex', short_name = 'TEX'},
{ src = 'nvimlua', short_name = 'NLUA', conf_only = true},
{ src = 'bc', short_name = 'CALC', precision = 8},
{ src = 'vimtex', short_name = 'TEX' },
{ src = 'nvimlua', short_name = 'NLUA', conf_only = true },
{ src = 'bc', short_name = 'CALC', precision = 8 },
}
@ -38,8 +38,8 @@ lspstatus.register_progress()
local function find_repo_root(names)
local util = require("lspconfig.util")
local config = names.configfiles
for _, i in ipairs(config) do
local gitroot = util.root_pattern('.git')(i)
local function matcher(filename, _bufnr)
local gitroot = util.root_pattern('.git')(filename)
if gitroot then
for _, file in ipairs(config) do
if util.path.is_file(util.path.join(gitroot, file)) then
@ -47,7 +47,10 @@ local function find_repo_root(names)
end
end
end
return util.root_pattern(unpack(config))(filename)
end
return matcher
end
local lsp_confs = {
@ -60,7 +63,7 @@ local lsp_confs = {
path = runtime_path,
},
diagnostics = {
globals = {'vim'},
globals = { 'vim' },
},
workspace = {
library = vim.api.nvim_get_runtime_file("", true),
@ -100,7 +103,7 @@ local lsp_confs = {
root_dir = find_repo_root({
configfiles = { ".eslintrc", ".eslintrc.js", "package.json" }
}),
on_new_config = function (config, new_root_dir)
on_new_config = function(config, new_root_dir)
local default_config = require('lspconfig.server_configurations.eslint').default_config
default_config.on_new_config(config, new_root_dir)
@ -120,6 +123,10 @@ local lsp_confs = {
local lsp_special_setup = {
}
local function on_attach(client, _bufnr)
lspstatus.on_attach(client)
end
local lspconfig = require('lspconfig')
@ -171,10 +178,10 @@ vim.diagnostic.config({
do -- signs
local signs = {
{'DiagnosticSignError', text='×', texthl='DiagnosticSignError'},
{'DiagnosticSignWarn', text='>', texthl='DiagnosticSignWarn'},
{'DiagnosticSignInfo', text='I', texthl='DiagnosticSignInfo'},
{'DiagnosticSignHint', text='H', texthl='DiagnosticSignHint'},
{ 'DiagnosticSignError', text = '×', texthl = 'DiagnosticSignError' },
{ 'DiagnosticSignWarn', text = '>', texthl = 'DiagnosticSignWarn' },
{ 'DiagnosticSignInfo', text = 'I', texthl = 'DiagnosticSignInfo' },
{ 'DiagnosticSignHint', text = 'H', texthl = 'DiagnosticSignHint' },
}
for _, sign in pairs(signs) do
local name = sign[1]
@ -189,20 +196,50 @@ map(
'n',
'K',
[[luaeval('next(vim.lsp.buf_get_clients()) == nil') ? 'K' : '<Cmd>lua vim.lsp.buf.hover()<CR>']],
{noremap = true, expr = true}
{ noremap = true, expr = true }
)
map(
'n',
'<C-]>',
[[luaeval('next(vim.lsp.buf_get_clients()) == nil') ? '<C-]>' : '<Cmd>lua vim.lsp.buf.definition()<CR>']],
{noremap = true, expr = true}
{ noremap = true, expr = true }
)
local M = {}
M.format_on_save_hook = function()
local enabled = vim.b.format_on_save
if enabled == nil then
enabled = true
end
if enabled ~= 0 and enabled ~= false then
vim.lsp.buf.format({ async = false })
end
end
vim.cmd [[
augroup lspconfig
augroup hoverlspconfig
au!
" diagnostic on hover
au BufWritePre * lua require'lsp'.format_on_save_hook()
au CursorHold * lua vim.diagnostic.open_float({focus = false})
augroup END
]]
vim.api.nvim_create_autocmd('FileType', {
pattern = "*",
callback = function()
if vim.bo.filetype ~= "plaintex" and vim.bo.filetype ~= "tex" and vim.bo.filetype ~= "latex" then
vim.cmd [[ :COQnow -s ]]
end
end
})
-- vim.cmd [[
-- augroup disabletexlsp
-- autocmd!
-- autocmd FileType tex :COQstop
-- augroup END
-- ]]
return M

View File

@ -18,27 +18,27 @@ o.termguicolors = true
vim.cmd('colorscheme theme')
vim.g.airline_theme='theme'
vim.g.airline_theme = 'theme'
map('n', '<Leader>s', ':%s//g<Left><Left>', {})
map('n', '<Leader>e', ':make!<CR>', {noremap = true})
map('n', '<C-o>', ':cclose<CR>', {noremap = true})
map('n', '<C-L>', ':nohlsearch<CR><C-L>', {noremap = true, silent = true})
map('n', ';', ':', {noremap = true})
map('v', ';', ':', {noremap = true})
map('n', '<Leader>e', ':make!<CR>', { noremap = true })
map('n', '<C-o>', ':cclose<CR>', { noremap = true })
map('n', '<C-L>', ':nohlsearch<CR><C-L>', { noremap = true, silent = true })
map('n', ';', ':', { noremap = true })
map('v', ';', ':', { noremap = true })
for i = 1,9,1 do
map('', '<Leader>' .. tostring(i), tostring(i) .. 'gt', {noremap = true})
for i = 1, 9, 1 do
map('', '<Leader>' .. tostring(i), tostring(i) .. 'gt', { noremap = true })
end
map('n', '<C-Left>', ':tabprevious<CR>', {noremap = true})
map('n', '<C-Right>', ':tabnext<CR>', {noremap = true})
map('', '<Leader>0', ':tablast<CR>', {noremap = true})
map('n', 'ZX', '<Cmd>q<CR>', {noremap = true, silent = true})
map('n', '<C-Left>', ':tabprevious<CR>', { noremap = true })
map('n', '<C-Right>', ':tabnext<CR>', { noremap = true })
map('', '<Leader>0', ':tablast<CR>', { noremap = true })
map('n', 'ZX', '<Cmd>q<CR>', { noremap = true, silent = true })
map('t', '<Esc>', '<C-\\><C-n>', {noremap = true})
map('t', '<Esc>', '<C-\\><C-n>', { noremap = true })
o.list=true
o.list = true
o.listchars = {
tab = '',
eol = '¬',

View File

@ -4,7 +4,7 @@ local function import(name)
return ([[require '%s']]):format(name)
end
return require('packer').startup({function(use)
return require('packer').startup({ function(use)
use 'wbthomason/packer.nvim'
use {
@ -35,7 +35,7 @@ return require('packer').startup({function(use)
'tpope/vim-fugitive',
config = function()
local map = vim.api.nvim_set_keymap
map('n', '<Leader>g', '<Cmd>Git<CR>', {noremap = true})
map('n', '<Leader>g', '<Cmd>Git<CR>', { noremap = true })
end,
}
@ -55,11 +55,15 @@ return require('packer').startup({function(use)
config = function()
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'},
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' },
},
}
end
@ -71,7 +75,7 @@ return require('packer').startup({function(use)
'nvim-lua/plenary.nvim'
},
config = function()
require('flutter-tools').setup{
require('flutter-tools').setup {
lsp = {
color = {
enabled = false
@ -88,7 +92,7 @@ return require('packer').startup({function(use)
require('Comment').setup({})
map('n', '<C-_>',
'<Cmd>lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode())<CR>',
{noremap = true, silent = true})
{ noremap = true, silent = true })
end
}
@ -126,12 +130,24 @@ return require('packer').startup({function(use)
end,
}
use {
'sirver/ultisnips',
ft = { 'latex', 'plaintex', 'tex' },
config = function()
vim.g.UltiSnipsExpandTrigger = '<tab>'
vim.g.UltiSnipsJumpForwardTrigger = '<tab>'
vim.g.UltiSnipsJumpBackwardTrigger = '<s-tab>'
end
}
use {
'neovim/nvim-lspconfig',
-- commit = "607ff48b970b89c3e4e3825b88d9cfd05b7aaea5",
requires = {
'nvim-lua/lsp-status.nvim',
{
'ms-jpq/coq.thirdparty',
},
{
'ms-jpq/coq_nvim',
run = ':COQdeps',
@ -180,7 +196,6 @@ return require('packer').startup({function(use)
end
end,
config = {
config = {
compile_path = require('packer.util').join_paths(vim.fn.stdpath('data'), 'site', 'plugin', 'packer_compiled.lua'),
}})
} })

View File

@ -1,9 +1,8 @@
local telescope = require('telescope')
telescope.setup({
defaults = {
file_ignore_patterns = {'.git'},
file_ignore_patterns = { '.git' },
mappings = {
i = {
['<C-o>'] = { '<Esc>', type = 'command' },
@ -91,8 +90,10 @@ telescope.register_extension {
}
table.insert(indexed_items, entry)
widths.idx = math.max(widths.idx, strings.strdisplaywidth(entry.idx))
widths.command_title = math.max(widths.command_title, strings.strdisplaywidth(entry.add.command_title))
widths.client_name = math.max(widths.client_name, strings.strdisplaywidth(entry.add.client_name))
widths.command_title = math.max(widths.command_title,
strings.strdisplaywidth(entry.add.command_title))
widths.client_name = math.max(widths.client_name,
strings.strdisplaywidth(entry.add.client_name))
end
return indexed_items, widths
end,
@ -183,16 +184,17 @@ telescope.register_extension {
local map = vim.api.nvim_set_keymap
map('n', '<Leader>pf', '<Cmd>Telescope find_files<CR>', {noremap = true})
map('n', '<Leader>pb', '<Cmd>Telescope buffers<CR>', {noremap = true})
map('n', '<Leader>po', '<Cmd>Telescope lsp_document_symbols<CR>', {noremap = true})
map('n', '<Leader>ps', '<Cmd>Telescope lsp_workspace_symbols<CR>', {noremap = true})
map('n', '<Leader>pd', '<Cmd>Telescope lsp_definitions<CR>', {noremap = true})
map('n', '<Leader>pr', '<Cmd>Telescope lsp_references<CR>', {noremap = true})
map('n', '<Leader>p', ':Telescope ', {noremap = true})
map('n', '<Leader>p ', ':Telescope ', {noremap = true})
map('n', '<Leader>pf', '<Cmd>Telescope find_files<CR>', { noremap = true })
map('n', '<Leader>pb', '<Cmd>Telescope buffers<CR>', { noremap = true })
map('n', '<Leader>po', '<Cmd>Telescope lsp_document_symbols<CR>', { noremap = true })
map('n', '<Leader>ps', '<Cmd>Telescope lsp_workspace_symbols<CR>', { noremap = true })
map('n', '<Leader>pd', '<Cmd>Telescope lsp_definitions<CR>', { noremap = true })
map('n', '<Leader>pr', '<Cmd>Telescope lsp_references<CR>', { noremap = true })
map('n', '<Leader>pp', '<C-^>', { noremap = true })
map('n', '<Leader>p', ':Telescope ', { noremap = true })
map('n', '<Leader>p ', ':Telescope ', { noremap = true })
map('n', '<Leader>.', ':lua vim.lsp.buf.code_action()<CR>', {noremap = true})
map('n', '<Leader>.', ':lua vim.lsp.buf.code_action()<CR>', { noremap = true })
-- vim.cmd [[
-- function! s:telescope_hlsetup() abort
@ -205,4 +207,3 @@ map('n', '<Leader>.', ':lua vim.lsp.buf.code_action()<CR>', {noremap = true})
-- au ColorScheme * call s:telescope_hlsetup()
-- augroup END
-- ]]