Compare commits

..

No commits in common. "c21c9096c900df69dba7a875fed44b28ef2e0d97" and "c7333aa79addf4c915d991e51f21972a3eb89a77" have entirely different histories.

7 changed files with 39 additions and 45 deletions

View File

@ -48,7 +48,6 @@ https://www.youtube.com/feeds/videos.xml?channel_id=UCjHh3N6jUJKdrtTqNorpRhg "Sk
https://www.youtube.com/feeds/videos.xml?channel_id=UCdtrhMQTlTWNLGcmx1Qy80Q "Ski" "Fabien Maierhofer"
https://www.youtube.com/feeds/videos.xml?channel_id=UChkpEJqHjX-tGmYoGf8jdGA "Escalade" "EpicTV Relais Vertical"
https://www.youtube.com/feeds/videos.xml?channel_id=UCJlvyoYGLr3UIV0oD4-aarA "Sports" "Riding zone"
https://www.youtube.com/feeds/videos.xml?channel_id=UCy0I5Hcl2k7dN4UdZTedfeQ "Sports" "Hit the road"
https://www.youtube.com/feeds/videos.xml?channel_id=UCgkhWgBGRp0sdFy2MHDWfSg "Math" "El Ji"

View File

@ -1,13 +1,13 @@
local has_words_before = function()
if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then
return false
end
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then
return false
end
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local feedkey = function(key, mode)
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true)
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true)
end
local lsp_symbols = {
@ -41,9 +41,9 @@ local lsp_symbols = {
local status, cmp = pcall(require, "cmp")
if (not status) then return end
cmp.setup {
cmp.setup{
completion = {
completeopt = 'menuone,noinsert,noselect',
completeopt = 'menuone,noinsert,noselect',
},
formatting = {
format = function(entry, vim_item)
@ -66,7 +66,7 @@ cmp.setup {
end,
},
mapping = {
["<cr>"] = cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Replace }),
["<cr>"] = cmp.mapping.confirm({select = false, behavior = cmp.ConfirmBehavior.Replace}),
-- ["<Tab>"] = cmp.mapping.confirm({select = true, behavior = cmp.ConfirmBehavior.Insert}),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
@ -92,9 +92,9 @@ cmp.setup {
{ name = 'vsnip' },
{ name = 'nvim_lsp' },
{ name = 'path' },
{
name = 'buffer',
keyword_length = 4,
{
name = 'buffer',
keyword_length = 4,
keyword_pattern = [[\d\@!\k\k*]],
options = {
-- keyword_pattern = [[\k\+]]-- for non ascii caracters
@ -123,7 +123,8 @@ cmp.setup.cmdline('/', {
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' },
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})

View File

@ -3,14 +3,6 @@ if not null_ls_status_ok then
return
end
local mason_null_ls_status_ok, mason_null_ls = pcall(require, "mason-null-ls")
if not null_ls_status_ok then
return
end
require("mason-null-ls").setup({
})
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
local formatting = null_ls.builtins.formatting
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
@ -26,3 +18,6 @@ null_ls.setup {
diagnostics.yamllint,
},
}
local map = vim.api.nvim_set_keymap
map('n', '<leader>f', '<cmd>lua vim.lsp.buf.formatting_sync()<cr>', {})

View File

@ -3,7 +3,7 @@ if (not status) then return end
ts.setup {
-- One of "all", "maintained" (parsers with maintainers), or a list of languages
ensure_installed = {"python", "css", "html", "lua", "javascript", "vue", "c", "markdown", "rst", "cpp"},
ensure_installed = {"python", "css", "html", "lua", "javascript", "vue", "c", "markdown", "rst"},
highlight = {
enable = true,
additional_vim_regex_highlighting = false,

View File

@ -1,5 +1,20 @@
require("mason").setup()
require("mason-lspconfig").setup()
local lsp_installer = require("nvim-lsp-installer")
-- Register a handler that will be called for each installed server when it's ready (i.e. when installation is finished
-- or if the server is already installed).
lsp_installer.on_server_ready(function(server)
local opts = {}
-- (optional) Customize the options passed to the server
-- if server.name == "tsserver" then
-- opts.root_dir = function() ... end
-- end
-- This setup() function will take the provided server configuration and decorate it with the necessary properties
-- before passing it onwards to lspconfig.
-- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
server:setup(opts)
end)
local nvim_lsp = require('lspconfig')
-- Use an on_attach function to only map the following keys
@ -31,7 +46,7 @@ local on_attach = function(client, bufnr)
buf_set_keymap('n', '<leader>dp', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts)
-- Get diagnostic on local list
buf_set_keymap('n', '<leader>q', '<cmd>lua vim.diagnostic.setloclist()<CR>', opts)
buf_set_keymap("n", "<leader>f", "<cmd>lua vim.lsp.buf.format()<CR>", opts)
buf_set_keymap("n", "<leader>f", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
buf_set_keymap('n', 'gD', '<Cmd>lua vim.lsp.buf.declaration()<CR>', opts)
buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
@ -66,11 +81,3 @@ nvim_lsp.vuels.setup{
client.resolved_capabilities.document_formatting = true
end;
}
nvim_lsp.ltex.setup{
settings = {
ltex = {
language = "fr",
}
}
}

View File

@ -60,11 +60,10 @@ return packer.startup(function(use)
use 'tpope/vim-repeat'
use {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
'neovim/nvim-lspconfig',
requires = {
"hrsh7th/cmp-nvim-lsp",
'williamboman/nvim-lsp-installer',
}
}
use {
@ -86,10 +85,7 @@ return packer.startup(function(use)
-- for formatters and linters
use {
"jose-elias-alvarez/null-ls.nvim",
config = [[require('config.null-ls')]],
requires = {
"jayp0521/mason-null-ls.nvim"
}
config = [[require('config.null-ls')]]
}
@ -101,9 +97,7 @@ return packer.startup(function(use)
}
use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
use {
"nvim-telescope/telescope-file-browser.nvim"
}
use { "nvim-telescope/telescope-file-browser.nvim" }
use {
'lervag/vimtex',

View File

@ -234,8 +234,6 @@ fileviewer *.[1-8] man ./%c | col -b
" Images
filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
\ {View in feh}
\ feh %f,
\ {View in sxiv}
\ sxiv %f,
\ {View in gpicview}