|
|
@ -30,9 +30,6 @@ vim.opt.foldexpr = "nvim_treesitter#foldexpr()" |
|
|
|
-- hit zc to enable folding |
|
|
|
-- hit zc to enable folding |
|
|
|
vim.o.foldenable = false |
|
|
|
vim.o.foldenable = false |
|
|
|
|
|
|
|
|
|
|
|
vim.opt.guifont = "Iosevka Nerd Font:h12" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vim.g.neovide_refresh_rate = 140 |
|
|
|
|
|
|
|
vim.g.neomake_open_list = 2 |
|
|
|
vim.g.neomake_open_list = 2 |
|
|
|
|
|
|
|
|
|
|
|
function map(mode, shortcut, command) |
|
|
|
function map(mode, shortcut, command) |
|
|
@ -49,6 +46,16 @@ function imap(shortcut, command) |
|
|
|
map('i', shortcut, command) |
|
|
|
map('i', shortcut, command) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if vim.fn.exists("g:neovide") then |
|
|
|
|
|
|
|
vim.g.neovide_refresh_rate = 140 |
|
|
|
|
|
|
|
vim.opt.guifont = "Iosevka Nerd Font:h12" |
|
|
|
|
|
|
|
-- change to whatever font you prefer |
|
|
|
|
|
|
|
-- can check font with fc-cache on linux |
|
|
|
|
|
|
|
vim.g.neovide_hide_mouse_when_typing = true |
|
|
|
|
|
|
|
vim.g.neovide_refresh_rate_idle = 140 |
|
|
|
|
|
|
|
vim.g.neovide_scale_factor = 1.0 |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
-- <leader> is leader key; default is \ |
|
|
|
-- <leader> is leader key; default is \ |
|
|
|
nmap("<leader>v", "<cmd>NvimTreeToggle<cr>") |
|
|
|
nmap("<leader>v", "<cmd>NvimTreeToggle<cr>") |
|
|
|
nmap("<leader>ec", "<cmd>e ~/.config/nvim/init.lua<cr>") |
|
|
|
nmap("<leader>ec", "<cmd>e ~/.config/nvim/init.lua<cr>") |
|
|
@ -87,8 +94,7 @@ local on_attach = function(client, bufnr) |
|
|
|
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts) |
|
|
|
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts) |
|
|
|
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts) |
|
|
|
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts) |
|
|
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) |
|
|
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) |
|
|
|
-- won't need format on save if it always works |
|
|
|
vim.keymap.set('n', '<space>f', vim.lsp.buf.formatting, bufopts) |
|
|
|
-- vim.keymap.set('n', '<space>f', vim.lsp.buf.formatting, bufopts) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
require "coq".lsp_ensure_capabilities {} |
|
|
|
require "coq".lsp_ensure_capabilities {} |
|
|
|
require 'illuminate'.on_attach(client) |
|
|
|
require 'illuminate'.on_attach(client) |
|
|
@ -162,32 +168,17 @@ return require('packer').startup(function(use) |
|
|
|
} |
|
|
|
} |
|
|
|
use { |
|
|
|
use { |
|
|
|
'jose-elias-alvarez/null-ls.nvim', |
|
|
|
'jose-elias-alvarez/null-ls.nvim', |
|
|
|
config = function() require('null-ls').setup({ |
|
|
|
config = function() require("null-ls").setup { |
|
|
|
on_attach = function(client, bufnr) |
|
|
|
|
|
|
|
if client.supports_method("textDocument/formatting") then |
|
|
|
|
|
|
|
-- overwrites format on save if null-ls is loaded |
|
|
|
|
|
|
|
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) |
|
|
|
|
|
|
|
vim.api.nvim_create_autocmd("BufWritePre", { |
|
|
|
|
|
|
|
group = augroup, |
|
|
|
|
|
|
|
buffer = bufnr, |
|
|
|
|
|
|
|
callback = function() |
|
|
|
|
|
|
|
vim.lsp.buf.format({ bufnr = bufnr, filter = function(client) |
|
|
|
|
|
|
|
return client.name == "null-ls" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end, |
|
|
|
|
|
|
|
sources = { |
|
|
|
sources = { |
|
|
|
require('null-ls').builtins.formatting.eslint_d, |
|
|
|
require("null-ls").builtins.formatting.eslint_d, |
|
|
|
require('null-ls').builtins.diagnostics.eslint_d, |
|
|
|
require("null-ls").builtins.diagnostics.eslint_d, |
|
|
|
require("null-ls").builtins.code_actions.eslint_d, |
|
|
|
require("null-ls").builtins.code_actions.eslint_d, |
|
|
|
require("null-ls").builtins.diagnostics.flake8, |
|
|
|
require("null-ls").builtins.diagnostics.flake8, |
|
|
|
require("null-ls").builtins.formatting.black, |
|
|
|
require("null-ls").builtins.formatting.black.with { extra_args = { "--fast" } }, |
|
|
|
|
|
|
|
require("null-ls").builtins.formatting.isort, |
|
|
|
require("null-ls").builtins.code_actions.gitsigns |
|
|
|
require("null-ls").builtins.code_actions.gitsigns |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
end, |
|
|
|
end, |
|
|
|
requires = { "nvim-lua/plenary.nvim" }, |
|
|
|
requires = { "nvim-lua/plenary.nvim" }, |
|
|
|
} |
|
|
|
} |
|
|
@ -260,7 +251,7 @@ return require('packer').startup(function(use) |
|
|
|
use { 'lewis6991/gitsigns.nvim', |
|
|
|
use { 'lewis6991/gitsigns.nvim', |
|
|
|
config = function() |
|
|
|
config = function() |
|
|
|
require('gitsigns').setup { |
|
|
|
require('gitsigns').setup { |
|
|
|
on_attach = function(bufnr) |
|
|
|
on_attach = function() |
|
|
|
nmap('<leader>hd', '<cmd>Gitsigns diffthis<cr>') |
|
|
|
nmap('<leader>hd', '<cmd>Gitsigns diffthis<cr>') |
|
|
|
nmap('<leader>hp', '<cmd>Gitsigns preview_hunk<cr>') |
|
|
|
nmap('<leader>hp', '<cmd>Gitsigns preview_hunk<cr>') |
|
|
|
nmap('<leader>td', '<cmd>Gitsigns toggle_deleted<cr>') |
|
|
|
nmap('<leader>td', '<cmd>Gitsigns toggle_deleted<cr>') |
|
|
|