half spaces
parent
6484e98f92
commit
0ecc6c07ef
|
@ -36,6 +36,7 @@ vim.opt.completeopt = 'menuone,noselect'
|
|||
-- vim.opt.clipboard = "unnamedplus"
|
||||
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ','
|
||||
|
||||
-- basic keymaps
|
||||
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true }) -- since we're using space for leader
|
||||
|
@ -53,6 +54,7 @@ vim.keymap.set('n', '<leader>wq', '<cmd>TroubleToggle workspace_diagnostics<cr>'
|
|||
|
||||
|
||||
-- vim-plug
|
||||
local data_dir = vim.fn.stdpath('data')
|
||||
vim.cmd([[
|
||||
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
|
||||
if empty(glob(data_dir . '/autoload/plug.vim'))
|
||||
|
@ -81,7 +83,7 @@ Plug('hrsh7th/cmp-nvim-lsp')
|
|||
Plug('hrsh7th/cmp-buffer')
|
||||
Plug('hrsh7th/nvim-cmp')
|
||||
Plug('onsails/lspkind-nvim')
|
||||
Plug('tzachar/cmp-tabnine', { ['do'] = './install.sh' })
|
||||
-- Plug('tzachar/cmp-tabnine', { ['do'] = './install.sh' })
|
||||
|
||||
-- DevExp
|
||||
Plug('windwp/nvim-autopairs') -- matches pairs like [] (),...
|
||||
|
@ -95,6 +97,10 @@ Plug('williamboman/mason-lspconfig.nvim') -- lsp config for mason
|
|||
Plug('ThePrimeagen/harpoon') -- 1-click through marked files per project
|
||||
Plug('TimUntersberger/neogit') -- Easy-to-see git status
|
||||
Plug('folke/trouble.nvim') -- File-grouped workspace diagnostics
|
||||
Plug('tpope/vim-dispatch') -- Allows quick build/compile/test vim commands
|
||||
Plug('clojure-vim/vim-jack-in') -- Clojure: ":Boot", ":Clj", ":Lein"
|
||||
Plug('radenling/vim-dispatch-neovim') -- Add support for neovim's terminal emulator
|
||||
Plug('Olical/conjure') -- REPL on the source for Clojure (and other LISPs)
|
||||
|
||||
-- UI & colorscheme
|
||||
Plug('gruvbox-community/gruvbox') -- theme provider
|
||||
|
@ -270,7 +276,7 @@ require('nvim-treesitter.configs').setup {
|
|||
ensure_installed = {
|
||||
'tsx', 'toml', 'lua', 'typescript', 'rust', 'go', 'yaml', 'json', 'php', 'css',
|
||||
'python', 'prisma', 'html', "dockerfile", "c", "cpp", "hcl", "svelte", "astro",
|
||||
"clojure"
|
||||
"clojure", "fennel"
|
||||
},
|
||||
sync_install = false,
|
||||
highlight = { enable = true },
|
||||
|
@ -304,10 +310,12 @@ require('nvim-treesitter.configs').setup {
|
|||
|
||||
require('nvim-autopairs').setup {
|
||||
check_ts = true,
|
||||
|
||||
}
|
||||
|
||||
local parser_config = require('nvim-treesitter.parsers').get_parser_configs()
|
||||
parser_config.tsx.filetype_to_parsername = { "javascript", "typescript.tsx" }
|
||||
parser_config.astro.filetype_to_parsername = { "javascript", "typescript.tsx", "astro" }
|
||||
|
||||
|
||||
require('guess-indent').setup {
|
||||
|
@ -402,16 +410,16 @@ local on_attach = function(_client, bufnr)
|
|||
end
|
||||
-- nvim-cmp supports additional completion capabilities
|
||||
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
local tabnine = require('cmp_tabnine.config')
|
||||
tabnine.setup({
|
||||
max_lines = 1000,
|
||||
max_num_results = 20,
|
||||
sort = true,
|
||||
run_on_every_keystroke = true,
|
||||
snippet_placeholder = '..',
|
||||
ignored_file_types = {},
|
||||
show_prediction_strength = true,
|
||||
})
|
||||
-- local tabnine = require('cmp_tabnine.config')
|
||||
-- tabnine.setup({
|
||||
-- max_lines = 1000,
|
||||
-- max_num_results = 20,
|
||||
-- sort = true,
|
||||
-- run_on_every_keystroke = true,
|
||||
-- snippet_placeholder = '..',
|
||||
-- ignored_file_types = {},
|
||||
-- show_prediction_strength = true,
|
||||
-- })
|
||||
-- default language servers
|
||||
local servers = { 'clangd', 'rust_analyzer', 'pyright', 'tsserver', 'sumneko_lua', 'cmake', 'tailwindcss', 'prismals',
|
||||
'rnix', 'eslint', 'terraform-ls', 'tflint', 'svelte', 'astro', 'clojure_lsp' }
|
||||
|
@ -464,7 +472,20 @@ require('mason-lspconfig').setup_handlers({
|
|||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end,
|
||||
-- ["astro"] = function()
|
||||
-- print('configuring astro')
|
||||
-- require('lspconfig').astro.setup {
|
||||
-- on_attach = on_attach,
|
||||
-- capabilities = capabilities,
|
||||
-- init_options = {
|
||||
-- configuration = {},
|
||||
-- typescript = {
|
||||
-- serverPath = data_dir
|
||||
-- }
|
||||
-- }
|
||||
-- }
|
||||
-- end
|
||||
})
|
||||
require('zk').setup({
|
||||
picker = "telescope",
|
||||
|
@ -516,7 +537,7 @@ local source_mapping = {
|
|||
buffer = '[Buffer]',
|
||||
nvim_lsp = '[LSP]',
|
||||
nvim_lua = '[Lua]',
|
||||
cmp_tabnine = '[T9]',
|
||||
-- cmp_tabnine = '[T9]',
|
||||
path = '[Path]',
|
||||
}
|
||||
|
||||
|
@ -557,17 +578,17 @@ cmp.setup {
|
|||
format = function(entry, vim_item)
|
||||
vim_item.kind = lspkind.symbolic(vim_item.kind, { mode = 'symbol' })
|
||||
vim_item.menu = source_mapping[entry.source_name]
|
||||
if entry.source.name == "cmp_tabnine" then
|
||||
local detail = (entry.completion_item.data or {}).detail
|
||||
vim_item.kind = ""
|
||||
if detail and detail:find('.*%%.*') then
|
||||
vim_item.kind = vim_item.kind .. ' ' .. detail
|
||||
end
|
||||
|
||||
if (entry.completion_item.data or {}).multiline then
|
||||
vim_item.kind = vim_item.kind .. ' ' .. '[ML]'
|
||||
end
|
||||
end
|
||||
-- if entry.source.name == "cmp_tabnine" then
|
||||
-- local detail = (entry.completion_item.data or {}).detail
|
||||
-- vim_item.kind = ""
|
||||
-- if detail and detail:find('.*%%.*') then
|
||||
-- vim_item.kind = vim_item.kind .. ' ' .. detail
|
||||
-- end
|
||||
--
|
||||
-- if (entry.completion_item.data or {}).multiline then
|
||||
-- vim_item.kind = vim_item.kind .. ' ' .. '[ML]'
|
||||
-- end
|
||||
-- end
|
||||
local maxwidth = 80
|
||||
vim_item.abbr = string.sub(vim_item.abbr, 1, maxwidth)
|
||||
return vim_item
|
||||
|
@ -576,7 +597,7 @@ cmp.setup {
|
|||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'cmp_tabnine' },
|
||||
-- { name = 'cmp_tabnine' },
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue