Fix executable checks

This commit is contained in:
Alex Yatskov 2023-11-04 19:39:21 -07:00
parent 88512f8b37
commit 3dbf38f875
2 changed files with 6 additions and 6 deletions

View File

@ -8,19 +8,19 @@ local capabilities = cmp_nvim_lsp.default_capabilities({snippetSupport = false})
-- nvim-lspconfig
local nvim_lspconfig = require('lspconfig')
if vim.fn.executable('clangd') then
if vim.fn.executable('clangd') == 1 then
nvim_lspconfig.clangd.setup({capabilities = capabilities})
end
if vim.fn.executable('gopls') then
if vim.fn.executable('gopls') == 1 then
nvim_lspconfig.gopls.setup({capabilities = capabilities})
end
if vim.fn.executable('jedi-language-server') then
if vim.fn.executable('jedi-language-server') == 1 then
nvim_lspconfig.jedi_language_server.setup({capabilities = capabilities})
end
if vim.fn.executable('typescript-language-server') then
if vim.fn.executable('typescript-language-server') == 1 then
nvim_lspconfig.tsserver.setup({capabilities = capabilities})
end
if vim.fn.executable('lua-language-server') then
if vim.fn.executable('lua-language-server') == 1 then
local runtime_path = vim.split(package.path, ';', {})
table.insert(runtime_path, 'lua/?.lua')
table.insert(runtime_path, 'lua/?/init.lua')

View File

@ -2,7 +2,7 @@
require('Comment').setup()
-- fzf.vim
if vim.fn.executable('fzf') then
if vim.fn.executable('fzf') == 1 then
vim.g['$FZF_DEFAULT_COMMAND'] = 'ag --hidden --ignore .git -f -g "" 2> /dev/null'
vim.cmd([[