Merge branch 'dev' into gentoo

npm: add config
nvim: change PackerSync map
      add c/lua filetype settings
      add autopairs plugin
      update lua_lsp config
      fix coq maps
This commit is contained in:
David JULIEN 2021-10-30 15:32:17 +02:00
commit 86d2612e25
No known key found for this signature in database
GPG Key ID: 4B388E8BD9D47382
9 changed files with 43 additions and 8 deletions

4
.config/npm/npmrc Normal file
View File

@ -0,0 +1,4 @@
prefix=${XDG_DATA_HOME}/npm
cache=${XDG_CACHE_HOME}/npm
tmp=${XDG_RUNTIME_DIR}/npm
init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js

View File

@ -0,0 +1,9 @@
-- Author : swytch
-- Created : Saturday Oct. 30, 2021 11:43:34 CET
-- License : GPLv3
-- Description : c settings file
local opt = vim.opt
local g = vim.g
opt.formatoptions = "trq1jp"

View File

@ -0,0 +1,9 @@
-- Author : swytch
-- Created : Saturday Oct. 30, 2021 11:43:21 CET
-- License : GPLv3
-- Description : lua settings file
local opt = vim.opt
local g = vim.g
opt.formatoptions = "trq1jp"

View File

@ -7,7 +7,8 @@ utils.map("n", "<C-c>", "<cmd>CoqInterrupt<CR>")
utils.map("n", "<leader>j", "<cmd>CoqNext<CR>")
utils.map("n", "<leader>k", "<cmd>CoqUndo<CR>")
utils.map("n", "<leader><CR>", "<cmd>CoqToLine<CR>")
utils.map("n", "<leader>a", "<cmd>Coq About")
utils.map("n", "<leader>G", "<cmd>CoqJumpToEnd")
utils.map("n", "<leader>a", ":Coq About")
utils.map("n", "<leader>s", ":Coq Search")
utils.map("n", "<leader>G", "<cmd>CoqJumpToEnd<CR>")
utils.map("i", "//", "")

View File

@ -11,6 +11,10 @@ local sumneko_root_path = vim.fn.stdpath("data") ..
local sumneko_binary = sumneko_root_path .. "/bin/" .. system_name ..
"/lua-language-server"
local runtime_path = vim.split(package.path, ';')
table.insert(runtime_path, "lua/?.lua")
table.insert(runtime_path, "lua/?/init.lua")
require'lspconfig'.sumneko_lua.setup {
cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"};
settings = {
@ -19,7 +23,7 @@ require'lspconfig'.sumneko_lua.setup {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
-- Setup your lua path
path = vim.split(package.path, ';'),
path = runtime_path,
},
diagnostics = {
-- Get the language server to recognize the `vim` global
@ -27,10 +31,7 @@ require'lspconfig'.sumneko_lua.setup {
},
workspace = {
-- Make the server aware of Neovim runtime files
library = {
[vim.fn.expand('$VIMRUNTIME/lua')] = true,
[vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true,
},
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {

View File

@ -7,7 +7,7 @@ utils.map("n", "<space>", "<leader>")
utils.map("n", "<leader>y", "\"+y")
utils.map("n", "<leader>p", "\"+P")
utils.map("n", "<leader><enter>", "<cmd>w! | !compiler %<CR>")
utils.map("n", "<leader>s", "<cmd>PackerSync<CR>")
utils.map("n", "<leader>u", "<cmd>PackerSync<CR>")
utils.map("n", "<leader>c", "<cmd>ColorizerToggle<CR>")
-- LSP

View File

@ -5,6 +5,7 @@
local cmp = require("cmp")
local luasnip = require("luasnip")
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local t = function(str)
return vim.api.nvim_replace_termcodes(str, true, true, true)
@ -17,6 +18,9 @@ local check_backspace = function()
sub(col, col):match('%s') == nil
end
-- If you want insert `(` after select function or method item
cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = '' } }))
cmp.setup {
completion = {
autocomplete = false

View File

@ -86,6 +86,12 @@ return require("packer").startup(function()
config = function() require("plugin.comment") end
}
-- autopairs
use {
"windwp/nvim-autopairs",
config = function() require('nvim-autopairs').setup() end
}
-- display colors directly in editor
use {
"norcalli/nvim-colorizer.lua",

View File

@ -24,6 +24,7 @@ export TEXMFHOME="$XDG_DATA_HOME/texmf"
export CARGO_HOME="$XDG_DATA_HOME/cargo"
export OPAMROOT="$XDG_DATA_HOME/opam"
export COQBIN="$OPAMROOT/default/bin/"
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
## default programs
export GPG_ASKPASS="/usr/bin/pinentry-curses"