Skip to content

Commit

Permalink
fix(nvim): coq stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
cutbypham committed Oct 25, 2021
1 parent 47bf3fb commit 027e35c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 29 deletions.
2 changes: 0 additions & 2 deletions nvim/after/plugin/coq.vim
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
" Set recommended to false
let g:coq_settings = { "keymap.recommended": v:false }

" let g:coq_settings = { "keymap.jump_to_mark": "<c-e>" }

" Keybindings
ino <silent><expr> <Esc> pumvisible() ? "\<C-e><Esc>" : "\<Esc>"
ino <silent><expr> <C-c> pumvisible() ? "\<C-e><C-c>" : "\<C-c>"
Expand Down
22 changes: 0 additions & 22 deletions nvim/after/plugin/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,10 @@ local nvim_lsp = require('lspconfig')
local protocol = require'vim.lsp.protocol'

local on_attach = function(client, bufnr)
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end

buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')

local opts = { noremap=true, silent=true }

buf_set_keymap('n', 'gD', '<Cmd>lua vim.lsp.buf.declaration()<CR>', opts)
buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
buf_set_keymap('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
buf_set_keymap('i', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
buf_set_keymap('n', '<leader>lwa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
buf_set_keymap('n', '<leader>lwr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
buf_set_keymap('n', '<leader>lwl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
buf_set_keymap('n', '<leader>lD', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
buf_set_keymap('n', '<leader>lrn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
buf_set_keymap('n', '<leader>lca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
buf_set_keymap('n', '<leader>le', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
--buf_set_keymap('n', '<C-j>', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
buf_set_keymap('n', '<leader>lq', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
buf_set_keymap("n", "<leader>lf", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)

-- formatting
if client.resolved_capabilities.document_formatting then
vim.api.nvim_command [[augroup Format]]
Expand Down Expand Up @@ -126,7 +105,6 @@ nvim_lsp.diagnosticls.setup {
json = 'prettier',
scss = 'prettier',
less = 'prettier',
json = 'prettier',
typescript = 'eslint_d',
typescriptreact = 'eslint_d',
markdown = 'prettier',
Expand Down
11 changes: 6 additions & 5 deletions nvim/init.vim
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
call plug#begin()
Plug 'ms-jpq/coq_nvim', {'branch': 'coq'}

Plug 'ms-jpq/coq.artifacts', {'branch': 'artifacts'}

Plug 'williamboman/nvim-lsp-installer'
Plug 'neovim/nvim-lspconfig'
noremap [d :lua vim.lsp.diagnostic.goto_next()<enter>
noremap ]d :lua vim.lsp.diagnostic.goto_prev()<enter>
Plug 'williamboman/nvim-lsp-installer'
Plug 'ms-jpq/coq_nvim', {'branch': 'coq'}

set hidden
set shortmess+=c
Expand Down Expand Up @@ -268,3 +267,5 @@ vnoremap ~ y:call setreg('', TwiddleCase(@"), getregtype(''))<CR>gv""Pgv
command! OpenFileInDefaultApp execute "!xdg-open '%'"
command! OpenFileInBraveBrowser execute "!brave-browser '%'"

let g:coq_settings = { 'auto_start': 'shut-up' }

0 comments on commit 027e35c

Please sign in to comment.