More LSPs! formatted some files.
This commit is contained in:
parent
ec3acd5976
commit
dc67e0a5dd
13
init.lua
13
init.lua
|
@ -5,7 +5,7 @@ require('packer_init')
|
||||||
require('keybindings')
|
require('keybindings')
|
||||||
--vim.opt.guicursor = " "
|
--vim.opt.guicursor = " "
|
||||||
|
|
||||||
vim.opt.nu = true
|
vim.opt.nu = true
|
||||||
vim.opt.relativenumber = true
|
vim.opt.relativenumber = true
|
||||||
|
|
||||||
vim.opt.tabstop = 4
|
vim.opt.tabstop = 4
|
||||||
|
@ -17,7 +17,7 @@ vim.opt.smartindent = true
|
||||||
|
|
||||||
vim.opt.wrap = false
|
vim.opt.wrap = false
|
||||||
require('nvim-treesitter.configs').setup {
|
require('nvim-treesitter.configs').setup {
|
||||||
ensure_installed = { "c", "cpp", "lua", "zig", "rust" },
|
ensure_installed = { "c", "cpp", "lua", "zig", "go" },
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
auto_install = false,
|
auto_install = false,
|
||||||
highlight = {
|
highlight = {
|
||||||
|
@ -34,9 +34,14 @@ require('treesitter-context').setup {
|
||||||
enable = true,
|
enable = true,
|
||||||
max_lines = 0,
|
max_lines = 0,
|
||||||
min_window_height = 0,
|
min_window_height = 0,
|
||||||
|
patterns = {
|
||||||
|
zig = {
|
||||||
|
'fn',
|
||||||
|
'struct',
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
require('nvim-autopairs').setup{
|
require('nvim-autopairs').setup{}
|
||||||
}
|
|
||||||
require('telescope').setup{
|
require('telescope').setup{
|
||||||
defaults = {
|
defaults = {
|
||||||
},
|
},
|
||||||
|
|
|
@ -17,8 +17,8 @@ function save_all_and_build()
|
||||||
|
|
||||||
local opts = {}
|
local opts = {}
|
||||||
vim.api.nvim_exec('wa', opts)
|
vim.api.nvim_exec('wa', opts)
|
||||||
|
|
||||||
if not has_buffer() then
|
if not has_buffer() then
|
||||||
job_buffer = vim.api.nvim_create_buf(true, true)
|
job_buffer = vim.api.nvim_create_buf(true, true)
|
||||||
end
|
end
|
||||||
local job_window = vim.fn.bufwinnr(job_buffer)
|
local job_window = vim.fn.bufwinnr(job_buffer)
|
||||||
|
|
|
@ -37,8 +37,41 @@ end
|
||||||
local lsp_flags = {
|
local lsp_flags = {
|
||||||
debounce_text_changes = 150, --wtf is this
|
debounce_text_changes = 150, --wtf is this
|
||||||
}
|
}
|
||||||
require('lspconfig')['zls'].setup {
|
local lspconfig = require('lspconfig');
|
||||||
|
lspconfig.zls.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
flags = lsp_flags
|
flags = lsp_flags,
|
||||||
|
}
|
||||||
|
lspconfig.gopls.setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
}
|
||||||
|
lspconfig.clangd.setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
}
|
||||||
|
-- honestly don't need this, telemetry is a big yikes.
|
||||||
|
lspconfig.sumneko_lua.setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = lsp_flags,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
runtime = {
|
||||||
|
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||||
|
version = 'LuaJIT',
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
-- Get the language server to recognize the `vim` global
|
||||||
|
globals = {'vim'},
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
-- Make the server aware of Neovim runtime files
|
||||||
|
library = vim.api.nvim_get_runtime_file("", true),
|
||||||
|
},
|
||||||
|
-- Do not send telemetry data containing a randomized but unique identifier
|
||||||
|
telemetry = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
--TODO: other languages I care about.
|
|
||||||
|
|
|
@ -3,13 +3,16 @@ vim.cmd [[packadd packer.nvim]]
|
||||||
return require('packer').startup(function(use)
|
return require('packer').startup(function(use)
|
||||||
-- Packer can manage itself
|
-- Packer can manage itself
|
||||||
use 'wbthomason/packer.nvim'
|
use 'wbthomason/packer.nvim'
|
||||||
|
-- themes
|
||||||
use 'sainnhe/everforest'
|
use 'sainnhe/everforest'
|
||||||
use 'sainnhe/sonokai'
|
use 'sainnhe/sonokai'
|
||||||
use { 'nvim-treesitter/nvim-treesitter' }
|
|
||||||
use 'neovim/nvim-lspconfig'
|
|
||||||
use 'nvim-treesitter/nvim-treesitter-context'
|
|
||||||
use { 'nvim-telescope/telescope.nvim', tag = '0.1.0', requires = {{'nvim-lua/plenary.nvim'}} }
|
|
||||||
use { 'windwp/nvim-autopairs' }
|
|
||||||
use { 'tomasr/molokai' }
|
use { 'tomasr/molokai' }
|
||||||
use 'morhetz/gruvbox'
|
use 'morhetz/gruvbox'
|
||||||
|
-- Treesitter
|
||||||
|
use { 'nvim-treesitter/nvim-treesitter' }
|
||||||
|
use 'nvim-treesitter/nvim-treesitter-context'
|
||||||
|
-- Utils
|
||||||
|
use 'neovim/nvim-lspconfig'
|
||||||
|
use { 'nvim-telescope/telescope.nvim', tag = '0.1.0', requires = {{'nvim-lua/plenary.nvim'}} }
|
||||||
|
use { 'windwp/nvim-autopairs' }
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -88,7 +88,7 @@ local function lsp()
|
||||||
if count["warnings"] ~= 0 then
|
if count["warnings"] ~= 0 then
|
||||||
warnings = " %#LspDiagnosticsSignHint# " .. count["warnings"]
|
warnings = " %#LspDiagnosticsSignHint# " .. count["warnings"]
|
||||||
end
|
end
|
||||||
|
|
||||||
if count["hints"] ~= 0 then
|
if count["hints"] ~= 0 then
|
||||||
hints = " %#LspDiagnosticsSignHint# " .. count["hints"]
|
hints = " %#LspDiagnosticsSignHint# " .. count["hints"]
|
||||||
end
|
end
|
||||||
|
@ -105,7 +105,7 @@ local function filetype()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function lineinfo()
|
local function lineinfo()
|
||||||
if vim.bo.filetype == "alpha" then
|
if vim.bo.filetype == "alpha" then
|
||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
return " %l:%c %P %"
|
return " %l:%c %P %"
|
||||||
|
|
Loading…
Reference in New Issue