nvim: Add better support for lsp via omnifunc

Only reason I'm not using this is that there is no floating preview window
This commit is contained in:
ViViDboarder 2021-09-30 10:57:37 -07:00
parent 6baa4feab0
commit 48af6cc3ef
2 changed files with 12 additions and 1 deletions

View File

@ -1,5 +1,6 @@
local o = vim.o
local g = vim.g
local utils = require("utils")
-- Set leader to space
g.mapleader = " "
@ -19,5 +20,11 @@ o.scrolloff = 3
-- o.mousehide = true
o.mouse = "a"
-- Autocomplete options
o.completeopt = "menuone,noinsert,noselect,preview"
utils.augroup("close_preview", function()
vim.cmd("autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif")
end)
local has = vim.fn.has
g.is_mac = (has("mac") or has("macunix") or has("gui_macvim") or vim.fn.system("uname"):find("^darwin") ~= nil)

View File

@ -1,6 +1,10 @@
-- luacheck: globals packer_plugins
local utils = require("utils")
local function default_attach(client, bufnr)
require('completion').on_attach()
if utils.is_plugin_loaded("completion-nvim") then
require('completion').on_attach()
end
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