From d533425bcdce019ec8a5d2b18db84049fadb7101 Mon Sep 17 00:00:00 2001 From: Gregory Trolliet Date: Sat, 19 Oct 2024 11:57:52 +0200 Subject: [PATCH] =?UTF-8?q?[nvim]=20s=C3=A9pare=20les=20options=20et=20ind?= =?UTF-8?q?ente=20correctement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/nvim/init.lua | 66 ++++--------------------------- .config/nvim/lua/core/options.lua | 22 +++++++++++ 2 files changed, 29 insertions(+), 59 deletions(-) create mode 100644 .config/nvim/lua/core/options.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 494aed8..eb5f467 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -15,70 +15,18 @@ require("lazy").setup({ checker = { enabled = true }, }) -vim.opt.compatible = false -- disable compatibility to old-time vi -vim.opt.showmatch = true -- show matching brackets. -vim.opt.ignorecase = true -- case insensitive matching -vim.opt.cursorline = true -- highlights the current line in the editor -vim.opt.hlsearch = true -- highlight search results -vim.opt.number = true -- add line numbers -vim.opt.relativenumber = true -- display relative line numbers -vim.opt.colorcolumn = '88' -- set colour columns for good coding style -vim.opt.tabstop = 4 -- number of columns occupied by a tab character -vim.opt.shiftwidth = 4 -- width for autoindents -vim.opt.softtabstop = 4 -- see multiple spaces as tabstops so does the right thing - -vim.opt.listchars:append { - eol = "$", - space = "·", - tab = "▏ ", - trail = "_", - nbsp = "~", - extends = ">", - precedes = "<", -} -vim.opt.list = true +require("core.options") options = { noremap = true } -map('n', 'ff', ':Telescope find_files', options) -map('n', 'fg', ':Telescope git_files', options) -map('n', 'gc', ':Telescope git_commits', options) +map('n', 'ff', ':Telescope find_files', options) +map('n', 'fg', ':Telescope git_files', options) +map('n', 'gc', ':Telescope git_commits', options) map('n', '', ':Telescope buffers', options) -map('n', 't', ':TagbarToggle', options) +map('n', 't', ':TagbarToggle', options) -vim.cmd([[ -"set mouse=v " middle-click paste with mouse -"set autoindent " indent a new line the same amount as the line just typed -"set wildmode=longest,list " get bash-like tab completions -"filetype plugin indent on " allows auto-indenting depending on file type -" set expandtab " convert tabs to white space - -" specify directory for plugins -"call plug#begin('~/.config/nvim/plugged') - -"Plug 'echasnovski/mini.icons' -"Plug 'nvim-tree/nvim-web-devicons' -"Plug 'preservim/tagbar' - -"Plug 'rebelot/kanagawa.nvim' - -" Conquer on Completion -" Use release branch (recommended) -"Plug 'neoclide/coc.nvim', {'branch': 'release'} -" initialize plugin system -"call plug#end() - -"colorscheme kanagawa - -" In your init.lua or init.vim -set termguicolors -"lua << EOF -"require("bufferline").setup{} -"EO -]]) - ----------------------------------------------------------------- +-------------------------------------------------- -- LSP ----------------------------------------------------- +-------------------------------------------------- -- Reserve a space in the gutter -- This will avoid an annoying layout shift in the screen vim.opt.signcolumn = 'yes' diff --git a/.config/nvim/lua/core/options.lua b/.config/nvim/lua/core/options.lua new file mode 100644 index 0000000..b7aec38 --- /dev/null +++ b/.config/nvim/lua/core/options.lua @@ -0,0 +1,22 @@ +vim.opt.colorcolumn = '88' -- set colour columns for good coding style +vim.opt.compatible = false -- disable compatibility to old-time vi +vim.opt.showmatch = true -- show matching brackets. +vim.opt.ignorecase = true -- case insensitive matching +vim.opt.cursorline = true -- highlights the current line in the editor +vim.opt.hlsearch = true -- highlight search results +vim.opt.number = true -- add line numbers +vim.opt.relativenumber = true -- display relative line numbers +vim.opt.tabstop = 4 -- number of columns occupied by a tab character +vim.opt.shiftwidth = 4 -- width for autoindents +vim.opt.softtabstop = 4 -- see multiple spaces as tabstops so does the right thing + +vim.opt.listchars:append { + eol = "$", + space = "·", + tab = "▏ ", + trail = "_", + nbsp = "~", + extends = ">", + precedes = "<", +} +vim.opt.list = true