Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 35 additions & 16 deletions plugin/config.vim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set fileformats=unix,dos,mac
set listchars=tab:▒░,trail:∞
set backspace=indent,eol,start
set completeopt=menuone,longest,preview
set tabstop=4 softtabstop=0 expandtab shiftwidth=4
set tabstop=2 softtabstop=0 expandtab shiftwidth=2
set list showmatch showmode shiftround ttimeout hidden showcmd hlsearch smartcase nobackup nowritebackup noswapfile termguicolors cursorline lazyredraw nowrap autoindent smarttab incsearch relativenumber number expandtab

tnoremap <Esc> <C-\><C-n>
Expand All @@ -31,23 +31,39 @@ endif
lua << EOF

require("bufferline").setup{
options = {
numbers = "buffer_id",
number_style = "superscript"
number_style = "superscript",
show_buffer_icons = false
}
}

require('lualine').setup{
sections = {
lualine_x = {
{
'filetype',
colored = false,
}
}
}
}

require('mason').setup()

require('mason-lspconfig').setup({
ensure_installed = {
-- Replace these with whatever servers you want to install
-- 'standardrb',
'solargraph',
'tsserver',
'quick_lint_js',
'intelephense',
'html',
}
})

local lspconfig = require('lspconfig')

require('mason-lspconfig').setup_handlers({
function(server_name)
lspconfig[server_name].setup({
Expand Down Expand Up @@ -102,27 +118,16 @@ cmp.setup.cmdline({ '/', '?' }, {
}
})

-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})

-- Set up lspconfig.
local capabilities = require('cmp_nvim_lsp').default_capabilities()
require('lspconfig')['tsserver'].setup { capabilities = capabilities }
require('lspconfig')['quick_lint_js'].setup { capabilities = capabilities }
require('lspconfig')['intelephense'].setup { capabilities = capabilities }
require('lspconfig')['html'].setup { capabilities = capabilities }

local opts = { noremap=true, silent=true }
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
-- vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
-- vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)

local on_attach = function(client, bufnr)
Expand Down Expand Up @@ -150,9 +155,23 @@ require('lspconfig')['pyright'].setup{
on_attach = on_attach,
flags = lsp_flags,
}

require('lspconfig')['tsserver'].setup{
on_attach = on_attach,
flags = lsp_flags,
}

-- vim.api.nvim_create_autocmd("FileType", {
-- pattern = "ruby",
-- group = vim.api.nvim_create_augroup("RubyLSP", { clear = true }), -- also this is not /needed/ but it's good practice
-- callback = function()
-- vim.lsp.start {
-- name = "standard",
-- cmd = { os.getenv( "HOME" ) .. "/.rbenv/shims/standardrb", "--lsp" },
-- }
-- end,
-- })

require('lspconfig')['solargraph'].setup{}

EOF