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