Compare commits

...

27 Commits

Author SHA1 Message Date
iGor milhit 9654339b87
config: add a minimal config file for debug
Co-Authored-by: iGor milhit <igor@milhit.ch>
2024-04-27 15:22:39 +02:00
iGor milhit 59292d78f1
theme: set the adwaita colorscheme
- Sets the Adwaita colorscheme, also for lualine.
- Remove the marksman parser.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2024-04-27 15:20:59 +02:00
iGor milhit ece93842f9
html: unset the textwidth for html filetype
Co-Authored-by: iGor milhit <igor@milhit.ch>
2024-04-26 09:02:16 +02:00
iGor milhit e88e14a2d4
pandoc: disable treesitter for markdown
- Disables treesitter for markdown to avoid conflicts with vim-pandoc*
  plugins.
- Sets the folding level to 1 for pandoc filetypes.
- Moves to a nord light theme.
- Fixes the treesitter configuration.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2024-04-26 09:01:25 +02:00
iGor milhit 8993a005d9
json: add support of schemastore schemas
Co-Authored-by: iGor milhit <igor@milhit.ch>
2024-03-20 14:00:05 +01:00
iGor milhit d15338beb4
options: set shiftwidth and softtabstop
Co-Authored-by: iGor milhit <igor@milhit.ch>
2024-03-19 15:49:46 +01:00
iGor milhit 3930bda0c1
plugins: add venv-selector
- Adds `venv-selector` to ease the setting of the needed virtual
  environment for python.
- Adds pyright as a python LSP server.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2024-03-13 10:04:24 +01:00
iGor milhit 3e425d8349
plugins: improve LuaSnip configuration
Co-Authored-by: iGor milhit <igor@milhit.ch>
2024-02-27 12:32:53 +01:00
iGor milhit e99e156f1b
plugins: set neotree width
Co-Authored-by: iGor milhit <igor@milhit.ch>
2024-02-01 11:27:01 +01:00
iGor milhit f2c9a4bf71
mason: remove tectonic configuration for build
Co-Authored-by: iGor milhit <igor@milhit.ch>
2024-02-01 11:27:01 +01:00
iGor milhit 0a204cd462
snippets: add snippet for running session commits
Co-Authored-by: iGor milhit <igor@milhit.ch>
2024-02-01 11:27:01 +01:00
iGor milhit 52284e5a47
snippets: add frontmatter snippet for running post
Co-Authored-by: iGor milhit <igor@milhit.ch>
2024-02-01 11:27:01 +01:00
iGor milhit cda7ff36e3
markdown: enable autowriteall for markdown files
- Enables `autowriteall` for markdown files (pandoc filteype, as I use
  the vim-pandoc plugin).
- Modify the rules to ignore spell files.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2024-02-01 11:27:00 +01:00
iGor milhit 481b13b37b
plugins: improve config, remove unused plugins
- Updates the configuration according to the indent blankline plugin
  version 3.
- Removes the ZenMode plugin as I should have done long ago.
- Lazy loads the Rainbow CSV plugin.
- Adds a keymap (<leader>ch) for the command history picker of
  telescope.
- Removes the kickstart big comment on top of the init.lua file.
- Removes the config file that I don't remember the utility.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2024-02-01 11:27:00 +01:00
iGor milhit c3c4d0fb08
projet: ignore the spell directory
Co-Authored-by: iGor milhit <igor@milhit.ch>
2024-02-01 11:26:35 +01:00
iGor milhit f9b7aa0279
json: add configuration for JSON
- Adds the `json` parser to the treesitter languages for linting
  purpose.
- Adds `jsonls` as language server provider for JSON.
- Creates the `after/ftplugin` folders.
- Sets specific settings for JSON for folding method.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2023-10-17 11:27:02 +02:00
iGor milhit 7cb3422123
snippets: add HTML and commit snippets
- Creates a new file for custom HTML snippets.
- Creates three snippets to be used when updating the clinical medicine
  library portal with bibliographic descriptions:
  - A main HTML structure with CSS styling.
  - An item with some bibliographic description examples.
  - A list item with a link to an ebook online.
- Creates a snippet for commit message to save working hours.
- Creates snippet for incremental note commits.
- Creates snippet for AoU stats commits.
- Removes redundant markdown snippets for the date.
- Improves the markdown snippet for incremental note entry.
- Improves the LuaSnip configuration and moves it outside the nvim-cmp
  configuration.
- Increments the French personal dictionary.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2023-10-17 11:26:21 +02:00
iGor milhit f1d5af9e6f
telescope: add a plugin to use Ag
- Adds a plugin to use Ag The Silversearcher with Telescope.
- Improves some comments.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2023-08-23 15:10:23 +02:00
iGor milhit 5ce8f4285a
config: set changes preview
- Sets the `inccommand` option to `nosplit` to preview the changes
  before accepting them with the substitute command.
- Removes unused configuration.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2023-08-23 15:10:23 +02:00
iGor milhit 93a825e952
completion: add completion for text in the buffer
- Adds completion capabilities for text (in the current buffer), with
  the help of `cmp-buffer`).
- Set the keyword_length to 4 in order to lighten the buffer completion.
- Supports non ASCII chars in text completion (cmp-buffer).
- Restore the luasnip configuration inside the nvim-cmp configuration,
  as it is indeed closely related. I didn't understood it in the first
  place.
- Add a markdown snippet to add a tags line in my incremental notes
  (journal).
- Expand the French dictionnary.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2023-08-23 15:09:20 +02:00
iGor milhit 13e1faf10c
plugins: improve configuration, install plugins
- Fixes the markdown preview node package installation.
- Removes the markdown preview theme configuration.
- Adds the ToggleTerm plugin that allows to improve the managment of
  terminal buffers and configures it.
- Ensures to use the legacy tag for the fidget plugin, as it will be
  under active development and rewritting.
- Installs Grammalect, which is a French language checker. This plugin
  requires the python package `Grammalecte` that provide
  `grammalecte-cli` and `grammalecte-server`.
- Sets, in the mkdnflow configuration, the `perspective.priority` to
  `current` to get the follow link feature behaves as I need, relative
  to the current buffer.
- Fixes, in the mkdnflow configuration, the new file template to avoid a
  blank column at the begining (results in an invalid YAML syntax).

Co-Authored-by: iGor milhit <igor.milhit@unige.ch>
2023-08-23 14:56:58 +02:00
iGor milhit 7c52a10de3
snippets: load my own, add markdown snippets
- Renames the snippets folder to my_snippets.
- Lazy loads my snippets.
- Creates two snippet example available for all filetypes.
- Creates three snippets for markdown filetype.
- Creates a markdown snippet to get the number of the curret day.
- Creates a markdown snippet to get the current date.
- Creates a snippet to create a link in markdown reference syntax.
- Creates a generic frontmatter snippet.
- Creates a frontmatter snippet for my incremental notes (journal).
- Improves the description and description syntax of my markdown
  snippets.
- Adds the telescope luasnip plugin.
- Sets a keymaping to fuzzy search all available snippets (<leader>ss).
- Documents the feature of the plugin that provides the snippets search
  through telescope.
- Enables the search highlighting.
- Removes unnecessary lualine separator.
- Renames the neo-tree plugin file.
- Lazy loads the zen-mode for markdown files.
- Installs and configure texlab which provides LSP and linter for LaTeX.
  Should also allow to build a project, but It is failling right now, I
  don't get why.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2023-08-23 08:31:22 +02:00
iGor milhit e33c6e1b80
global: improve the configuration
- Adds the rainbow_csv plugin to improve CSV file support.
- Sets mutliple filetypes for markdown plugins (`pandoc`, `markdown`).
  - `mkdnflow`.
  - `markdownpreview`.
  - `marksman` language server (but it doesn't work for pandoc
    filetype).
- Sets folding level to 1 to fold from the level 2 headings.
- Adds completion capabilities for paths.
- Adds to the pandoc filetype the markdown snippets.
- Adds a markdown template for new files created inside mkdnflow.
- Adds all useful filetypes for mkdnflow.
- Adds a keymap to fuzzy search open buffers (<leader>sb).
- Updates the English dictionnaries.
- Installs the German dictionnaires.
- Fixes the concatenation of strings for the pyenv path.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2023-08-22 16:12:12 +02:00
iGor milhit 02ca7d1d2b
plugins: remove and install some
- Removes vim-rhubarb (github related).
- Sets autopairs and vim-surround.
- Adds and configures true-zen and twilight

Co-Authored-by: iGor milhit <igor@milhit.ch>
2023-08-22 14:44:52 +02:00
iGor milhit 25c736d4f7
markdown: configure the markdown environment
- Adds the `markdown-preview.nvim` plugin.
- Adds the two `vim-pandoc` and `vim-pandoc-syntax` for the support of
  markdown syntax and for file conversions with pandoc.
- Sets basic options (max width of 79 chars).
- Restores the `.gitignore` rules of the kickstart.nvim project.
- Adds and configures the Nordic colorscheme plugin.
- Sets the English, French and German spelling.
- Adds the `mkdnflow` plugin to get notebook features.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2023-08-22 11:44:57 +02:00
iGor milhit 9cae3c7b03
global: rewrite neovim config based on kickstart
- Copies all kickstart files here.
- Rename my config to init.vim.save.
- Add the markdown preview plugin.
- Add the neo-tree plugin, as explained in the REAME.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2023-05-29 12:23:55 +02:00
iGor milhit cd4462d745
colorscheme: return to nord colorscheme
Co-Authored-by: iGor milhit <igor@milhit.ch>
2023-05-29 09:47:49 +02:00
31 changed files with 1778 additions and 74 deletions

11
.gitignore vendored
View File

@ -5,5 +5,12 @@ autoload
# netrw
.netrwhist
# spell *.spl
spell/fr.utf-8.add.spl
# spell
*.spl
spell/*
tags
test.sh
.luarc.json
nvim
lazy-lock.json

20
.gitignore.orig 100644
View File

@ -0,0 +1,20 @@
# `vim-plug` plugins
plugged/*
autoload
# netrw
.netrwhist
<<<<<<< HEAD
# spell *.spl
=======
# spell
*.spl
>>>>>>> c47fcd7 (gitignore: try to improve the spell rule)
spell/*
tags
test.sh
.luarc.json
nvim
lazy-lock.json

19
LICENSE.md 100644
View File

@ -0,0 +1,19 @@
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

195
README.md
View File

@ -1,89 +1,146 @@
# My `neovim` setup
# kickstart.nvim
I'm trying to document my neovim setup. Mostly, I'm using neovim to edit
markdown, HTML, CSS/SCSS and python files.
### Introduction
I'm using `vim-plug` as a plugin manager. To install and activate `vim-plug`
see the [documentation][7].
A starting point for Neovim that is:
## To do
* Small
* Single-file (with examples of moving to multi-file)
* Documented
* Modular
- [x] Document how to use `pyenv` to provide a python engine.
- [x] Identify the python package dependencies.
This repo is meant to be used as by **YOU** to begin your Neovim journey; remove the things you don't use and add what you miss.
## Requirements
Kickstart.nvim targets *only* the latest ['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest ['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim. If you are experiencing issues, please make sure you have the latest versions.
1. `neovim`
1. `git`
1. A python virtualenv with python dependencies installed. (see [pyenv
section][10]).
1. `nodejs`, `yarn`
1. [vim-plug][1]
1. [ripgrep][2]
1. [The Silver Searcher (`ag`)][3]
1. A [font patched for nerds][8].
Distribution Alternatives:
- [LazyVim](https://www.lazyvim.org/): A delightful distribution maintained by @folke (the author of lazy.nvim, the package manager used here)
## Installation
### Installation
1. Check [the requirements][4]. ⬆
1. Clone the repository \
`git clone <URL>`
1. Create a symlink: \
`ln /path/neovim/init.vim /home/user/.config/nvim/init.vim`.
1. [Install `vim-plug`][7].
1. Start `neovim`.
1. Install the plugins (`:PlugInstall`).
* Backup your previous configuration (if any exists)
## Create a virtualenv with pyenv
### Archive Installation
* On the home/landing page for the project find the blue "<> CODE" button click it and select Local > Download ZIP.
* Extract the archive to:
`~/.config/nvim` (Linux)
`~/.config/nvim` (MacOS)
`%userprofile%\AppData\Local\nvim-data\` (Windows)
* Ensure your extraction method did not extract with a parent folder. For example in ~/.config/nvim you should have init.lua not another folder called kickstart.nvim.
Benefit: having a separate virtual environment for the python engine than the
one your working into.
### Git Clone Installation
* From a terminal cd/dir to:
`~/.config/nvim` (Linux)
`~/.config/nvim` (MacOS)
`%userprofile%\AppData\Local\nvim\` (Windows)
Install `pyenv` with the [`pyenv-installer`][9].
* run: `git clone https://github.com/nvim-lua/kickstart.nvim.git ~/.config/nvim` OR: `gh repo clone nvim-lua/kickstart.nvim`
* Run Neovim (from terminal or shortcut) and allow lazy.nvim to download files and set up the basics.
* Once the setup is complete, restart Neovim.
* **You're ready to go!**
Install the python version you need with `pyenv`:
* (Recommended/Optional) Fork this repo (so that you have your own copy that you can modify).
* Clone the kickstart repo into `$HOME/.config/nvim/` (Linux/Mac) or `%userprofile%\AppData\Local\nvim-data\` (Windows)
* If you don't want to include it as a git repo, you can just clone it and then move the files to this location
```bash
pyenv install <python version>
Additional system requirements:
- Make sure to review the readmes of the plugins if you are experiencing errors. In particular:
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation) is required for multiple [telescope](https://github.com/nvim-telescope/telescope.nvim#suggested-dependencies) pickers.
- See [Windows Installation](#Windows-Installation) if you have trouble with `telescope-fzf-native`
### Configuration And Extension
* Inside of your copy, feel free to modify any file you like! It's your copy!
* Feel free to change any of the default options in `init.lua` to better suit your needs.
* For adding plugins, there are 3 primary options:
* Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim`
* Modify `init.lua` with additional plugins.
* Include the `lua/kickstart/plugins/*` files in your configuration.
You can also merge updates/changes from the repo back into your fork, to keep up-to-date with any changes for the default configuration.
#### Example: Adding an autopairs plugin
In the file: `lua/custom/plugins/autopairs.lua`, add:
```lua
-- File: lua/custom/plugins/autopairs.lua
return {
"windwp/nvim-autopairs",
-- Optional dependency
dependencies = { 'hrsh7th/nvim-cmp' },
config = function()
require("nvim-autopairs").setup {}
-- If you want to automatically add `(` after selecting a function or method
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local cmp = require('cmp')
cmp.event:on(
'confirm_done',
cmp_autopairs.on_confirm_done()
)
end,
}
```
Create and name the virtual environment for neovim:
```bash
pyenv virtualenv <python version> neovim
This will automatically install [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs) and enable it on startup. For more information, see documentation for [lazy.nvim](https://github.com/folke/lazy.nvim).
#### Example: Adding a file tree plugin
In the file: `lua/custom/plugins/filetree.lua`, add:
```lua
-- Unless you are still migrating, remove the deprecated commands from v1.x
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
return {
"nvim-neo-tree/neo-tree.nvim",
version = "*",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
},
config = function ()
require('neo-tree').setup {}
end,
}
```
Activate the virtual environment and fetch the python path:
This will install the tree plugin and add the command `:Neotree` for you. You can explore the documentation at [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) for more information.
```bash
pyenv activate neovim
pyenv which python # Note the provided path
### Contribution
Pull-requests are welcome. The goal of this repo is not to create a Neovim configuration framework, but to offer a starting template that shows, by example, available features in Neovim. Some things that will not be included:
* Custom language server configuration (null-ls templates)
* Theming beyond a default colorscheme necessary for LSP highlight groups
Each PR, especially those which increase the line count, should have a description as to why the PR is necessary.
### FAQ
* What should I do if I already have a pre-existing neovim configuration?
* You should back it up, then delete all files associated with it.
* This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/`
* You may also want to look at the [migration guide for lazy.nvim](https://github.com/folke/lazy.nvim#-migration-guide)
* What if I want to "uninstall" this configuration:
* See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information
* Are there any cool videos about this plugin?
* Current iteration of kickstart (coming soon)
* Here is one about the previous iteration of kickstart: [video introduction to Kickstart.nvim](https://youtu.be/stqUbv-5u2s). Note the install via init.lua no longer works as specified. Please follow the install instructions in this file instead as they're up to date.
### Windows Installation
Installation may require installing build tools, and updating the run command for `telescope-fzf-native`
See `telescope-fzf-native` documentation for [more details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation)
This requires:
- Install CMake, and the Microsoft C++ Build Tools on Windows
```lua
{'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' }
```
Add the following line to your `init.vim`:
```init.vim
let g:python3_host_prog = '/full/path/to/neovim/bin/python
```
Install the python dependencies in the virtual environment as it is activated:
```bash
pip install -r requirements.txt
```
To deactivate the virtual environment:
```bash
pyenv deactivate
```
[1]: https://github.com/junegunn/vim-plug
[2]: https://github.com/BurntSushi/ripgrep
[3]: https://github.com/ggreer/the_silver_searcher
[4]: /requirements
[5]: https://www.nordtheme.com/ports/vim
[7]: https://github.com/junegunn/vim-plug#installation
[8]: https://www.github.com/ryanoasis/nerd-fonts
[9]: https://github.com/pyenv/pyenv-installer
[10]: #create-a-virtualenv-with-pyenv

View File

@ -0,0 +1,4 @@
-- Specific settings for HTML files
-- No limit to text_width
vim.o.textwidth = 0

View File

@ -0,0 +1,8 @@
-- Specific settings for JSON files
-- Use treesitter for folding
-- Disable the color column
vim.opt.foldmethod="expr"
vim.opt.foldexpr="nvim_treesitter#foldexpr()"
vim.opt.foldlevel=3
vim.opt.colorcolumn=""

View File

@ -0,0 +1,6 @@
-- Specific settings for markdown files (pandoc filetype)
-- Enable the autowrite feature for all commands
-- See :h awa
vim.opt.awa=true
vim.opt.foldlevel = 1

24
doc/kickstart.txt 100644
View File

@ -0,0 +1,24 @@
================================================================================
INTRODUCTION *kickstart.nvim*
Kickstart.nvim is a project to help you get started on your neovim journey.
*kickstart-is-not*
It is not:
- Complete framework for every plugin under the sun
- Place to add every plugin that could ever be useful
*kickstart-is*
It is:
- Somewhere that has a good start for the most common "IDE" type features:
- autocompletion
- goto-definition
- find references
- fuzzy finding
- and hinting at what more can be done :)
- A place to _kickstart_ your journey.
- You should fork this project and use/modify it so that it matches your
style and preferences. If you don't want to do that, there are probably
other projects that would fit much better for you (and that's great!)!
vim:tw=78:ts=8:ft=help:norl:

3
doc/tags 100644
View File

@ -0,0 +1,3 @@
kickstart-is kickstart.txt /*kickstart-is*
kickstart-is-not kickstart.txt /*kickstart-is-not*
kickstart.nvim kickstart.txt /*kickstart.nvim*

615
init.lua 100644
View File

@ -0,0 +1,615 @@
-- Set <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- Install package manager
-- https://github.com/folke/lazy.nvim
-- `:help lazy.nvim.txt` for more info
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system {
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
lazypath,
}
end
vim.opt.rtp:prepend(lazypath)
-- NOTE: Here is where you install your plugins.
-- You can configure plugins using the `config` key.
--
-- You can also configure plugins after the setup call,
-- as they will be available in your neovim runtime.
require('lazy').setup({
-- NOTE: First, some plugins that don't require any configuration
-- Git related plugins
'tpope/vim-fugitive',
-- Detect tabstop and shiftwidth automatically
'tpope/vim-sleuth',
-- Improve surroundings management
'tpope/vim-surround',
-- NOTE: This is where your plugins related to LSP can be installed.
-- The configuration is done below. Search for lspconfig to find it below.
{
-- LSP Configuration & Plugins
'neovim/nvim-lspconfig',
dependencies = {
-- Automatically install LSPs to stdpath for neovim
{ 'williamboman/mason.nvim', config = true },
'williamboman/mason-lspconfig.nvim',
-- Useful status updates for LSP
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
{ 'j-hui/fidget.nvim', tag = "legacy", opts = {} },
-- Additional lua configuration, makes nvim stuff amazing!
'folke/neodev.nvim',
},
},
{
-- Autocompletion
-- See Configure nvim-cmp at the end of this file
'hrsh7th/nvim-cmp',
dependencies = {
-- Snippet Engine & its associated nvim-cmp source
{
'L3MON4D3/LuaSnip',
-- follow latest release
version = "v2.*",
-- install jsregexp (optional)
build = "make install_jsregexp"
},
'saadparwaiz1/cmp_luasnip',
-- Adds LSP completion capabilities
'hrsh7th/cmp-nvim-lsp',
-- Adds completion capabilities for text in buffers
'hrsh7th/cmp-buffer',
-- Adds path completion capabilities
'hrsh7th/cmp-path',
-- Adds a number of user-friendly snippets
'rafamadriz/friendly-snippets',
},
},
-- Useful plugin to show you pending keybinds.
{ 'folke/which-key.nvim', opts = {} },
{
-- Adds git releated signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim',
opts = {
-- See `:help gitsigns.txt`
signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
},
on_attach = function(bufnr)
vim.keymap.set('n', '[c', require('gitsigns').prev_hunk, { buffer = bufnr, desc = 'Go to Previous Hunk' })
vim.keymap.set('n', ']c', require('gitsigns').next_hunk, { buffer = bufnr, desc = 'Go to Next Hunk' })
vim.keymap.set('n', '<leader>ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' })
end,
},
},
-- Adwaita colorscheme
{
"Mofiqul/adwaita.nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd('colorscheme adwaita')
end
},
{
-- Set lualine as statusline
'nvim-lualine/lualine.nvim',
-- See `:help lualine.txt`
opts = {
options = {
icons_enabled = true,
theme = 'adwaita',
component_separators = '|',
section_separators = '',
},
},
},
{
-- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim',
-- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help indent_blankline.txt`
main = "ibl",
opts = {
indent = {char = ''},
whitespace = {remove_blankline_trail = false},
},
},
-- "gc" to comment visual regions/lines
{ 'numToStr/Comment.nvim', opts = {} },
-- Fuzzy Finder (files, lsp, etc)
{ 'nvim-telescope/telescope.nvim', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim' } },
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
-- Only load if `make` is available. Make sure you have the system
-- requirements installed.
{
'nvim-telescope/telescope-fzf-native.nvim',
-- NOTE: If you are having trouble with this installation,
-- refer to the README for telescope-fzf-native for more instructions.
build = 'make',
cond = function()
return vim.fn.executable 'make' == 1
end,
},
-- Extension to telescope to use Ag (or ripgrep) to filter results
{
'kelly-lin/telescope-ag'
},
-- Allow to search for snippets
{
'benfowler/telescope-luasnip.nvim'
},
{
-- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects',
},
build = ':TSUpdate',
},
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
-- These are some example plugins that I've included in the kickstart repository.
-- Uncomment any of the lines below to enable them.
-- require 'kickstart.plugins.autoformat',
-- require 'kickstart.plugins.debug',
-- NOTE: The import below automatically adds your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping
-- up-to-date with whatever is in the kickstart repo.
--
-- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
{ import = 'custom.plugins' },
}, {})
-- Restore the site folder of .local/share/nvim/ in the runtime rewritten by
-- lazy. See https://github.com/neovim/neovim/issues/23082#issuecomment-1510812311
vim.opt.rtp:append (vim.fn.stdpath ('data') .. '/site')
-- [[ Setting options ]]
-- See `:help vim.o`
-- NOTE: You can change these options as you wish!
-- Set highlight on search
vim.o.hlsearch = true
-- Preview changes when searching and substituing
-- nosplit avoid to display the preview in a separate split
vim.o.inccommand = "nosplit"
-- Make line numbers default
vim.wo.number = true
-- Set the maximum width of a line
vim.opt.textwidth = 79
-- Display the cusor column at 79+1 column
vim.opt.colorcolumn:append('+1')
-- Enable mouse mode
vim.o.mouse = 'a'
-- Sync clipboard between OS and Neovim.
-- Remove this option if you want your OS clipboard to remain independent.
-- See `:help 'clipboard'`
vim.o.clipboard = 'unnamedplus'
-- Indent
vim.o.shiftwidth = 4
vim.o.softtabstop = 4
-- Enable break indent
vim.o.breakindent = true
-- Save undo history
vim.o.undofile = true
-- Case insensitive searching UNLESS /C or capital in search
vim.o.ignorecase = true
vim.o.smartcase = true
-- Keep signcolumn on by default
vim.wo.signcolumn = 'yes'
-- Decrease update time
vim.o.updatetime = 250
vim.o.timeout = true
vim.o.timeoutlen = 300
-- Set completeopt to have a better completion experience
vim.o.completeopt = 'menuone,noselect'
-- NOTE: You should make sure your terminal supports this
vim.o.termguicolors = true
-- Set the spelling for English, French and German.
vim.opt.spelllang = 'en,fr,de'
-- Set the folding level to 1, to allow level 2 headers to be seen.
vim.opt.foldlevel = 1
-- Set a python virtualenv as python3 provider.
-- `vim.env.HOME` uses the neovim API to fetch the $HOME env.
-- The `..` appends strings in lua.
vim.g.python3_host_prog = vim.env.HOME .. '/.pyenv/versions/neovim3/bin/python'
-- [[ Basic Keymaps ]]
-- Keymaps for better default experience
-- See `:help vim.keymap.set()`
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
-- Remap for dealing with word wrap
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
-- [[ Highlight on yank ]]
-- See `:help vim.highlight.on_yank()`
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
vim.api.nvim_create_autocmd('TextYankPost', {
callback = function()
vim.highlight.on_yank()
end,
group = highlight_group,
pattern = '*',
})
-- [[ Configure Telescope ]]
-- See `:help telescope` and `:help telescope.setup()`
require('telescope').setup {
defaults = {
mappings = {
i = {
['<C-u>'] = false,
['<C-d>'] = false,
},
},
},
pickers = {
command_history = {
theme = "dropdown",
}
}
}
-- Enable telescope fzf native, if installed
pcall(require('telescope').load_extension, 'fzf')
-- Enable telescope luasnip extension, if installed
pcall(require('telescope').load_extension, 'luasnip')
-- Enable telescope-ag extension, if installed
pcall(require('telescope').load_extension, 'ag')
-- See `:help telescope.builtin`
vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' })
vim.keymap.set('n', '<leader><space>', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' })
vim.keymap.set('n', '<leader>/', function()
-- You can pass additional configuration to telescope to change theme, layout, etc.
require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
winblend = 10,
previewer = false,
})
end, { desc = '[/] Fuzzily search in current buffer' })
vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' })
vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' })
vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' })
vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' })
vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' })
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
vim.keymap.set('n', '<leader>sb', require('telescope.builtin').buffers, { desc = '[S]earch [B]uffers' })
vim.keymap.set('n', '<leader>ch', require('telescope.builtin').command_history, { desc = '[C]command [H]istory' })
vim.keymap.set('n', '<leader>ss', require'telescope'.extensions.luasnip.luasnip , { desc = '[S]earch [S]nippets' })
-- [[ Configure Treesitter ]]
-- See `:help nvim-treesitter`
require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim', 'json' },
-- Do not install parses synchronously
sync_install = false,
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = false,
-- List of parsers to ignore installing
ignore_install = { "markdown" },
-- Required property, but empr?
modules = {},
highlight = {
enable = true,
disable = { "markdown" },
},
indent = { enable = true, disable = { 'python' } },
incremental_selection = {
enable = true,
keymaps = {
init_selection = '<c-space>',
node_incremental = '<c-space>',
scope_incremental = '<c-s>',
node_decremental = '<M-space>',
},
},
textobjects = {
select = {
enable = true,
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
keymaps = {
-- You can use the capture groups defined in textobjects.scm
['aa'] = '@parameter.outer',
['ia'] = '@parameter.inner',
['af'] = '@function.outer',
['if'] = '@function.inner',
['ac'] = '@class.outer',
['ic'] = '@class.inner',
},
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
[']m'] = '@function.outer',
[']]'] = '@class.outer',
},
goto_next_end = {
[']M'] = '@function.outer',
[']['] = '@class.outer',
},
goto_previous_start = {
['[m'] = '@function.outer',
['[['] = '@class.outer',
},
goto_previous_end = {
['[M'] = '@function.outer',
['[]'] = '@class.outer',
},
},
swap = {
enable = true,
swap_next = {
['<leader>a'] = '@parameter.inner',
},
swap_previous = {
['<leader>A'] = '@parameter.inner',
},
},
},
}
-- Diagnostic keymaps
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
-- [[ Configure LSP ]]
-- This function gets run when an LSP connects to a particular buffer.
local on_attach = function(_, bufnr)
-- NOTE: Remember that lua is a real programming language, and as such it is possible
-- to define small helper and utility functions so you don't have to repeat yourself
-- many times.
--
-- In this case, we create a function that lets us more easily define mappings specific
-- for LSP related items. It sets the mode, buffer and description for us each time.
local nmap = function(keys, func, desc)
if desc then
desc = 'LSP: ' .. desc
end
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
end
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation')
nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition')
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
-- See `:help K` for why this keymap
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
-- Lesser used LSP functionality
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
nmap('<leader>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, '[W]orkspace [L]ist Folders')
-- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
vim.lsp.buf.format()
end, { desc = 'Format current buffer with LSP' })
end
-- Enable the following language servers
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
--
-- Add any additional override configuration in the following tables. They will be passed to
-- the `settings` field of the server config. You must look up that documentation yourself.
local servers = {
-- clangd = {},
-- gopls = {},
pyright = {},
-- rust_analyzer = {},
-- tsserver = {},
-- marksman = {
-- ft = {
-- 'markdown',
-- 'pandoc'
-- }
-- },
lua_ls = {
Lua = {
workspace = { checkThirdParty = false },
telemetry = { enable = false },
},
},
texlab = {
-- build = {
-- executable = "tectonic",
-- args = {
-- "-X",
-- "compile",
-- "%f",
-- "--synctex",
-- "--keep-logs",
-- "--keep-intermediates"
-- }
-- }
},
-- Require vscode-langservers-extracted
-- https://github.com/hrsh7th/vscode-langservers-extracted
-- Configure schemastore to be used
jsonls = {
settings = {
json = {
schemas = require('schemastore').json.schemas(),
validate = { enable = true },
},
},
},
}
-- Setup neovim lua configuration
require('neodev').setup()
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
-- Ensure the servers above are installed
local mason_lspconfig = require 'mason-lspconfig'
mason_lspconfig.setup {
ensure_installed = vim.tbl_keys(servers),
}
mason_lspconfig.setup_handlers {
function(server_name)
require('lspconfig')[server_name].setup {
capabilities = capabilities,
on_attach = on_attach,
settings = servers[server_name],
}
end,
}
-- [[ Configure nvim-cmp, and LuaSnip ]]
-- See `:help cmp`
local cmp = require 'cmp'
local luasnip = require 'luasnip'
require('luasnip.loaders.from_vscode').lazy_load()
luasnip.config.setup {
-- Extend markdown snippets to pandoc filetype
-- https://github.com/L3MON4D3/LuaSnip/issues/132#issuecomment-1101710309
snippets = {
markdown = {},
},
luasnip.filetype_extend("pandoc", {"markdown"}),
}
-- Load snippets from ~/.config/nvim/LuaSnip/
require("luasnip.loaders.from_lua").load({paths = "~/.config/nvim/my_snippets/"})
-- Keymap to reload snippets
-- https://www.ejmastnak.com/tutorials/vim-latex/luasnip/#refreshing-snippets-from-a-separate-vim-instance
vim.keymap.set('n', '<Leader>L', '<Cmd>lua require("luasnip.loaders.from_lua").load({paths = "~/.config/nvim/my_snippets/"})<CR>', { desc = 'Reload [L]uaSnippets' })
-- [[ Configure nvim-cmp ]]
-- See `:help cmp`
local cmp = require 'cmp'
cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert {
['<C-n>'] = cmp.mapping.select_next_item(),
['<C-p>'] = cmp.mapping.select_prev_item(),
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete {},
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' }),
},
sources = {
{ name = 'nvim_lsp' },
{
name = 'buffer',
option = {
keyword_length = 4,
keyword_pattern = [[\k\+]],
},
},
{ name = 'luasnip' },
{ name = 'path' },
},
}
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et

View File

@ -253,9 +253,9 @@ autocmd! User GoyoLeave Limelight!
" #########################################
" Syntax coloration and color theme
syntax enable
set background=light
let g:edge_style = "light"
colorscheme edge
set background=dark
" let g:edge_style = "light"
colorscheme nord
" #########################################
" #########################################

View File

@ -0,0 +1,17 @@
-- File: lua/custom/plugins/autopairs.lua
return {
"windwp/nvim-autopairs",
-- Optional dependency
dependencies = { 'hrsh7th/nvim-cmp' },
config = function()
require("nvim-autopairs").setup {}
-- If you want to automatically add `(` after selecting a function or method
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local cmp = require('cmp')
cmp.event:on(
'confirm_done',
cmp_autopairs.on_confirm_done()
)
end,
}

View File

@ -0,0 +1,14 @@
-- Plugin to get Grammalecte checks in (neo)vim.
-- Set the path to the grammalecte-cli executable
vim.cmd([[ let g:grammalecte_cli_py = "/usr/bin/grammalecte-cli" ]])
return {
"dpelle/vim-Grammalecte",
ft = {
"pandoc",
"markdown",
"text",
"gitcommit"
}
}

View File

@ -0,0 +1,5 @@
-- You can add your own plugins here or in other files in this directory!
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {}

View File

@ -0,0 +1,14 @@
-- makdown-preview.nvim
-- installed with code found at https://github.com/iamcco/markdown-preview.nvim/issues/558#issuecomment-1514701537
return {
{
"iamcco/markdown-preview.nvim",
ft = {
'pandoc',
'markdown'
},
lazy = true,
build = "cd app && npm install && git reset --hard",
},
}

View File

@ -0,0 +1,56 @@
-- Mkdownflow plugin.
-- Allows to follow links, anchors, create links, and many more.
-- https://github.com/jakewvincent/mkdnflow.nvim
-- Keymaps for mkdnflow.
-- Table
vim.keymap.set({'n','x','v'}, '<leader>tf', '<cmd>MkdnTableFormat<CR>', {desc = 'Format table under cursor'})
return {
{
"jakewvincent/mkdnflow.nvim",
ft = {
'pandoc',
'markdown'
},
lazy = true,
config = function ()
require('mkdnflow').setup({
filetypes = {
md = true,
rmd = true,
markdown = true,
pandoc = true
},
perspective = {
-- Ensure that paths are relative to the current file
priority = "current"
},
links = {
conceal = true,
},
new_file_template = {
use_template = true,
template = [[
---
title:
date: {{ date }}
id: {{ id }}
tags: []
---
]],
placeholders = {
before = {
date = function ()
return os.date("%Y-%m-%dT%H:%M:%S%z")
end,
id = function ()
return os.date("%Y%m%d%H%M%S")
end
},
}
}
})
end
}
}

View File

@ -0,0 +1,22 @@
-- Plugin for file tree: neo-tree
-- Using the kickstart and the neo-tree documentations
-- Unless you are still migrating, remove the deprecated commands from v1.x
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
return {
"nvim-neo-tree/neo-tree.nvim",
version = "*",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
},
config = function ()
require('neo-tree').setup {
window = {
width = 36
}
}
end,
}

View File

@ -0,0 +1,26 @@
-- Pandoc plugins: vim-pandoc, vim-pandoc-syntax
-- Defines the filetypes that have to be recognize by vim-pandoc. Allows
-- mardown-preview to be available with pandoc filetype.
vim.cmd([[ let g:mkdp_filetypes = ['markdown', 'pandoc', 'pandoc.markdown'] ]])
-- Sets the pandoc formatting mode to hardwrap
vim.cmd([[ let g:pandoc#formatting#mode="hA" ]])
-- Keymaps to switch to soft or hardwarp, or to toggle.
vim.keymap.set('n', '<leader>sw', '<cmd>call pandoc#formatting#UseSoftWraps()<CR>', {desc = 'Switch to softwrap'})
vim.keymap.set('n', '<leader>hw', '<cmd>call pandoc#formatting#UseHardWraps()<CR>', {desc = 'Switch to hardwrap'})
vim.keymap.set('n', '<leader>tw', '<cmd>call pandoc#formatting#ToggleAutoformat()<CR>', {desc = 'Toggle autoformat, to deactivate it'})
return {
{
"vim-pandoc/vim-pandoc",
ft = "pandoc",
lazy = true,
},
{
"vim-pandoc/vim-pandoc-syntax",
ft = "pandoc",
lazy = true,
},
}

View File

@ -0,0 +1,22 @@
-- In order to manage CSV files
return {
'cameron-wags/rainbow_csv.nvim',
lazy = true,
config = true,
ft = {
'csv',
'tsv',
'csv_semicolon',
'csv_whitespace',
'csv_pipe',
'rfc_csv',
'rfc_semicolon'
},
cmd = {
'RainbowDelim',
'RainbowDelimSimple',
'RainbowDelimQuoted',
'RainbowMultiDelim'
}
}

View File

@ -0,0 +1,6 @@
-- Plugin for schemastore
-- https://github.com/b0o/SchemaStore.nvim
return {
"b0o/schemastore.nvim",
}

View File

@ -0,0 +1,16 @@
-- A neovim lua plugin to help easily manage multiple terminal windows
-- https://github.com/akinsho/toggleterm.nvim
-- Set ZSH as shell to get it in a terminal buffer
vim.opt.shell = "/usr/bin/zsh"
return {
{
'akinsho/toggleterm.nvim',
version = "*",
opts = {
-- Avoid terminal to be darker than the Nord colorscheme
shade_terminals = false
}
}
}

View File

@ -0,0 +1,35 @@
local api = vim.api
api.nvim_set_keymap("n", "<leader>zn", ":TZNarrow<CR>", {})
api.nvim_set_keymap("v", "<leader>zn", ":'<,'>TZNarrow<CR>", {})
api.nvim_set_keymap("n", "<leader>zf", ":TZFocus<CR>", {})
api.nvim_set_keymap("n", "<leader>zm", ":TZMinimalist<CR>", {})
api.nvim_set_keymap("n", "<leader>za", ":TZAtaraxis<CR>", {})
return {
"Pocco81/true-zen.nvim",
-- Twilight allows to dim text outside of the cursor line.
dependencies = {
"folke/twilight.nvim",
opts = {
-- Set the context to null in order to avoid highlighting to much
-- paragraphs in markdown.
context = 0,
},
},
config = function ()
require('true-zen').setup({
modes = {
ataraxis = {
minimum_writing_area = {
width = 100
}
}
},
integrations = {
twilight = true,
lualine = true
}
})
end
}

View File

@ -0,0 +1,16 @@
return {
'linux-cultist/venv-selector.nvim',
dependencies = { 'neovim/nvim-lspconfig', 'nvim-telescope/telescope.nvim', 'mfussenegger/nvim-dap-python' },
opts = {
-- Your options go here
-- name = "venv",
-- auto_refresh = false
},
event = 'VeryLazy', -- Optional: needed only if you want to type `:VenvSelect` without a keymapping
keys = {
-- Keymap to open VenvSelector to pick a venv.
{ '<leader>vs', '<cmd>VenvSelect<cr>' },
-- Keymap to retrieve the venv from a cache (the one previously used for the same project directory).
{ '<leader>vc', '<cmd>VenvSelectCached<cr>' },
},
}

View File

@ -0,0 +1,74 @@
-- autoformat.lua
--
-- Use your language server to automatically format your code on save.
-- Adds additional commands as well to manage the behavior
return {
'neovim/nvim-lspconfig',
config = function()
-- Switch for controlling whether you want autoformatting.
-- Use :KickstartFormatToggle to toggle autoformatting on or off
local format_is_enabled = true
vim.api.nvim_create_user_command('KickstartFormatToggle', function()
format_is_enabled = not format_is_enabled
print('Setting autoformatting to: ' .. tostring(format_is_enabled))
end, {})
-- Create an augroup that is used for managing our formatting autocmds.
-- We need one augroup per client to make sure that multiple clients
-- can attach to the same buffer without interfering with each other.
local _augroups = {}
local get_augroup = function(client)
if not _augroups[client.id] then
local group_name = 'kickstart-lsp-format-' .. client.name
local id = vim.api.nvim_create_augroup(group_name, { clear = true })
_augroups[client.id] = id
end
return _augroups[client.id]
end
-- Whenever an LSP attaches to a buffer, we will run this function.
--
-- See `:help LspAttach` for more information about this autocmd event.
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('kickstart-lsp-attach-format', { clear = true }),
-- This is where we attach the autoformatting for reasonable clients
callback = function(args)
local client_id = args.data.client_id
local client = vim.lsp.get_client_by_id(client_id)
local bufnr = args.buf
-- Only attach to clients that support document formatting
if not client.server_capabilities.documentFormattingProvider then
return
end
-- Tsserver usually works poorly. Sorry you work with bad languages
-- You can remove this line if you know what you're doing :)
if client.name == 'tsserver' then
return
end
-- Create an autocmd that will run *before* we save the buffer.
-- Run the formatting command for the LSP that has just attached.
vim.api.nvim_create_autocmd('BufWritePre', {
group = get_augroup(client),
buffer = bufnr,
callback = function()
if not format_is_enabled then
return
end
vim.lsp.buf.format {
async = false,
filter = function(c)
return c.id == client.id
end,
}
end,
})
end,
})
end,
}

View File

@ -0,0 +1,86 @@
-- debug.lua
--
-- Shows how to use the DAP plugin to debug your code.
--
-- Primarily focused on configuring the debugger for Go, but can
-- be extended to other languages as well. That's why it's called
-- kickstart.nvim and not kitchen-sink.nvim ;)
return {
-- NOTE: Yes, you can install new plugins here!
'mfussenegger/nvim-dap',
-- NOTE: And you can specify dependencies as well
dependencies = {
-- Creates a beautiful debugger UI
'rcarriga/nvim-dap-ui',
-- Installs the debug adapters for you
'williamboman/mason.nvim',
'jay-babu/mason-nvim-dap.nvim',
-- Add your own debuggers here
'leoluz/nvim-dap-go',
},
config = function()
local dap = require 'dap'
local dapui = require 'dapui'
require('mason-nvim-dap').setup {
-- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations
automatic_setup = true,
-- You can provide additional configuration to the handlers,
-- see mason-nvim-dap README for more information
handlers = {},
-- You'll need to check that you have the required things installed
-- online, please don't ask me how to install them :)
ensure_installed = {
-- Update this to ensure that you have the debuggers for the langs you want
'delve',
},
}
-- Basic debugging keymaps, feel free to change to your liking!
vim.keymap.set('n', '<F5>', dap.continue)
vim.keymap.set('n', '<F1>', dap.step_into)
vim.keymap.set('n', '<F2>', dap.step_over)
vim.keymap.set('n', '<F3>', dap.step_out)
vim.keymap.set('n', '<leader>b', dap.toggle_breakpoint)
vim.keymap.set('n', '<leader>B', function()
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
end)
-- Dap UI setup
-- For more information, see |:help nvim-dap-ui|
dapui.setup {
-- Set icons to characters that are more likely to work in every terminal.
-- Feel free to remove or use ones that you like more! :)
-- Don't feel like these are good choices.
icons = { expanded = '', collapsed = '', current_frame = '*' },
controls = {
icons = {
pause = '',
play = '',
step_into = '',
step_over = '',
step_out = '',
step_back = 'b',
run_last = '▶▶',
terminate = '',
disconnect = "",
},
},
}
-- toggle to see last session result. Without this ,you can't see session output in case of unhandled exception.
vim.keymap.set("n", "<F7>", dapui.toggle)
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
dap.listeners.before.event_exited['dapui_config'] = dapui.close
-- Install golang specific config
require('dap-go').setup()
end,
}

142
minit.lua 100644
View File

@ -0,0 +1,142 @@
-- Set <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- Install package manager
-- https://github.com/folke/lazy.nvim
-- `:help lazy.nvim.txt` for more info
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system {
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
lazypath,
}
end
vim.opt.rtp:prepend(lazypath)
require('lazy').setup({
{
"Mofiqul/adwaita.nvim",
-- "shaunsingh/nord.nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd('colorscheme adwaita')
end
},
{
-- Set lualine as statusline
'nvim-lualine/lualine.nvim',
-- See `:help lualine.txt`
opts = {
options = {
icons_enabled = true,
theme = 'adwaita',
component_separators = '|',
section_separators = '',
},
},
},
{
-- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects',
},
build = ':TSUpdate',
}
})
vim.wo.number = true
-- [[ Configure Treesitter ]]
-- See `:help nvim-treesitter`
require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter
ensure_installed = { },
-- Do not install parses synchronously
sync_install = false,
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = false,
-- List of parsers to ignore installing
-- ignore_install = { "markdown" },
-- Required property, but empty
modules = {},
highlight = {
enable = true,
},
indent = { enable = true, disable = { 'python' } },
incremental_selection = {
enable = true,
keymaps = {
init_selection = '<c-space>',
node_incremental = '<c-space>',
scope_incremental = '<c-s>',
node_decremental = '<M-space>',
},
},
textobjects = {
select = {
enable = true,
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
keymaps = {
-- You can use the capture groups defined in textobjects.scm
['aa'] = '@parameter.outer',
['ia'] = '@parameter.inner',
['af'] = '@function.outer',
['if'] = '@function.inner',
['ac'] = '@class.outer',
['ic'] = '@class.inner',
},
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
[']m'] = '@function.outer',
[']]'] = '@class.outer',
},
goto_next_end = {
[']M'] = '@function.outer',
[']['] = '@class.outer',
},
goto_previous_start = {
['[m'] = '@function.outer',
['[['] = '@class.outer',
},
goto_previous_end = {
['[M'] = '@function.outer',
['[]'] = '@class.outer',
},
},
swap = {
enable = true,
swap_next = {
['<leader>a'] = '@parameter.inner',
},
swap_previous = {
['<leader>A'] = '@parameter.inner',
},
},
},
}
-- Diagnostic keymaps
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })

View File

@ -0,0 +1,65 @@
local ls = require("luasnip")
local s = ls.snippet
local t = ls.text_node
local f = ls.function_node
local fmt = require("luasnip.extras.fmt").fmt
-- Function to get the current date
local get_date = function()
return os.date("%Y-%m-%d")
end
return {
-- Commit messages related to the workplace
s(
{
trig = "hr",
name = "Heures",
dscr = "Insert a commit message for saving the worked hours."
},
{
t("organisation: enregistre les heures")
}
),
s(
{
trig = "aou",
name = "AoU stats commit message",
dscr = "Commit message for an increment of AoU validation statistics."
},
{
t("r+e: incrémente les stats de validation de l'AoU")
}
),
-- Commit messages related to my private life
s(
{
trig = "ic",
name = "Incremental note commit message",
dscr = "Insert a commit message for my incremental notes commits."
},
fmt(
[[
Incrémente la note du {1}
]],
{
f(get_date, {})
}
)
),
s(
{
trig = "cp",
name = "Running session commit message",
dscr = "Insert a commit message for running sessions commits."
},
fmt(
[[
course à pied: documente la séance du {1}
]],
{
f(get_date, {})
}
)
)
}

View File

@ -0,0 +1,115 @@
-- My HTML snippets
-- Below, the duplicate of brackets, for instance in the CSS code, is for
-- escaping delimiters.
-- Set the local variables (shortcuts)
local ls = require("luasnip")
local s = ls.snippet
local i = ls.insert_node
local fmt = require("luasnip.extras.fmt").fmt
return {
-- A main snippet setting the outer structure, with the style tag.
-- Should be completed with the nested article item below.
s(
{
trig = "mcim",
name = "Main article structure for MC portal",
dscr = "Insert an HTML structure to add bibliographic description on the clinical medicine portal."
},
fmt(
[[
<article class="mc-{1}-main">
{2}
<style>
.mc-{1}-title {{
color: #cf0063;
font-size: xx-large;
}}
.mc-{1}-item > ul > li {{
padding: 0 !important;
}}
.mc-{1}-item li:not([class])::before,
.mc-{1}-item li::before {{
content: none;
}}
</style>
</article>
]],
{
i(1, "Class identifier"),
i(0)
},
{
repeat_duplicates = true
}
)
),
-- Snippet that inserts an article with bibliographic metatada, to be nested
-- in the upper main structure.
s(
{
trig = "mcii",
name = "Item article structure for MC portal",
dscr = "Insert an HTML structure to add an item bibliographic description on the clinical medicine portal."
},
fmt(
[[
<article class="mc-{1}-item">
<ul>
<li>Dorland W. Dorlands illustrated medical dictionary. 4th ed.</li>
<li>Philadelphia: Elsevier, 2020.</li>
<li>Cote : W 13 ed 4</li>
<li>
<a lang="fr"
dir="ltr"
type="html/text"
href="https://slsp-unige.primo.exlibrisgroup.com/articleermalink/41SLSP_UGE/l0hvjc/alma991008098789705502"
hreflang="français"
rel="nofollow"
target="_blank">
Le document dans le catalogue Swisscovery
</a>.
</li>
</ul>
<span placeholder="coins metadata"></span>
</article>{2}
]],
{
i(1, "Class identifier"),
i(0)
},
{
repeat_duplicates = true
}
)
),
-- Snippet that insert a list item with a link to an ebook online.
s(
{
trig = "eli",
name = "List item for an ebook link",
dscr = "Insert a link for an ebook nested in a list item. Designed for the medicine portal HTML structure."
},
fmt(
[[
<li>
<a dir="ltr"
type="html/text"
href="{1}"
lang="{2}"
hreflang="{3}"
ref="nofollow"
target="_blank">
Livre électronique en ligne
</a>.
</li>
]],
{
i(1, "Ebook URL"),
i(2, "Language code (2 chars)"),
i(3, "Language name")
}
)
)
}

View File

@ -0,0 +1,210 @@
local ls = require("luasnip")
local s = ls.snippet
local t = ls.text_node
local i = ls.insert_node
local f = ls.function_node
local fmt = require("luasnip.extras.fmt").fmt
-- Function to get the datetime
-- with daylight saving time
-- according to the locale
local get_datetime = function()
return os.date("%Y-%m-%dT%H:%M:%S%z")
end
-- Function to get the current date
local get_date = function()
return os.date("%Y-%m-%d")
end
-- Function to get the current month
local get_month = function()
return os.date("%B")
end
-- Function to get the current year
local get_month_year = function()
return os.date("%B-%Y")
end
-- Function to get an id based on the datetime
local get_id = function()
return os.date("%Y%m%d%H%M%S")
end
-- Function to get the number of the current day
local get_day = function()
return os.date("%d")
end
return {
s(
{
trig = "dt",
name = "Datetime",
dscr = "Insert the current datetime with locale daylight saving."
},
{
f(get_datetime, {})
}
),
s(
{
trig = "id",
Name = "ID",
dscr = "Insert an id based on the current datetime."
},
{
f(get_id, {})
}
),
s(
{
trig = "today",
Name = "Today",
dscr = "Insert the number of the current day."
},
{
f(get_day, {})
}
),
s(
{
trig = "ie",
Name = "Inc entry",
dscr = "Insert an Inc entry for today (heading level 2)."
},
fmt(
[[
## {}
]],
{
f(get_day, {})
}
)
),
s(
{
trig = "fm",
name = "YAML frontmatter",
dscr = "Insert a YAML frontmatter for markdown files.\n\nIt has a datetime with the locale daylight saving time, and an ID based on the datetime.\nTab to jump to next text input."
},
fmt(
[[
---
title: {1}
date: {3}
id: {4}
tags: [{2}]
---
]],
{
i(1, "title"),
i(2, "tags"),
f(get_datetime, {}),
f(get_id, {})
}
)
),
s(
{
trig = "inc",
name = "INC YAML frontmatter",
dscr = "Insert a YAML frontmatter for INC notes.\n\nIt has a datetime with the locale daylight saving time, prefilled title, author, categories and tags.\nAdjust the title manually."
},
fmt(
[[
---
title: {1}
date: {2}
id: {4}
tags: [notes, quotidien, {3}]
---
]],
{
f(get_month_year, {}),
f(get_datetime, {}),
f(get_month, {}),
f(get_id, {})
}
)
),
s(
{
trig = "run",
name = "YAML frontmatter for a running note",
dscr = "Insert a YAML frontmatter for running notes.\n\nIt has a date for the title, a datetime with the locale daylight saving time for the date and id field, some prefilled tags. Other specific metadata for running are to be filled. This snippet should be adapted when following another plan."
},
fmt(
[[
---
title: {5}
date: {6}
id: {7}
tags: [préparation marathon, campus, plan 2, {1}]
plan:
- coaching: "campus"
- type: "marathon"
- durée: "24 semaines"
séance:
- type: "{2}"
- semaine: {3}
- séance: {4}
données:
- privées: ""
- publiques: ""
---
]],
{
i(1, "tags"),
i(2, "workout type"),
i(3, "week number of the plan"),
i(4, "workout number of the week"),
f(get_date, {}),
f(get_datetime, {}),
f(get_id, {})
}
)
),
s(
{
trig="reflink",
name = "Reference link",
dscr="Insert a link with reference syntax",
docstring = "[Link text][Reference]\n\n[Reference]: Link Target \"Title\"\n\nTab to jump to next text input. \"Reference\" is automatically repeated."
},
fmt(
[[
[{1}][{2}]
[{2}]: {3}
]],
{
i(1, "Link text"),
i(2, "Reference"),
i(3, "Link target")
},
{ repeat_duplicates = true }
)
),
s(
{
trig = "tags",
name = "Tags",
dscr = "Insert a one-line tags array, in a text file (markdown)."
},
fmt(
[[
tags: [{}]
]],
{
i(1, "tags")
}
)
)
}