Julio Biason
1 year ago
9 changed files with 60 additions and 97 deletions
@ -1,12 +1,5 @@
|
||||
vim.opt.background = "dark" -- the theme background is dark |
||||
vim.opt.termguicolors = true |
||||
|
||||
-- vim.g.tokyonight_enable_italic = 1 |
||||
-- vim.g.tokyonight_transparent = true |
||||
-- vim.cmd("colorscheme tokyonight-moon") |
||||
-- local ayu = require('ayu') |
||||
|
||||
-- ayu.setup({ mirage = true }) |
||||
-- ayu.colorscheme() |
||||
vim.cmd("colorscheme night-owl") |
||||
|
||||
|
@ -1,33 +1,42 @@
|
||||
local attachment = function(client, bufnr) |
||||
local opts = { noremap=true, silent=true } |
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts) |
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) |
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts) |
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts) |
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts) |
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts) |
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts) |
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts) |
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts) |
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.rename()<CR>', opts) |
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'ga', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts) |
||||
vim.api.nvim_buf_set_keymap(bufnr, 'v', 'ga', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts) |
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>f', '<cmd>lua vim.lsp.buf.format({async = true})<CR>', opts) |
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'ge', '<cmd>lua vim.diagnostic.open_float()<CR>', opts) |
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gn', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts) |
||||
vim.api.nvim_create_autocmd('LspAttach', { |
||||
group = vim.api.nvim_create_augroup('UserLspConfig', {}), |
||||
callback = function(ev) |
||||
-- Enable completion triggered by <c-x><c-o> |
||||
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' |
||||
|
||||
if client.resolved_capabilities.document_formatting then |
||||
vim.api.nvim_command [[augroup Format]] |
||||
vim.api.nvim_command [[autocmd! * <buffer>]] |
||||
vim.api.nvim_command [[autocmd BufWritePre <buffer> lua vim.lsp.buf.format({async = false})]] |
||||
vim.api.nvim_command [[augroup END]] |
||||
end |
||||
end |
||||
-- Buffer local mappings. |
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions |
||||
local opts = { buffer = ev.buf } |
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) |
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) |
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) |
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) |
||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts) |
||||
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts) |
||||
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts) |
||||
vim.keymap.set('n', '<space>wl', function() |
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders())) |
||||
end, opts) |
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts) |
||||
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts) |
||||
vim.keymap.set({ 'n', 'v' }, '<space>ga', vim.lsp.buf.code_action, opts) |
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) |
||||
vim.keymap.set('n', '<space>f', function() |
||||
vim.lsp.buf.format { async = true } |
||||
end, opts) |
||||
|
||||
local servers = { 'pyright', 'rust_analyzer', 'clangd' } |
||||
for _, lsp in pairs(servers) do |
||||
require('lspconfig')[lsp].setup { |
||||
on_attach = attachment |
||||
} |
||||
end |
||||
vim.keymap.set('n', 'ge', vim.diagnostic.open_float) |
||||
vim.keymap.set('n', 'gp', vim.diagnostic.goto_prev) |
||||
vim.keymap.set('n', 'gn', vim.diagnostic.goto_next) |
||||
end, |
||||
}) |
||||
|
||||
local lspconfig = require('lspconfig') |
||||
lspconfig.pyright.setup {} |
||||
lspconfig.rust_analyzer.setup {} |
||||
lspconfig.clangd.setup {} |
||||
|
||||
require('lspconfig').groovyls.setup { |
||||
cmd = { "java", "-jar", "/home/jbiason/Projects/Personal/groovy-language-server/build/libs/groovy-language-server-all.jar" }, |
||||
} |
||||
|
||||
|
@ -1,6 +0,0 @@
|
||||
require("mind").setup({ |
||||
persistence = { |
||||
state_path = "~/Documents/Mind/main.json", |
||||
data_dir = "~/Documents/Mind/data", |
||||
} |
||||
}) |
@ -1,36 +0,0 @@
|
||||
-- local home = vim.fn.expand("~/Documents/Telecasten") |
||||
-- local tele = require('telekasten') |
||||
-- local options = { noremap = true, silent = true } |
||||
|
||||
-- tele.setup({ |
||||
-- home = home, |
||||
-- take_over_my_home = true, |
||||
-- auto_set_filetype = true, |
||||
|
||||
-- dailies = home .. "/journal", |
||||
-- dalies_create_nonexisting = true, |
||||
-- template_new_daily = home .. "/templates/daily.md", |
||||
|
||||
-- extension = ".md", |
||||
|
||||
-- image_link_style = "markdown", |
||||
|
||||
-- plug_into_calendar = true, |
||||
|
||||
-- }) |
||||
|
||||
|
||||
-- vim.keymap.set('n', '<leader>zn', tele.new_note, options) |
||||
-- vim.keymap.set('n', '<leader>zT', tele.goto_today, options) |
||||
-- vim.keymap.set('n', '<leader>zt', function() |
||||
-- local line = vim.api.nvim_get_current_line() |
||||
-- local nline = os.date("## %H:%M ") |
||||
-- vim.api.nvim_command(":normal G2o") |
||||
-- vim.api.nvim_set_current_line(nline) |
||||
-- vim.api.nvim_command(":normal o") |
||||
-- end) |
||||
-- vim.keymap.set('n', '<leader>zs', tele.search_notes, options) |
||||
-- vim.keymap.set('n', '<leader>zg', tele.follow_link, options) |
||||
-- vim.keymap.set('n', '<leader>zp', tele.panel, options) |
||||
-- vim.keymap.set('n', '<leader>zc', tele.show_calendar, options) |
||||
-- vim.keymap.set('n', '<leader>zo', tele.toggle_todo, options) |
Loading…
Reference in new issue