Compare commits
No commits in common. "16f1e00291359afbe06b29302aa4195acaba949b" and "f1b7a5959587f00599d26fef7baf41c92083b5c0" have entirely different histories.
16f1e00291
...
f1b7a59595
12 changed files with 2864 additions and 193 deletions
21
README.md
21
README.md
|
@ -1,24 +1,17 @@
|
||||||
NeoVim Setup files
|
NeoVim Setup files
|
||||||
===============
|
===============
|
||||||
|
|
||||||
This is mys neovim configuration with lua and paq plugins manager
|
This is my NeoVim setup with Vim-Plug and plugins :
|
||||||
|
|
||||||
|
* Base16 themes
|
||||||
|
* Syntastic plugin
|
||||||
|
* NerdTree plugin
|
||||||
|
* Vim-Airline
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
This Nvim installation need somes dependencies:
|
|
||||||
|
|
||||||
* gcc (Tree-Sitter)
|
|
||||||
* g++ (Tree-Sitter)
|
|
||||||
* clang (Tree-sitter)
|
|
||||||
|
|
||||||
For install plugins, you need to execute neovim with arguments like below
|
|
||||||
|
|
||||||
```
|
|
||||||
nvim --headless -u NONE -c 'lua require("plugins").bootstrap_paq()'
|
|
||||||
```
|
|
||||||
|
|
||||||
This repository is installable with [dotinstall][l_dotinstall] :
|
This repository is installable with [dotinstall][l_dotinstall] :
|
||||||
|
|
||||||
```
|
```
|
||||||
dotinstall https://git.epha.se/ephase/dotinstall.git
|
dotinstall https://git.epha.se/ephase/vim.git
|
||||||
```
|
```
|
||||||
|
|
2797
conf/nvim/autoload/plug.vim
Normal file
2797
conf/nvim/autoload/plug.vim
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,28 +0,0 @@
|
||||||
local PKGS = {
|
|
||||||
"savq/paq-nvim";
|
|
||||||
-- List your packages here!
|
|
||||||
}
|
|
||||||
local function clone_paq()
|
|
||||||
local path = vim.fn.stdpath('data') .. '/site/pack/paqs/start/paq-nvim'
|
|
||||||
if vim.fn.empty(vim.fn.glob(path)) > 0 then
|
|
||||||
vim.fn.system {
|
|
||||||
'git',
|
|
||||||
'clone',
|
|
||||||
'--depth=1',
|
|
||||||
'https://github.com/savq/paq-nvim.git',
|
|
||||||
path
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local function bootstrap_paq()
|
|
||||||
clone_paq()
|
|
||||||
-- Load Paq
|
|
||||||
vim.cmd('packadd paq-nvim')
|
|
||||||
local paq = require('paq')
|
|
||||||
-- Exit nvim after installing plugins
|
|
||||||
vim.cmd('autocmd User PaqDoneInstall quit')
|
|
||||||
-- Read and install packages
|
|
||||||
paq(PKGS)
|
|
||||||
paq.install()
|
|
||||||
end
|
|
||||||
return { bootstrap_paq = bootstrap_paq }
|
|
|
@ -1,5 +1,8 @@
|
||||||
|
|
||||||
-- " Key biding
|
-- " Key biding
|
||||||
-- " ----------
|
-- " ----------
|
||||||
|
-- map {'', '[C-left]', ':tabprevious<CR>', noremap = false, silent = true}
|
||||||
|
-- map {'', '[C-right]', ':tabnext<CR>', noremap = false, silent = true}
|
||||||
map {'n', '<leader>/', ':nohlsearch<CR>', noremap = false, silent = true}
|
map {'n', '<leader>/', ':nohlsearch<CR>', noremap = false, silent = true}
|
||||||
map {'n', '<F2>', ':NERDTreeToggle<CR>', noremap = false, silent = true}
|
map {'n', '<F2>', ':NERDTreeToggle<CR>', noremap = false, silent = true}
|
||||||
|
|
||||||
|
@ -13,12 +16,17 @@ local t = function(str)
|
||||||
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- git sign
|
_G.smart_tab = function()
|
||||||
-- Actions
|
if vim.fn.pumvisible() == 1 then
|
||||||
local opts = { noremap = true, silent = true}
|
return t'<C-n>'
|
||||||
--vim.api.nvim_set_keymap('n', '<leader>gp', require("gitsigns").preview_hunk, opts)
|
else
|
||||||
vim.api.nvim_set_keymap('n', '<leader>gn', [[<cmd>lua require('gitsigns').next_hunk()<CR>]], opts)
|
return t'<Tab>'
|
||||||
vim.api.nvim_set_keymap('n', '<leader>gN', [[<cmd>lua require('gitsigns').prev_hunk()<CR>]], opts)
|
end
|
||||||
vim.api.nvim_set_keymap('n', '<leader>gs', ':Gitsigns stage_hunk<CR>', opts)
|
end
|
||||||
vim.api.nvim_set_keymap('n', '<leader>gr', ':Gitsigns reset_hunk<CR>', opts)
|
|
||||||
vim.api.nvim_set_keymap('n', '<leader>gd', [[<cmd>lua require("gitsigns").diffthis('~')<CR>]], opts)
|
vim.api.nvim_set_keymap(
|
||||||
|
'i',
|
||||||
|
'<Tab>',
|
||||||
|
'v:lua.smart_tab()',
|
||||||
|
{noremap = true, expr = true}
|
||||||
|
)
|
||||||
|
|
|
@ -1,13 +1,30 @@
|
||||||
-- Global variables
|
-- Global variables
|
||||||
vim.g['base16colorspace'] = 256
|
vim.g['base16colorspace'] = 256
|
||||||
|
|
||||||
|
-- Vim-airLine
|
||||||
|
vim.g['airline#extensions#tabline#enabled'] = 1
|
||||||
|
vim.g['airline#extensions#tabline#left_sep'] = ''
|
||||||
|
vim.g['airline#extensions#tabline#left_alt_sep'] = '|'
|
||||||
|
vim.g['g:airline_powerline_fonts'] = 1
|
||||||
|
vim.g['airline_skip_empty_sections'] = 1
|
||||||
|
vim.g['airline#extensions#tabline#show_splits'] = 0
|
||||||
|
|
||||||
|
-- ALE
|
||||||
|
vim.g['ale_sign_column_always'] = 1
|
||||||
|
vim.g['ale_sign_error'] = '⚠'
|
||||||
|
vim.g['ale_sign_warning'] = '⚠'
|
||||||
|
vim.g['ale_echo_msg_format'] = '[%linter%] %s [%severity%]'
|
||||||
|
|
||||||
-- NerdTree
|
-- NerdTree
|
||||||
-- Close NERDTree if it is the last buffer open
|
-- Close NERDTree if it is the last buffer open
|
||||||
vim.cmd('au bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif')
|
vim.cmd('au bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif')
|
||||||
|
|
||||||
require('plugins.treesitter')
|
-- Grammalecte
|
||||||
require('plugins.lsp')
|
vim.g['grammalecte_cli_py'] = '/usr/bin/grammalecte-cli'
|
||||||
require('plugins.cmp')
|
|
||||||
require('plugins.gitsigns')
|
-- Deoplete
|
||||||
require('plugins.lualine')
|
vim.g['deoplete#enable_at_startup'] = 1
|
||||||
require('plugins.nvimlint')
|
|
||||||
|
-- Tree sitter
|
||||||
|
local ts = require 'nvim-treesitter.configs'
|
||||||
|
ts.setup {ensure_installed = 'maintained', highlight = {enable = true}}
|
||||||
|
|
|
@ -1,30 +1,28 @@
|
||||||
-- Plugins
|
--Plugins
|
||||||
require "paq" {
|
local paq = require("paq")
|
||||||
|
paq {
|
||||||
"savq/paq-nvim";
|
"savq/paq-nvim";
|
||||||
|
-- vim airline and vim airline theme
|
||||||
-- status bar
|
'vim-airline/vim-airline';
|
||||||
'nvim-lualine/lualine.nvim';
|
-- vim airline and vim airline theme
|
||||||
|
'vim-airline/vim-airline-themes';
|
||||||
|
'w0rp/ale';
|
||||||
-- Base16 theme
|
-- Base16 theme
|
||||||
'RRethy/nvim-base16';
|
'chriskempson/base16-vim';
|
||||||
|
|
||||||
-- NERDTree file manager
|
-- NERDTree file manager
|
||||||
'scrooloose/nerdtree';
|
'scrooloose/nerdtree';
|
||||||
'lewis6991/gitsigns.nvim';
|
|
||||||
|
|
||||||
|
-- Vim fugitive
|
||||||
|
'tpope/vim-fugitive';
|
||||||
|
'tpope/vim-surround';
|
||||||
|
'sheerun/vim-polyglot';
|
||||||
|
{'Shougo/deoplete.nvim', run = vim.fn['remote#host#UpdateRemotePlugins']};
|
||||||
|
'zchee/deoplete-jedi';
|
||||||
|
-- Grammalecte
|
||||||
|
'dpelle/vim-Grammalecte';
|
||||||
|
|
||||||
-- need to install g++ package on Debian
|
-- need to install g++ package on Debian
|
||||||
-- for tree sitter plugins
|
-- for tree sitter plugins
|
||||||
'nvim-treesitter/nvim-treesitter';
|
'nvim-treesitter/nvim-treesitter'
|
||||||
|
|
||||||
-- LSP installer
|
|
||||||
'neovim/nvim-lspconfig';
|
|
||||||
'williamboman/nvim-lsp-installer';
|
|
||||||
|
|
||||||
-- autocompletion plugin
|
|
||||||
'hrsh7th/nvim-cmp';
|
|
||||||
'hrsh7th/cmp-nvim-lsp';
|
|
||||||
|
|
||||||
-- vim lint when it is not possible withlsp
|
|
||||||
'mfussenegger/nvim-lint';
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
-- Add additional capabilities supported by nvim-cmp
|
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
||||||
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
|
|
||||||
|
|
||||||
-- nvim-cmp setup
|
|
||||||
local cmp = require 'cmp'
|
|
||||||
cmp.setup {
|
|
||||||
mapping = {
|
|
||||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
|
||||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
|
||||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
|
||||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
|
||||||
['<C-e>'] = cmp.mapping.close(),
|
|
||||||
['<CR>'] = cmp.mapping.confirm {
|
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
|
||||||
select = true,
|
|
||||||
},
|
|
||||||
['<Tab>'] = function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_next_item()
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
['<S-Tab>'] = function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_prev_item()
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
sources = {
|
|
||||||
{ name = 'nvim_lsp' },
|
|
||||||
},
|
|
||||||
}
|
|
|
@ -1,3 +0,0 @@
|
||||||
require('gitsigns').setup {
|
|
||||||
keymaps = {}, -- NO default keybindings
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
local lspconfig = require('lspconfig')
|
|
||||||
|
|
||||||
-- lsp installet
|
|
||||||
--
|
|
||||||
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)
|
|
|
@ -1,29 +0,0 @@
|
||||||
require('lualine').setup {
|
|
||||||
options = {
|
|
||||||
icons_enabled = true,
|
|
||||||
theme = 'base16',
|
|
||||||
component_separators = { left = '|', right = '|'},
|
|
||||||
section_separators = { left = '', right = ''},
|
|
||||||
disabled_filetypes = {},
|
|
||||||
always_divide_middle = true,
|
|
||||||
globalstatus = false,
|
|
||||||
},
|
|
||||||
sections = {
|
|
||||||
lualine_a = {'mode'},
|
|
||||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
|
||||||
lualine_c = {'filename'},
|
|
||||||
lualine_x = {'encoding', 'fileformat', '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 = {}
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
-- Tree sitter
|
|
||||||
local ts = require 'nvim-treesitter.configs'
|
|
||||||
|
|
||||||
ts.setup {
|
|
||||||
ensure_installed = 'all',
|
|
||||||
sync_install = false,
|
|
||||||
ignore_install = { 'erlang' },
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
additional_vim_regex_highlighting = false,
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -34,20 +34,10 @@ vim.cmd('colorscheme base16-classic-dark')
|
||||||
vim.cmd('au BufWinLeave *.* mkview')
|
vim.cmd('au BufWinLeave *.* mkview')
|
||||||
vim.cmd('au BufWinEnter *.* silent! loadview')
|
vim.cmd('au BufWinEnter *.* silent! loadview')
|
||||||
|
|
||||||
|
-- inoremap <silent><expr><tab> pumvisible()? "\<c-n>" : "\<tab>"
|
||||||
|
-- inoremap <silent><expr><s-tab> pumvisible()? "\<c-p>" : "\<s-tab>"
|
||||||
|
|
||||||
-- Diagnostic settings
|
|
||||||
--
|
|
||||||
-- diagnostic windows must be float
|
|
||||||
vim.diagnostic.config {
|
|
||||||
virtual_text = false,
|
|
||||||
signs = false,
|
|
||||||
underline = true,
|
|
||||||
}
|
|
||||||
|
|
||||||
-- You will likely want to reduce updatetime which affects CursorHold
|
|
||||||
-- note: this setting is global and should be set only once
|
|
||||||
vim.o.updatetime = 250
|
|
||||||
vim.cmd [[autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
|
|
||||||
|
|
||||||
-- Autotype
|
-- Autotype
|
||||||
vim.cmd('au BufRead,BufNewFile *.md setlocal textwidth=80')
|
vim.cmd('au BufRead,BufNewFile *.md setlocal textwidth=80')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue