Compare commits
12 Commits
nvimlua
...
4bb4356727
Author | SHA1 | Date | |
---|---|---|---|
4bb4356727 | |||
7e6bfc2f4d | |||
243ea5a116 | |||
4ce449368e | |||
c65fffdd9c | |||
4e4b45bb24 | |||
e95bbfd0ad | |||
ea98f4be74 | |||
c897b57295 | |||
e9cf99cf8e | |||
da6ff29448 | |||
9dd08b6d18 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@ vifm/.config/vifm/vifm-help.txt
|
||||
vifm/.config/vifm/vifminfo.json
|
||||
|
||||
nvim/.config/nvim/autoload
|
||||
nvim/.config/nvim/plugin
|
||||
|
100
X/.Xdefaults
Normal file
100
X/.Xdefaults
Normal file
@@ -0,0 +1,100 @@
|
||||
!*.font: xft:monospace:size=9
|
||||
! URxvt*font: xft:Ubuntu Mono derivative Powerline:size=9
|
||||
! URxvt*font: xft:Hack Nerd Font:pixelsize=12,xft:UbuntuMono Nerd Font:pixelsize=12
|
||||
URxvt*font: xft:DroidSansMono Nerd Font Mono:pixelsize=14,xft:UbuntuMono Nerd Font:pixelsize=12
|
||||
URxvt*letterSpace: -1
|
||||
! URxvt*font: xft:Ubuntu Mono derivative Powerline:pixelsize=14,xft:Droid Sans Mono for Powerline:pixelsize=14,xft:DejaVu Sans Mono:pixelsize=14,xft:Droid Sans Fallback:pixelsize=14,xft:FreeSans:pixelsize=14,xft:FreeSans:pixelsize=14
|
||||
URxvt*scrollBar: false
|
||||
|
||||
URxvt.perl-ext-common: default,fullscreen,resize-font
|
||||
! fullscreen with F11
|
||||
URxvt.keysym.F11: perl:fullscreen:switch
|
||||
|
||||
! `font-size` plugin
|
||||
URxvt.resize-font.smaller: C-Down
|
||||
URxvt.resize-font.bigger: C-Up
|
||||
|
||||
|
||||
! ! URxvt.foreground: #f6f3e8
|
||||
! ! URxvt.background: #242424
|
||||
! ! URxvt.cursorColor: #f6f3e8
|
||||
! *.foreground: #fcfae1
|
||||
! *.background: #404040
|
||||
! *.cursorColor: #f595a7
|
||||
! *.color0: #404040
|
||||
! *.color8: #262626
|
||||
! *.color1: #b9454b
|
||||
! *.color9: #e75252
|
||||
! *.color2: #bd8d46
|
||||
! *.color10: #dea552
|
||||
! *.color3: #f6e497
|
||||
! *.color11: #d1c180
|
||||
! *.color4: #f595a7
|
||||
! *.color12: #d1a5ad
|
||||
! *.color5: #d28e2a
|
||||
! *.color13: #b47a24
|
||||
! *.color6: #ebcd4f
|
||||
! *.color14: #b9a659
|
||||
! *.color7: #fcfae1
|
||||
! *.color15: #f3f2e7
|
||||
!
|
||||
!
|
||||
! ! ! ANSI colours
|
||||
! ! ! black
|
||||
! ! URxvt.color0: #073642
|
||||
! ! URxvt.color8: #002636
|
||||
! ! ! red
|
||||
! ! URxvt.color1: #dc322f
|
||||
! ! URxvt.color9: #cb4b16
|
||||
! ! ! green
|
||||
! ! URxvt.color2: #859900
|
||||
! ! URxvt.color10: #586e75
|
||||
! ! ! yellow
|
||||
! ! URxvt.color3: #b58900
|
||||
! ! URxvt.color11: #657b83
|
||||
! ! ! blue
|
||||
! ! URxvt.color4: #268bd2
|
||||
! ! URxvt.color12: #839496
|
||||
! ! ! magenta
|
||||
! ! URxvt.color5: #d33682
|
||||
! ! URxvt.color13: #6c71c4
|
||||
! ! ! cyan
|
||||
! ! URxvt.color6: #2aa198
|
||||
! ! URxvt.color14: #93a1a1
|
||||
! ! ! white
|
||||
! ! URxvt.color7: #eee8d5
|
||||
! ! URxvt.color15: #fdf6e3
|
||||
!
|
||||
! ! Colored man
|
||||
! URxvt.colorIT: #87af5f
|
||||
! URxvt.colorBD: #d7d7d7
|
||||
! URxvt.colorUL: #87afd7
|
||||
|
||||
! hard contrast: *background: #1d2021
|
||||
*background: #282828
|
||||
! soft contrast: *background: #32302f
|
||||
*foreground: #ebdbb2
|
||||
! Black + DarkGrey
|
||||
*color0: #282828
|
||||
*color8: #928374
|
||||
! DarkRed + Red
|
||||
*color1: #cc241d
|
||||
*color9: #fb4934
|
||||
! DarkGreen + Green
|
||||
*color2: #98971a
|
||||
*color10: #b8bb26
|
||||
! DarkYellow + Yellow
|
||||
*color3: #d79921
|
||||
*color11: #fabd2f
|
||||
! DarkBlue + Blue
|
||||
*color4: #458588
|
||||
*color12: #83a598
|
||||
! DarkMagenta + Magenta
|
||||
*color5: #b16286
|
||||
*color13: #d3869b
|
||||
! DarkCyan + Cyan
|
||||
*color6: #689d6a
|
||||
*color14: #8ec07c
|
||||
! LightGrey + White
|
||||
*color7: #a89984
|
||||
*color15: #ebdbb2
|
@@ -1,18 +0,0 @@
|
||||
" Use completion-nvim in every buffer
|
||||
autocmd BufEnter * lua require'nvim-comp'.on_attach()
|
||||
|
||||
let g:completion_enable_snippet = 'UltiSnips'
|
||||
let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy']
|
||||
|
||||
" Use <Tab> and <S-Tab> to navigate through popup menu
|
||||
" inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||
" inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
|
||||
|
||||
"map <c-p> to manually trigger completion
|
||||
"imap <silent> <c-p> <Plug>(completion_trigger)
|
||||
|
||||
" Set completeopt to have a better completion experience
|
||||
set completeopt=menuone,noinsert,noselect
|
||||
|
||||
" Avoid showing message extra message when using completion
|
||||
set shortmess+=c
|
@@ -1,19 +0,0 @@
|
||||
" Better window navigation
|
||||
" nnoremap <C-h> <C-w>h
|
||||
" nnoremap <C-j> <C-w>j
|
||||
" nnoremap <C-k> <C-w>k
|
||||
" nnoremap <C-l> <C-w>l
|
||||
|
||||
" Align blocks of text and keep them selected
|
||||
vmap < <gv
|
||||
vmap > >gv
|
||||
|
||||
" Automatically spell check last error in insert mode
|
||||
inoremap <c-f> <c-g>u<Esc>[s1z=`]a<c-g>u
|
||||
|
||||
" Find files using Telescope command-line sugar.
|
||||
nnoremap <leader>e <cmd>Telescope find_files<cr>
|
||||
nnoremap <leader>g <cmd>Telescope live_grep<cr>
|
||||
nnoremap <leader>b <cmd>Telescope buffers<cr>
|
||||
nnoremap <leader>h <cmd>Telescope help_tags<cr>
|
||||
|
@@ -1,69 +0,0 @@
|
||||
" set leader key
|
||||
let g:mapleader = "\<Space>"
|
||||
|
||||
syntax enable " Enables syntax highlighing
|
||||
set hidden " Required to keep multiple buffers open multiple buffers
|
||||
set wrap " Display long lines as just one line
|
||||
set pumheight=10 " Makes popup menu smaller
|
||||
set encoding=utf-8 " The encoding displayed
|
||||
set fileencoding=utf-8 " The encoding written to file
|
||||
set ruler " Show the cursor position all the time
|
||||
set cmdheight=1 " More space for displaying messages
|
||||
set iskeyword+=- " treat dash separated words as a word text object"
|
||||
set mouse=a " Enable your mouse
|
||||
set t_Co=256 " Support 256 colors
|
||||
|
||||
set conceallevel=0 " So that I can see `` in markdown files
|
||||
set tabstop=4 " Insert 2 spaces for a tab
|
||||
set shiftwidth=4 " Change the number of space characters inserted for indentation
|
||||
set smarttab " Makes tabbing smarter will realize you have 2 vs 4
|
||||
set expandtab " Converts tabs to spaces
|
||||
set smartindent " Makes indenting smart
|
||||
set autoindent " Good auto indent
|
||||
set foldmethod=indent
|
||||
|
||||
set laststatus=2 " Always display the status line
|
||||
|
||||
set number " Line number
|
||||
set relativenumber " Relative line number
|
||||
set cursorline " Enable highlighting of the current line
|
||||
set showtabline=1 " show tabs only when there are some
|
||||
|
||||
set background=dark " tell vim what the background color looks like
|
||||
|
||||
set nobackup " This is recommended by coc
|
||||
set nowritebackup " This is recommended by coc
|
||||
set noswapfile
|
||||
|
||||
set updatetime=300 " Faster completion
|
||||
set timeoutlen=500 " By default timeoutlen is 1000 ms
|
||||
|
||||
set clipboard=unnamedplus " Copy paste between vim and everything else
|
||||
|
||||
set showmode " Display edition mode
|
||||
"set noshowmode " We don't need to see things like -- INSERT -- anymore
|
||||
|
||||
set incsearch " hightlight while searching
|
||||
set ignorecase " Ignore case while searching
|
||||
set smartcase " Override ignorecase if search patern contains upper case
|
||||
set wildmenu " Enable wildmenu
|
||||
|
||||
set spell " Enable spell checking
|
||||
set spelllang=fr,en
|
||||
|
||||
set nrformats+=alpha " letter concidered as number for Ctrl-A or Ctrl-X
|
||||
|
||||
"set autochdir " Your working directory will always be the same as your working directory
|
||||
|
||||
execute "set colorcolumn=" . join(range(81,335), ',')
|
||||
|
||||
colorscheme zenburn
|
||||
|
||||
" Set completeopt to have a better completion experience
|
||||
" set completeopt=menuone,noinsert,noselect
|
||||
" set completeopt=menuone,noselect
|
||||
|
||||
" Avoid showing message extra message when using completion
|
||||
set shortmess+=c
|
||||
|
||||
let g:indentLine_setConceal = 0
|
5
nvim/.config/nvim/init.lua
Normal file
5
nvim/.config/nvim/init.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
require('plugins')
|
||||
require('settings')
|
||||
require('mappings')
|
||||
|
||||
require('lsp')
|
@@ -1,18 +0,0 @@
|
||||
source $HOME/.config/nvim/plugins/plugins.vim
|
||||
source $HOME/.config/nvim/general/settings.vim
|
||||
source $HOME/.config/nvim/general/mappings.vim
|
||||
" source $HOME/.config/nvim/general/completion.vim
|
||||
|
||||
source $HOME/.config/nvim/plugins/lightline.vim
|
||||
source $HOME/.config/nvim/plugins/nvim-comp.vim
|
||||
source $HOME/.config/nvim/plugins/vimtex.vim
|
||||
|
||||
lua <<EOF
|
||||
require("lsp")
|
||||
EOF
|
||||
|
||||
" require("comp")
|
||||
|
||||
" bug fix with telescope and insert mode https://GitHub.com/vim telescope/telescope.vim/issues/82
|
||||
autocmd FileType TelescopePrompt
|
||||
\ call deoplete#custom#buffer_option('auto_complete', v:false)
|
@@ -1,78 +0,0 @@
|
||||
-- Configuration for nvim-compe
|
||||
|
||||
local utils = require('utils')
|
||||
|
||||
vim.cmd [[set shortmess+=c]]
|
||||
utils.opt('o', 'completeopt', 'menuone,noselect')
|
||||
|
||||
require'compe'.setup {
|
||||
enabled = true;
|
||||
autocomplete = true;
|
||||
debug = false;
|
||||
min_length = 1;
|
||||
preselect = 'enable';
|
||||
throttle_time = 80;
|
||||
source_timeout = 200;
|
||||
incomplete_delay = 400;
|
||||
allow_prefix_unmatch = false;
|
||||
max_abbr_width = 1000;
|
||||
max_kind_width = 1000;
|
||||
max_menu_width = 1000000;
|
||||
documentation = true;
|
||||
|
||||
|
||||
source = {
|
||||
path = true;
|
||||
buffer = true;
|
||||
calc = false;
|
||||
vsnip = true;
|
||||
nvim_lsp = true;
|
||||
nvim_lua = false;
|
||||
spell = true;
|
||||
tags = true;
|
||||
snippets_nvim = false;
|
||||
treesitter = true;
|
||||
};
|
||||
}
|
||||
|
||||
local t = function(str)
|
||||
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
||||
end
|
||||
|
||||
local check_back_space = function()
|
||||
local col = vim.fn.col('.') - 1
|
||||
if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
-- Use (s-)tab to:
|
||||
--- move to prev/next item in completion menuone
|
||||
--- jump to prev/next snippet's placeholder
|
||||
_G.tab_complete = function()
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
return t "<C-n>"
|
||||
elseif vim.fn.call("vsnip#available", {1}) == 1 then
|
||||
return t "<Plug>(vsnip-expand-or-jump)"
|
||||
elseif check_back_space() then
|
||||
return t "<Tab>"
|
||||
else
|
||||
return vim.fn['compe#complete']()
|
||||
end
|
||||
end
|
||||
_G.s_tab_complete = function()
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
return t "<C-p>"
|
||||
elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then
|
||||
return t "<Plug>(vsnip-jump-prev)"
|
||||
else
|
||||
return t "<S-Tab>"
|
||||
end
|
||||
end
|
||||
|
||||
utils.map("i", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
||||
utils.map("s", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
||||
utils.map("i", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
||||
utils.map("s", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
98
nvim/.config/nvim/lua/completion.lua
Normal file
98
nvim/.config/nvim/lua/completion.lua
Normal file
@@ -0,0 +1,98 @@
|
||||
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
|
||||
end
|
||||
|
||||
local feedkey = function(key, mode)
|
||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true)
|
||||
end
|
||||
|
||||
local lsp_symbols = {
|
||||
Text = " (Text) ",
|
||||
Method = " (Method)",
|
||||
Function = " (Function)",
|
||||
Constructor = " (Constructor)",
|
||||
Field = " ﴲ (Field)",
|
||||
Variable = "[] (Variable)",
|
||||
Class = " (Class)",
|
||||
Interface = " ﰮ (Interface)",
|
||||
Module = " (Module)",
|
||||
Property = " 襁 (Property)",
|
||||
Unit = " (Unit)",
|
||||
Value = " (Value)",
|
||||
Enum = " 練 (Enum)",
|
||||
Keyword = " (Keyword)",
|
||||
Snippet = " (Snippet)",
|
||||
Color = " (Color)",
|
||||
File = " (File)",
|
||||
Reference = " (Reference)",
|
||||
Folder = " (Folder)",
|
||||
EnumMember = " (EnumMember)",
|
||||
Constant = " ﲀ (Constant)",
|
||||
Struct = " ﳤ (Struct)",
|
||||
Event = " (Event)",
|
||||
Operator = " (Operator)",
|
||||
TypeParameter = " (TypeParameter)",
|
||||
}
|
||||
|
||||
local cmp = require'cmp'
|
||||
cmp.setup{
|
||||
completion = {
|
||||
completeopt = 'menuone,noselect',
|
||||
},
|
||||
formatting = {
|
||||
format = function(entry, vim_item)
|
||||
-- fancy icons and a name of kind
|
||||
vim_item.kind = lsp_symbols[vim_item.kind]
|
||||
-- set a name for each source
|
||||
vim_item.menu = ({
|
||||
buffer = "[Buffer]",
|
||||
nvim_lsp = "[LSP]",
|
||||
vsnip = "[vSnip]",
|
||||
path = "[Path]",
|
||||
spell = "[Spell]",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
-- ["<cr>"] = cmp.mapping.confirm({select = true, behavior = cmp.ConfirmBehavior.Replace}),
|
||||
["<cr>"] = cmp.mapping.confirm({select = true, behavior = cmp.ConfirmBehavior.Insert}),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
feedkey("<C-n>", "n")
|
||||
elseif vim.fn["vsnip#available"]() == 1 then
|
||||
feedkey("<Plug>(vsnip-expand-or-jump)", "")
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback() -- The fallback function sends a already mapped key. In this case, it's probably `<Tab>`.
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
|
||||
["<S-Tab>"] = cmp.mapping(function()
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
feedkey("<C-p>", "n")
|
||||
elseif vim.fn["vsnip#jumpable"](-1) == 1 then
|
||||
feedkey("<Plug>(vsnip-jump-prev)", "")
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
},
|
||||
sources = {
|
||||
{ name = 'vsnip' },
|
||||
{ name = 'buffer' },
|
||||
{ name = 'path' },
|
||||
{ name = 'spell' },
|
||||
}
|
||||
}
|
||||
|
||||
vim.cmd [[autocmd FileType TelescopePrompt lua require('cmp').setup.buffer { enabled = false }]]
|
||||
vim.g.vsnip_snippet_dir = '~/.config/nvim/vsnips'
|
1
nvim/.config/nvim/lua/config/notes.lua
Normal file
1
nvim/.config/nvim/lua/config/notes.lua
Normal file
@@ -0,0 +1 @@
|
||||
vim.g.notes_directories = { "~/Documents/Notes", "~/Nextcloud/Notes/vim" }
|
23
nvim/.config/nvim/lua/config/vimtex.lua
Normal file
23
nvim/.config/nvim/lua/config/vimtex.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
vim.g.vimtex_compiler_latex = {}
|
||||
vim.g.vimtex_compiler_latex["backend"] = 'nvim'
|
||||
|
||||
vim.g.vimtex_compiler_latex['backend'] = 'nvim'
|
||||
vim.g.vimtex_compiler_latex['background'] = 1
|
||||
vim.g.vimtex_compiler_latex[ 'build_dir'] = ''
|
||||
vim.g.vimtex_compiler_latex[ 'callback'] = 0
|
||||
vim.g.vimtex_compiler_latex[ 'continuous'] = 1
|
||||
vim.g.vimtex_compiler_latex[ 'options'] = { '-pdf',
|
||||
'-verbose',
|
||||
'-file-line-error',
|
||||
'-synctex=1',
|
||||
'-interaction=nonstopmode',
|
||||
'-silent',
|
||||
'-shell-escape',
|
||||
}
|
||||
|
||||
vim.g.vimtex_view_method = 'zathura'
|
||||
|
||||
-- Les fichiers sty et cls sont vus comme des fichiers tex
|
||||
vim.cmd("autocmd BufRead,BufNewFile *.{sty,cls} setlocal syntax=tex")
|
@@ -51,7 +51,7 @@ for _, lsp in ipairs(servers) do
|
||||
on_attach = on_attach,
|
||||
flags = {
|
||||
debounce_text_changes = 150,
|
||||
}
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
|
31
nvim/.config/nvim/lua/lualine_.lua
Normal file
31
nvim/.config/nvim/lua/lualine_.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
require('lualine').setup{
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'gruvbox',
|
||||
component_separators = {'', ''},
|
||||
section_separators = {'', ''},
|
||||
disabled_filetypes = {}
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {'mode'},
|
||||
lualine_b = {'branch'},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {
|
||||
{ 'diagnostics', sources = {"nvim_lsp"}, symbols = {error = ' ', warn = ' ', info = ' ', hint = ' '} },
|
||||
'encoding',
|
||||
'filetype'
|
||||
},
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location'}
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'location'},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {}
|
||||
}
|
23
nvim/.config/nvim/lua/mappings.lua
Normal file
23
nvim/.config/nvim/lua/mappings.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
local map = vim.api.nvim_set_keymap
|
||||
local default_opts = {noremap = true, silent = true}
|
||||
|
||||
-- move around splits using Ctrl + {h,j,k,l}
|
||||
map('n', '<C-h>', '<C-w>h', default_opts)
|
||||
map('n', '<C-j>', '<C-w>j', default_opts)
|
||||
map('n', '<C-k>', '<C-w>k', default_opts)
|
||||
map('n', '<C-l>', '<C-w>l', default_opts)
|
||||
|
||||
-- Align blocks of text and keep them selected
|
||||
map('v', '<', '<gv', {})
|
||||
map('v', '>', '>gv', {})
|
||||
|
||||
|
||||
-- Automatically spell check last error in insert mode
|
||||
map('i', '<c-f>', '<c-g>u<Esc>[s1z=`]a<c-g>u', default_opts)
|
||||
|
||||
-- Find files using Telescope command-line sugar.
|
||||
map('n', '<leader>e', '<cmd>Telescope find_files<cr>', {})
|
||||
map('n', '<leader>g', '<cmd>Telescope live_grep<cr>', {})
|
||||
map('n', '<leader>b', '<cmd>Telescope buffers<cr>', {})
|
||||
map('n', '<leader>h', '<cmd>Telescope help_tags<cr>', {})
|
||||
|
99
nvim/.config/nvim/lua/plugins.lua
Normal file
99
nvim/.config/nvim/lua/plugins.lua
Normal file
@@ -0,0 +1,99 @@
|
||||
-- Only required if you have packer configured as `opt`
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
|
||||
return require('packer').startup(function()
|
||||
use 'morhetz/gruvbox'
|
||||
|
||||
-- Status line
|
||||
use {
|
||||
'hoob3rt/lualine.nvim',
|
||||
config = function ()
|
||||
require('lualine').setup{
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'gruvbox',
|
||||
component_separators = {'', ''},
|
||||
section_separators = {'', ''},
|
||||
disabled_filetypes = {}
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {'mode'},
|
||||
lualine_b = {'branch'},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {
|
||||
{ 'diagnostics', sources = {"nvim_lsp"}, symbols = {error = ' ', warn = ' ', info = ' ', hint = ' '} },
|
||||
'encoding',
|
||||
'filetype'
|
||||
},
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location'}
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'location'},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {}
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
use 'tpope/vim-fugitive'
|
||||
use 'mhinz/vim-signify'
|
||||
|
||||
use 'tpope/vim-surround'
|
||||
use 'tpope/vim-repeat'
|
||||
|
||||
use {
|
||||
'neovim/nvim-lspconfig',
|
||||
requires = {
|
||||
"hrsh7th/cmp-nvim-lsp"
|
||||
}
|
||||
}
|
||||
use {
|
||||
'hrsh7th/nvim-cmp',
|
||||
event = 'InsertEnter',
|
||||
config = [[require('completion')]],
|
||||
requires = {
|
||||
-- 'hrsh7th/vim-vsnip-integ',
|
||||
'hrsh7th/vim-vsnip',
|
||||
'rafamadriz/friendly-snippets',
|
||||
},
|
||||
}
|
||||
use {'hrsh7th/cmp-vsnip', after = 'nvim-cmp'}
|
||||
use {'hrsh7th/cmp-buffer', after = 'nvim-cmp'}
|
||||
use {'hrsh7th/cmp-path', after = 'nvim-cmp'}
|
||||
use {'hrsh7th/cmp-nvim-lsp', after = 'nvim-cmp'}
|
||||
use {'f3fora/cmp-spell', after = 'nvim-cmp'}
|
||||
|
||||
|
||||
use 'nvim-lua/popup.nvim'
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
requires = { {'nvim-lua/plenary.nvim'} }
|
||||
}
|
||||
|
||||
use {
|
||||
'lervag/vimtex',
|
||||
config = [[require('config.vimtex')]],
|
||||
}
|
||||
|
||||
-- Highlight on Yank
|
||||
use 'machakann/vim-highlightedyank'
|
||||
-- Autoclose parenthesis
|
||||
use 'jiangmiao/auto-pairs'
|
||||
|
||||
use 'kyazdani42/nvim-web-devicons'
|
||||
use {
|
||||
'xolox/vim-notes',
|
||||
config = [[require('config.notes')]],
|
||||
requires = {
|
||||
'xolox/vim-misc',
|
||||
}
|
||||
}
|
||||
|
||||
end)
|
51
nvim/.config/nvim/lua/settings.lua
Normal file
51
nvim/.config/nvim/lua/settings.lua
Normal file
@@ -0,0 +1,51 @@
|
||||
local cmd = vim.cmd -- execute Vim commands
|
||||
local exec = vim.api.nvim_exec -- execute Vimscript
|
||||
-- local fn = vim.fn -- call Vim functions
|
||||
local g = vim.g -- global variables
|
||||
local opt = vim.opt -- global/buffer/windows-scoped options
|
||||
|
||||
g.mapleader = ' ' -- Leaderkey
|
||||
g.showmode = true
|
||||
g.hidden = true -- Required to keep multiple buffers open multiple buffers
|
||||
opt.mouse = 'a' -- enable mouse
|
||||
opt.clipboard = 'unnamedplus' -- copy/paste with system
|
||||
opt.swapfile = false -- no swapfile
|
||||
|
||||
opt.wrap = true -- Display long lines as just one line
|
||||
opt.expandtab = true -- Use space instead of tabs
|
||||
opt.tabstop = 4 -- Insert 4 spaces for a tab
|
||||
opt.shiftwidth = 4 -- Change the number of space characters inserted for indentation
|
||||
opt.smarttab = true -- Makes tabbing smarter will realize you have 2 vs 4
|
||||
opt.autoindent = true -- Good auto indent
|
||||
opt.foldmethod='indent'
|
||||
|
||||
opt.number = true -- show line number
|
||||
opt.relativenumber = true -- show relative line number
|
||||
opt.cursorline = true -- highlight current line
|
||||
|
||||
opt.ignorecase = true -- Ignore case on search
|
||||
opt.smartcase = true -- ignore lowercse for the whoel pattern
|
||||
|
||||
opt.completeopt = 'menuone,noselect,noinsert' -- completion options
|
||||
|
||||
opt.spell = true
|
||||
opt.spelllang = {'fr', 'en'}
|
||||
|
||||
opt.nrformats = opt.nrformats + 'alpha'
|
||||
|
||||
g.showtabline = true
|
||||
|
||||
-- don't auto commenting new lines
|
||||
cmd[[au BufEnter * set fo-=c fo-=r fo-=o]]
|
||||
|
||||
opt.showmatch = true -- show parenthethis match
|
||||
|
||||
-- Highlight on yank
|
||||
exec([[
|
||||
augroup YankHighlight
|
||||
autocmd!
|
||||
autocmd TextYankPost * silent! lua vim.highlight.on_yank{higroup="IncSearch", timeout=700}
|
||||
augroup end
|
||||
]], false)
|
||||
|
||||
cmd('colorscheme gruvbox')
|
@@ -1,10 +0,0 @@
|
||||
let g:lightline = {
|
||||
\ 'colorscheme': 'wombat',
|
||||
\ 'active': {
|
||||
\ 'left': [ [ 'mode', 'paste' ],
|
||||
\ [ 'gitbranch', 'readonly', 'relativepath', 'modified'] ]
|
||||
\ },
|
||||
\ 'component_function': {
|
||||
\ 'gitbranch': 'FugitiveHead'
|
||||
\ },
|
||||
\ }
|
@@ -1,101 +0,0 @@
|
||||
let g:compe = {}
|
||||
let g:compe.enabled = v:true
|
||||
let g:compe.autocomplete = v:true
|
||||
let g:compe.debug = v:false
|
||||
let g:compe.min_length = 1
|
||||
let g:compe.preselect = 'enable'
|
||||
let g:compe.throttle_time = 80
|
||||
let g:compe.source_timeout = 200
|
||||
let g:compe.resolve_timeout = 800
|
||||
let g:compe.incomplete_delay = 400
|
||||
let g:compe.max_abbr_width = 100
|
||||
let g:compe.max_kind_width = 100
|
||||
let g:compe.max_menu_width = 100
|
||||
let g:compe.documentation = v:true
|
||||
|
||||
let g:compe.source = {}
|
||||
let g:compe.source.path = v:true
|
||||
let g:compe.source.buffer = v:true
|
||||
let g:compe.source.calc = v:true
|
||||
let g:compe.source.nvim_lsp = v:true
|
||||
let g:compe.source.nvim_lua = v:true
|
||||
let g:compe.source.vsnip = v:true
|
||||
let g:compe.source.ultisnips = v:true
|
||||
let g:compe.source.luasnip = v:true
|
||||
let g:compe.source.emoji = v:false
|
||||
|
||||
" NOTE: You can use other key to expand snippet.
|
||||
|
||||
|
||||
" Expand
|
||||
imap <expr> <C-j> vsnip#expandable() ? '<Plug>(vsnip-expand)' : '<C-j>'
|
||||
smap <expr> <C-j> vsnip#expandable() ? '<Plug>(vsnip-expand)' : '<C-j>'
|
||||
|
||||
" Expand or jump
|
||||
imap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>'
|
||||
smap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>'
|
||||
|
||||
" Jump forward or backward
|
||||
imap <expr> <Tab> vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : '<Tab>'
|
||||
smap <expr> <Tab> vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : '<Tab>'
|
||||
imap <expr> <S-Tab> vsnip#jumpable(-1) ? '<Plug>(vsnip-jump-prev)' : '<S-Tab>'
|
||||
smap <expr> <S-Tab> vsnip#jumpable(-1) ? '<Plug>(vsnip-jump-prev)' : '<S-Tab>'
|
||||
|
||||
" Select or cut text to use as $TM_SELECTED_TEXT in the next snippet.
|
||||
" See https://github.com/hrsh7th/vim-vsnip/pull/50
|
||||
nmap s <Plug>(vsnip-select-text)
|
||||
xmap s <Plug>(vsnip-select-text)
|
||||
nmap S <Plug>(vsnip-cut-text)
|
||||
xmap S <Plug>(vsnip-cut-text)
|
||||
|
||||
" " If you want to use snippet for multiple filetypes, you can `g:vsnip_filetypes` for it.
|
||||
" let g:vsnip_filetypes = {}
|
||||
" let g:vsnip_filetypes.javascriptreact = ['javascript']
|
||||
" let g:vsnip_filetypes.typescriptreact = ['typescript']
|
||||
|
||||
lua << EOF
|
||||
local t = function(str)
|
||||
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
||||
end
|
||||
|
||||
local check_back_space = function()
|
||||
local col = vim.fn.col('.') - 1
|
||||
if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
-- Use (s-)tab to:
|
||||
--- move to prev/next item in completion menuone
|
||||
--- jump to prev/next snippet's placeholder
|
||||
_G.tab_complete = function()
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
return t "<C-n>"
|
||||
elseif check_back_space() then
|
||||
return t "<Tab>"
|
||||
else
|
||||
return vim.fn['compe#complete']()
|
||||
end
|
||||
end
|
||||
_G.s_tab_complete = function()
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
return t "<C-p>"
|
||||
else
|
||||
return t "<S-Tab>"
|
||||
end
|
||||
end
|
||||
|
||||
vim.api.nvim_set_keymap("i", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
||||
vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
||||
vim.api.nvim_set_keymap("i", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
||||
vim.api.nvim_set_keymap("s", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
||||
|
||||
--This line is important for auto-import
|
||||
vim.api.nvim_set_keymap('i', '<cr>', 'compe#confirm("<cr>")', { expr = true })
|
||||
vim.api.nvim_set_keymap('i', '<c-space>', 'compe#complete()', { expr = true })
|
||||
EOF
|
||||
|
||||
let g:vsnip_snippet_dir = expand('~/.config/nvim/vsnips')
|
||||
|
@@ -1,48 +0,0 @@
|
||||
" auto-install vim-plug
|
||||
if empty(glob('~/.config/nvim/autoload/plug.vim'))
|
||||
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
|
||||
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||
"autocmd VimEnter * PlugInstall
|
||||
"autocmd VimEnter * PlugInstall | source $MYVIMRC
|
||||
endif
|
||||
|
||||
call plug#begin('~/.config/nvim/autoload/plugged')
|
||||
|
||||
Plug 'jnurmine/Zenburn'
|
||||
Plug 'itchyny/lightline.vim'
|
||||
|
||||
"Plug 'tpope/vim-sensible'
|
||||
Plug 'tpope/vim-fugitive'
|
||||
Plug 'mhinz/vim-signify'
|
||||
Plug 'tpope/vim-surround'
|
||||
Plug 'tpope/vim-repeat'
|
||||
|
||||
Plug 'junegunn/goyo.vim'
|
||||
Plug 'christoomey/vim-tmux-navigator'
|
||||
Plug 'Yggdroot/indentLine'
|
||||
|
||||
" Plug 'SirVer/ultisnips'
|
||||
" Plug 'honza/vim-snippets'
|
||||
Plug 'neovim/nvim-lspconfig'
|
||||
Plug 'hrsh7th/nvim-compe'
|
||||
Plug 'hrsh7th/vim-vsnip'
|
||||
Plug 'hrsh7th/vim-vsnip-integ'
|
||||
Plug 'rafamadriz/friendly-snippets'
|
||||
|
||||
" Plug 'nvim-lua/completion-nvim'
|
||||
|
||||
Plug 'nvim-lua/popup.nvim'
|
||||
Plug 'nvim-lua/plenary.nvim'
|
||||
Plug 'nvim-telescope/telescope.nvim'
|
||||
|
||||
Plug 'lervag/vimtex'
|
||||
|
||||
" Highlight on Yank
|
||||
Plug 'machakann/vim-highlightedyank'
|
||||
" Autoclose parenthesis
|
||||
" Plug 'cohama/lexima.vim'
|
||||
Plug 'jiangmiao/auto-pairs'
|
||||
|
||||
" Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
||||
|
||||
call plug#end()
|
@@ -1,25 +0,0 @@
|
||||
let maplocalleader = "\<Space>"
|
||||
|
||||
let g:tex_conceal = ""
|
||||
set conceallevel=0
|
||||
|
||||
let g:vimtex_compiler_latexmk = {
|
||||
\ 'backend' : 'nvim',
|
||||
\ 'background' : 1,
|
||||
\ 'build_dir' : '',
|
||||
\ 'callback' : 0,
|
||||
\ 'continuous' : 1,
|
||||
\ 'options' : [
|
||||
\ '-pdf',
|
||||
\ '-verbose',
|
||||
\ '-file-line-error',
|
||||
\ '-synctex=1',
|
||||
\ '-interaction=nonstopmode',
|
||||
\ '-silent',
|
||||
\ '-shell-escape',
|
||||
\ ],
|
||||
\}
|
||||
let g:vimtex_view_method = 'zathura'
|
||||
|
||||
" Les fichiers sty et cls sont vus comme des fichiers tex
|
||||
autocmd BufRead,BufNewFile *.{sty,cls} setlocal syntax=tex
|
@@ -3,9 +3,9 @@
|
||||
"prefix": "tabular",
|
||||
"body": [
|
||||
"\\\\begin{tabular}{$1}",
|
||||
"\\\\hline",
|
||||
"\t\\\\hline",
|
||||
"\t$0",
|
||||
"\\\\hline",
|
||||
"\t\\\\hline",
|
||||
"\\\\end{tabular}"
|
||||
],
|
||||
"description": "tabular"
|
||||
|
Reference in New Issue
Block a user