From 70c10dd25fe0b2aa08f36f5952f4350b4b134950 Mon Sep 17 00:00:00 2001 From: Brieuc Dubois Date: Sun, 10 Mar 2024 18:34:40 +0100 Subject: [PATCH] Neovim --- .../.config/coc/extensions/package.json | 1 + root/home/bhasher/.config/coc/memos.json | 1 + root/home/bhasher/.config/nvim/init.lua | 55 +++++++++++++++++++ root/home/bhasher/.config/nvim/init.vim.old | 42 ++++++++++++++ root/home/bhasher/.zshrc | 4 +- 5 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 root/home/bhasher/.config/coc/extensions/package.json create mode 100644 root/home/bhasher/.config/coc/memos.json create mode 100644 root/home/bhasher/.config/nvim/init.lua create mode 100644 root/home/bhasher/.config/nvim/init.vim.old diff --git a/root/home/bhasher/.config/coc/extensions/package.json b/root/home/bhasher/.config/coc/extensions/package.json new file mode 100644 index 0000000..feb69ef --- /dev/null +++ b/root/home/bhasher/.config/coc/extensions/package.json @@ -0,0 +1 @@ +{"dependencies":{}} \ No newline at end of file diff --git a/root/home/bhasher/.config/coc/memos.json b/root/home/bhasher/.config/coc/memos.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/root/home/bhasher/.config/coc/memos.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/root/home/bhasher/.config/nvim/init.lua b/root/home/bhasher/.config/nvim/init.lua new file mode 100644 index 0000000..ca0bd1c --- /dev/null +++ b/root/home/bhasher/.config/nvim/init.lua @@ -0,0 +1,55 @@ +-- General options +vim.opt.compatible = false +vim.opt.ignorecase = true +vim.opt.showmatch = true +vim.opt.hlsearch = true +vim.opt.incsearch = true + +vim.opt.tabstop = 2 +vim.opt.softtabstop = 0 +vim.opt.shiftwidth = 2 +vim.opt.autoindent = true +vim.opt.expandtab = false + +vim.opt.number = true +vim.opt.relativenumber = true + +vim.opt.wildmode = 'longest,list' + +vim.opt.syntax = 'on' + +vim.opt.ttyfast = true +vim.opt.swapfile = false +vim.opt.mouse = 'a' + +vim.opt.spell = true +vim.opt.spelllang = 'en' -- ,fr' +vim.api.nvim_set_hl(0, "SpellBad", { ctermbg=238 }) + +-- Plugins +local Plug = vim.fn['plug#'] + +vim.call('plug#begin') + +Plug('neoclide/coc.nvim', {['branch'] = 'release'}) +Plug('francoiscabrol/ranger.vim') +Plug('rbgrouleff/bclose.vim') +-- Plug('zbirenbaum/copilot.lua') +Plug('github/copilot.vim') +Plug('nvim-treesitter/nvim-treesitter', {['do'] = ':TSUpdate'}) + +vim.call('plug#end') + +-- inoremap coc#pum#visible() ? coc#pum#confirm() +-- \: "\u\\=coc#on_enter()\" + +vim.g.ranger_replace_netrw = 1 +vim.keymap.set('i', '', '(copilot-accept-word)') + +require('nvim-treesitter.configs').setup({ + ensure_installed = { "go", "lua", "vim", "vimdoc", "sql", "json", }, + highlight = { + enable = true, + }, +}) + diff --git a/root/home/bhasher/.config/nvim/init.vim.old b/root/home/bhasher/.config/nvim/init.vim.old new file mode 100644 index 0000000..ce29844 --- /dev/null +++ b/root/home/bhasher/.config/nvim/init.vim.old @@ -0,0 +1,42 @@ +set nocompatible + +set ignorecase +set showmatch +set hlsearch +set incsearch + +set tabstop=2 +set softtabstop=0 +set shiftwidth=2 +set autoindent +set noexpandtab + +set number +set relativenumber + +set wildmode=longest,list + +syntax on + +" set clipboard=unnamedplus + +" set spell +" set spelllang=en ",fr + +set ttyfast +set noswapfile +set mouse=a + +call plug#begin() + +Plug 'neoclide/coc.nvim', {'branch': 'release'} +Plug 'francoiscabrol/ranger.vim' +Plug 'rbgrouleff/bclose.vim' +Plug 'github/copilot.vim' + +call plug#end() + +inoremap coc#pum#visible() ? coc#pum#confirm() + \: "\u\\=coc#on_enter()\" + +let g:ranger_replace_netrw = 1 diff --git a/root/home/bhasher/.zshrc b/root/home/bhasher/.zshrc index 28ea120..61e2bf0 100644 --- a/root/home/bhasher/.zshrc +++ b/root/home/bhasher/.zshrc @@ -12,7 +12,7 @@ plugins=(git sudo zsh-autosuggestions zsh-syntax-highlighting) source $ZSH/oh-my-zsh.sh -export EDITOR='vim' +export EDITOR='nvim' [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh @@ -22,6 +22,8 @@ alias ip="ip -c" alias ls="ls -A --color" alias sl="sl -adew5F" alias ccat="pygmentize -g" +alias beep="sh -c 'speaker-test -t sine -f 600 > /dev/null & sleep .5 && pkill speaker-test'" +alias nv="nvim" cat() { for arg in "$@"; do