mirror of
https://github.com/Feliix42/dotfiles.git
synced 2024-11-22 14:06:30 +00:00
Move nvim to Lua config & lazy, use flexoki colors in terminal
This commit is contained in:
parent
9b91d3208e
commit
cfa5b9cacc
9 changed files with 4598 additions and 157 deletions
|
@ -176,6 +176,57 @@ font:
|
||||||
# If `true`, bold text is drawn using the bright color variants.
|
# If `true`, bold text is drawn using the bright color variants.
|
||||||
#draw_bold_text_with_bright_colors: false
|
#draw_bold_text_with_bright_colors: false
|
||||||
|
|
||||||
|
# https://github.com/kepano/flexoki/blob/main/alacritty/flexoki.yaml
|
||||||
|
# Flexoki
|
||||||
|
colors:
|
||||||
|
# Default colors
|
||||||
|
primary:
|
||||||
|
background: "0x282726"
|
||||||
|
foreground: "0xFFFCF0"
|
||||||
|
|
||||||
|
dim_foreground: "0xFFFCF0"
|
||||||
|
bright_foreground: "0xFFFCF0"
|
||||||
|
dim_background: "0x1C1B1A"
|
||||||
|
bright_background: "0x1C1B1A"
|
||||||
|
|
||||||
|
# Cursor colors
|
||||||
|
cursor:
|
||||||
|
text: "0xFFFCF0"
|
||||||
|
cursor: "0xFFFCF0"
|
||||||
|
|
||||||
|
# Normal colors
|
||||||
|
normal:
|
||||||
|
black: "0x100F0F"
|
||||||
|
red: "0xAF3029"
|
||||||
|
green: "0x66800B"
|
||||||
|
yellow: "0xAD8301"
|
||||||
|
blue: "0x205EA6"
|
||||||
|
magenta: "0xA02F6F"
|
||||||
|
cyan: "0x24837B"
|
||||||
|
white: "0xFFFCF0"
|
||||||
|
|
||||||
|
# Bright colors
|
||||||
|
bright:
|
||||||
|
black: "0x100F0F"
|
||||||
|
red: "0xD14D41"
|
||||||
|
green: "0x879A39"
|
||||||
|
yellow: "0xD0A215"
|
||||||
|
blue: "0x4385BE"
|
||||||
|
magenta: "0xCE5D97"
|
||||||
|
cyan: "0x3AA99F"
|
||||||
|
white: "0xFFFCF0"
|
||||||
|
|
||||||
|
# Dim colors
|
||||||
|
dim:
|
||||||
|
black: "0x100F0F"
|
||||||
|
red: "0xAF3029"
|
||||||
|
green: "0x66800B"
|
||||||
|
yellow: "0xAD8301"
|
||||||
|
blue: "0x205EA6"
|
||||||
|
magenta: "0xA02F6F"
|
||||||
|
cyan: "0x24837B"
|
||||||
|
white: "0xFFFCF0"
|
||||||
|
|
||||||
# Colors (Tomorrow Night)
|
# Colors (Tomorrow Night)
|
||||||
#colors:
|
#colors:
|
||||||
# Default colors
|
# Default colors
|
||||||
|
|
|
@ -246,7 +246,13 @@
|
||||||
mlir
|
mlir
|
||||||
circt
|
circt
|
||||||
llvmPackages_16.clang
|
llvmPackages_16.clang
|
||||||
|
llvmPackages_16.libcxx
|
||||||
|
llvmPackages_16.libcxxabi
|
||||||
|
llvmPackages_16.libllvm
|
||||||
|
llvmPackages_16.llvm-manpages
|
||||||
|
llvmPackages_16.openmp
|
||||||
llvmPackages_16.bintools
|
llvmPackages_16.bintools
|
||||||
|
clang-tools_16
|
||||||
lit
|
lit
|
||||||
|
|
||||||
## I heard you like man pages?
|
## I heard you like man pages?
|
||||||
|
@ -264,6 +270,7 @@
|
||||||
# TODO(feliix42): Fix at some point!
|
# TODO(feliix42): Fix at some point!
|
||||||
unstable.vscode.fhs
|
unstable.vscode.fhs
|
||||||
neovim
|
neovim
|
||||||
|
tree-sitter # for NVIM completions
|
||||||
ghostwriter
|
ghostwriter
|
||||||
firefox-wayland
|
firefox-wayland
|
||||||
unstable.obsidian
|
unstable.obsidian
|
||||||
|
|
4160
entropy/nvim/foo.txt
Normal file
4160
entropy/nvim/foo.txt
Normal file
File diff suppressed because it is too large
Load diff
136
entropy/nvim/init.lua
Normal file
136
entropy/nvim/init.lua
Normal file
|
@ -0,0 +1,136 @@
|
||||||
|
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)
|
||||||
|
|
||||||
|
-- comma as leader
|
||||||
|
vim.g.mapleader = ","
|
||||||
|
|
||||||
|
require('plugins')
|
||||||
|
|
||||||
|
-- load legacy options
|
||||||
|
vim.cmd([[
|
||||||
|
" so ~/.config/nvim/legacy.vim
|
||||||
|
let $FZF_DEFAULT_COMMAND = 'rg --files --hidden'
|
||||||
|
let g:tex_flavor='latex'
|
||||||
|
let g:vimtex_view_method = 'zathura'
|
||||||
|
let g:haskell_enable_quantification = 1 " to enable highlighting of `forall`
|
||||||
|
let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec`
|
||||||
|
let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc`
|
||||||
|
let g:haskell_enable_pattern_synonyms = 1 " to enable highlighting of `pattern`
|
||||||
|
let g:haskell_enable_typeroles = 1 " to enable highlighting of type roles
|
||||||
|
let g:haskell_enable_static_pointers = 1 " to enable highlighting of `static`
|
||||||
|
let g:haskell_backpack = 1 " to enable highlighting of backpack keywords
|
||||||
|
|
||||||
|
autocmd FileType hledger setlocal omnifunc=hledger#complete#omnifunc
|
||||||
|
]])
|
||||||
|
|
||||||
|
require('completion')
|
||||||
|
require('lsp-setup')
|
||||||
|
|
||||||
|
-- nvim-treesitter
|
||||||
|
require('nvim-treesitter.configs').setup {
|
||||||
|
ensure_installed = {
|
||||||
|
"c", "lua", "vim", "query", "mlir",
|
||||||
|
"gitattributes", "gitcommit", "gitignore",
|
||||||
|
"json", "markdown", "yaml", "toml",
|
||||||
|
"make", "nix", "bash",
|
||||||
|
"php", "html", "css",
|
||||||
|
"python", "rust",
|
||||||
|
},
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- editor theme
|
||||||
|
--vim.cmd.colorscheme("flexoki")
|
||||||
|
|
||||||
|
-- lualine theme
|
||||||
|
require('lualine').setup {
|
||||||
|
options = {
|
||||||
|
theme = 'gruvbox',
|
||||||
|
-- no separators between lualine elements
|
||||||
|
section_separators = '',
|
||||||
|
component_separators = ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-- to disable the default netrw file browser
|
||||||
|
-- vim.g.loaded_netrw = 1
|
||||||
|
-- vim.g.loaded_netrwPlugin = 1
|
||||||
|
|
||||||
|
vim.opt.termguicolors = true
|
||||||
|
require("bufferline").setup{}
|
||||||
|
|
||||||
|
-- settings for neovide
|
||||||
|
if vim.g.neovide then
|
||||||
|
vim.o.guifont = "Iosevka Medium:h9"
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.opt.backspace = "indent,eol,start"
|
||||||
|
|
||||||
|
-- fix auto-completion
|
||||||
|
vim.opt.wildmenu = true
|
||||||
|
vim.opt.wildignorecase = true
|
||||||
|
vim.opt.wildignore = "*.o,*~,*.pyc,*.aux,*.bbl,*.blg,*-blx.bib,*.log,*.out,*.run.xml,*.toc,*.nav,*.snm"
|
||||||
|
|
||||||
|
-- BUFFER HANDLING ---------------------------------
|
||||||
|
-- automatically reload files changed on disk but not in buffer
|
||||||
|
vim.opt.autoread = true
|
||||||
|
-- hide buffers on switch
|
||||||
|
vim.opt.hidden = true
|
||||||
|
|
||||||
|
-- OPTICS & NUMBERING BEHAVIOUR --------------------
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
vim.opt.tabstop = 4
|
||||||
|
vim.opt.shiftwidth = 4
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
-- keep 5 lines of context above/below the cursor (if possible)
|
||||||
|
vim.opt.scrolloff = 5
|
||||||
|
|
||||||
|
|
||||||
|
-- SEARCH ------------------------------------------
|
||||||
|
-- highlight all search results
|
||||||
|
vim.opt.hlsearch = true
|
||||||
|
-- enable smart-case search
|
||||||
|
vim.opt.smartcase = true
|
||||||
|
-- always case-insensitive
|
||||||
|
vim.opt.ignorecase = true
|
||||||
|
-- searches for strings incrementally
|
||||||
|
vim.opt.incsearch = true
|
||||||
|
|
||||||
|
-- key bindings
|
||||||
|
-- empty mode string matches n, v, o
|
||||||
|
vim.keymap.set("", "<leader>h", ":tabp<Enter>", { desc = "Select previous tab" })
|
||||||
|
vim.keymap.set("", "<leader>l", ":tabn<Enter>", { desc = "Select next tab" })
|
||||||
|
vim.keymap.set("", "<C-H>", ":bprevious<Enter>", { desc = "Select previous buffer" })
|
||||||
|
vim.keymap.set("", "<C-L>", ":bnext<Enter>", { desc = "Select next buffer" })
|
||||||
|
|
||||||
|
vim.keymap.set("", "<leader>f", ":Files<Enter>", { desc = "Open FZF file finder" })
|
||||||
|
vim.keymap.set("", "<leader>bl", ":Buffers<Enter>", { desc = "Open FZF buffer list" })
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<space>1", "1<C-w>w", { noremap = true })
|
||||||
|
vim.keymap.set("n", "<space>2", "2<C-w>w", { noremap = true })
|
||||||
|
vim.keymap.set("n", "<space>3", "3<C-w>w", { noremap = true })
|
||||||
|
vim.keymap.set("n", "<space>4", "4<C-w>w", { noremap = true })
|
||||||
|
vim.keymap.set("n", "<space>5", "5<C-w>w", { noremap = true })
|
||||||
|
vim.keymap.set("n", "<space>6", "6<C-w>w", { noremap = true })
|
||||||
|
vim.keymap.set("n", "<space>7", "7<C-w>w", { noremap = true })
|
||||||
|
vim.keymap.set("n", "<space>8", "8<C-w>w", { noremap = true })
|
||||||
|
vim.keymap.set("n", "<space>9", "9<C-w>w", { noremap = true })
|
||||||
|
vim.keymap.set("n", "<space>0", "10<C-w>w", { noremap = true })
|
||||||
|
|
||||||
|
|
||||||
|
-- TODO:
|
||||||
|
-- window number on editor buffer
|
||||||
|
-- hledger file type omnifunc like: autocmd FileType hledger setlocal omnifunc=hledger#complete#omnifunc
|
|
@ -1,157 +0,0 @@
|
||||||
" this is enabled by default in nvim
|
|
||||||
" filetype plugin indent on
|
|
||||||
" syntax on
|
|
||||||
|
|
||||||
" enable autocompletion of ale
|
|
||||||
let g:ale_completion_enabled = 1
|
|
||||||
" disable latex linting from ale as i've got my own plugin for that
|
|
||||||
let g:ale_linters = {'rust': ['analyzer'], 'nix': ['nil'], 'haskell': ['hls', 'hindent'], 'tex': []}
|
|
||||||
"let g:ale_fixers = {'c': ['clang-format']}
|
|
||||||
|
|
||||||
" settings for neovide
|
|
||||||
if exists("g:neovide")
|
|
||||||
set guifont=Iosevka\ Medium:h9
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
" Initialize plugin system
|
|
||||||
call plug#begin(stdpath('data') . '/plugged')
|
|
||||||
|
|
||||||
" Make sure you use single quotes
|
|
||||||
|
|
||||||
" Shorthand notation; fetches https://github.com/morhetz/gruvbox
|
|
||||||
Plug 'morhetz/gruvbox'
|
|
||||||
" Plug 'drewtempelmeyer/palenight.vim'
|
|
||||||
|
|
||||||
" Any valid git URL is allowed
|
|
||||||
Plug 'https://github.com/scrooloose/nerdcommenter.git'
|
|
||||||
|
|
||||||
" On-demand loading for languages
|
|
||||||
Plug 'rust-lang/rust.vim', { 'for': 'rust' }
|
|
||||||
Plug 'cespare/vim-toml', { 'for': 'toml' }
|
|
||||||
Plug 'keith/swift.vim', { 'for': 'swift' }
|
|
||||||
Plug 'neovimhaskell/haskell-vim', { 'for': 'haskell' }
|
|
||||||
Plug 'jalvesaq/Nvim-R', {'branch': 'stable', 'for': 'r'}
|
|
||||||
Plug 'rhysd/vim-llvm'
|
|
||||||
|
|
||||||
" Lingua Franca
|
|
||||||
Plug 'lf-lang/lingua-franca.vim'
|
|
||||||
|
|
||||||
Plug 'anekos/hledger-vim'
|
|
||||||
|
|
||||||
Plug 'vim-syntastic/syntastic'
|
|
||||||
Plug 'vim-airline/vim-airline'
|
|
||||||
Plug 'tpope/vim-fugitive'
|
|
||||||
Plug 'airblade/vim-gitgutter'
|
|
||||||
Plug 'justinmk/vim-sneak'
|
|
||||||
Plug 'lervag/vimtex'
|
|
||||||
Plug 'editorconfig/editorconfig-vim'
|
|
||||||
Plug 'LnL7/vim-nix'
|
|
||||||
Plug 'preservim/nerdtree'
|
|
||||||
|
|
||||||
" wayland clipboard
|
|
||||||
Plug 'jasonccox/vim-wayland-clipboard'
|
|
||||||
|
|
||||||
" Plugin outside ~/.vim/plugged with post-update hook
|
|
||||||
Plug 'junegunn/fzf' ", { 'do': { -> fzf#install() } }
|
|
||||||
Plug 'junegunn/fzf.vim'
|
|
||||||
|
|
||||||
" ale language server client
|
|
||||||
Plug 'dense-analysis/ale'
|
|
||||||
|
|
||||||
" Initialize plugin system
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
" open fzf files in new tab instead of new buffer
|
|
||||||
"command! -bang -nargs=? -complete=dir Files
|
|
||||||
"\ call fzf#vim#files(<q-args>, {'sink': 'tabedit', 'options': ['--info=inline', '--preview', '~/.vim/plugged/fzf.vim/bin/preview.sh {}']}, <bang>0)
|
|
||||||
|
|
||||||
" hledger file type support
|
|
||||||
autocmd FileType hledger setlocal omnifunc=hledger#complete#omnifunc
|
|
||||||
|
|
||||||
set laststatus=2
|
|
||||||
let g:airline#extensions#tabline#enabled = 1
|
|
||||||
let g:airline_powerline_fonts = 0
|
|
||||||
|
|
||||||
" window switching by #
|
|
||||||
let g:airline_section_c = '[%{winnr()}] %t'
|
|
||||||
nnoremap <space>1 1<C-w>w
|
|
||||||
nnoremap <space>2 2<C-w>w
|
|
||||||
nnoremap <space>3 3<C-w>w
|
|
||||||
nnoremap <space>4 4<C-w>w
|
|
||||||
nnoremap <space>5 5<C-w>w
|
|
||||||
nnoremap <space>6 6<C-w>w
|
|
||||||
nnoremap <space>7 7<C-w>w
|
|
||||||
nnoremap <space>8 8<C-w>w
|
|
||||||
nnoremap <space>9 9<C-w>w
|
|
||||||
nnoremap <space>0 10<C-w>w
|
|
||||||
|
|
||||||
" set haskell highlighting
|
|
||||||
let g:haskell_enable_quantification = 1 " to enable highlighting of `forall`
|
|
||||||
let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec`
|
|
||||||
let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc`
|
|
||||||
let g:haskell_enable_pattern_synonyms = 1 " to enable highlighting of `pattern`
|
|
||||||
let g:haskell_enable_typeroles = 1 " to enable highlighting of type roles
|
|
||||||
let g:haskell_enable_static_pointers = 1 " to enable highlighting of `static`
|
|
||||||
let g:haskell_backpack = 1 " to enable highlighting of backpack keywords
|
|
||||||
|
|
||||||
" possible setting as alternative for easymotion
|
|
||||||
" let g:sneak#label = 1
|
|
||||||
|
|
||||||
set backspace=indent,eol,start
|
|
||||||
|
|
||||||
" map the leader key to ,
|
|
||||||
let mapleader=","
|
|
||||||
|
|
||||||
let $FZF_DEFAULT_COMMAND = 'rg --files --hidden --iglob "!.git/*"'
|
|
||||||
|
|
||||||
" Cycling through windows and tabs
|
|
||||||
" nnoremap j <C-W><C-J>
|
|
||||||
" nnoremap k <C-W><C-K>
|
|
||||||
" nnoremap l <C-W><C-L>
|
|
||||||
" nnoremap h <C-W><C-H>
|
|
||||||
" nnoremap <C-J> <C-W><C-J><C-W>_
|
|
||||||
" nnoremap <C-K> <C-W><C-K><C-W>_
|
|
||||||
" nnoremap <C-L> <C-W><C-L><C-W>\|
|
|
||||||
" nnoremap <C-H> <C-W><C-H><C-W>\|
|
|
||||||
map <leader>h :tabp<Enter>
|
|
||||||
map <leader>l :tabn<Enter>
|
|
||||||
map <C-H> :bprevious<Enter>
|
|
||||||
map <C-L> :bnext<Enter>
|
|
||||||
map <leader>f :Files<Enter>
|
|
||||||
map <leader>b :Buffers<Enter>
|
|
||||||
|
|
||||||
" fix auto-completion
|
|
||||||
set wildmenu " show a completion menu
|
|
||||||
set wildignorecase
|
|
||||||
set wildignore=*.o,*~,*.pyc,*.aux,*.bbl,*.blg,*-blx.bib,*.log,*.out,*.run.xml,
|
|
||||||
\*.toc,*.nav,*.snm " ignore auxiliary files
|
|
||||||
" set completeopt-=preview
|
|
||||||
|
|
||||||
" automatically reload files changed on disk but not in buffer
|
|
||||||
set autoread
|
|
||||||
" hide buffers on switch
|
|
||||||
set hidden
|
|
||||||
|
|
||||||
" tex configuration
|
|
||||||
let g:tex_flavor='latex'
|
|
||||||
let g:vimtex_view_method = 'zathura'
|
|
||||||
|
|
||||||
" Optics
|
|
||||||
set background=dark " Setting dark mode
|
|
||||||
colorscheme gruvbox "palenight
|
|
||||||
|
|
||||||
set number
|
|
||||||
set relativenumber
|
|
||||||
set tabstop=4
|
|
||||||
set shiftwidth=4
|
|
||||||
set expandtab
|
|
||||||
|
|
||||||
" keep 5 lines of context above/below the cursor (if possible)
|
|
||||||
set scrolloff=5
|
|
||||||
|
|
||||||
" Search
|
|
||||||
set hlsearch " Highlight all search results
|
|
||||||
set smartcase " Enable smart-case search
|
|
||||||
set ignorecase " Always case-insensitive
|
|
||||||
set incsearch " Searches for strings incrementally
|
|
35
entropy/nvim/lazy-lock.json
Normal file
35
entropy/nvim/lazy-lock.json
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
"Nvim-R": { "branch": "stable", "commit": "346fda8ade9f743f65a6805136deb3db70dc5fae" },
|
||||||
|
"bufferline.nvim": { "branch": "main", "commit": "6ecd37e0fa8b156099daedd2191130e083fb1490" },
|
||||||
|
"clangd_extensions.nvim": { "branch": "main", "commit": "34c8eaa12be192e83cd4865ce2375e9f53e728f2" },
|
||||||
|
"cmake-tools.nvim": { "branch": "master", "commit": "4b7a0e79cb72ca01a3106987be45961b5f2dddb6" },
|
||||||
|
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||||
|
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
|
||||||
|
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
|
||||||
|
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||||
|
"editorconfig-vim": { "branch": "master", "commit": "0d54ea863089fb13be423b4aed6cca35f3a5d778" },
|
||||||
|
"fzf": { "branch": "master", "commit": "3666448ca649093f6f6b534b67e5a8b865d11a00" },
|
||||||
|
"fzf.vim": { "branch": "master", "commit": "d1016dbd7cec2d2a3bb5863776c84b4034e4b85e" },
|
||||||
|
"gruvbox-baby": { "branch": "main", "commit": "be47338877e0536360290d66d26854e90dbc0004" },
|
||||||
|
"haskell-vim": { "branch": "master", "commit": "f35d02204b4813d1dbe8b0e98cc39701a4b8e15e" },
|
||||||
|
"hledger-vim": { "branch": "master", "commit": "165eb483a10fd610bd9cad5d5246e457bf5fe285" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "ed6c9ffe2174bcfe4c17199ec4535aa4d4be1e62" },
|
||||||
|
"lingua-franca.vim": { "branch": "main", "commit": "439b92a13744ee21cb3cd9c399e179efbcaa2967" },
|
||||||
|
"lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" },
|
||||||
|
"neoformat": { "branch": "master", "commit": "aedb6f9d3f53d5da229095f7d761d749f8c5c7e0" },
|
||||||
|
"nerdcommenter": { "branch": "master", "commit": "d2e21d417f6c788b11ae3b90d7ac478930dead36" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "e49b1e90c1781ce372013de3fa93a91ea29fc34a" },
|
||||||
|
"nvim-treesitter": { "branch": "master", "commit": "49e71322db582147ce8f4df1853d9dab08da0826" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "3af745113ea537f58c4b1573b64a429fefad9e07" },
|
||||||
|
"oil.nvim": { "branch": "master", "commit": "164135793d893efad9ed6f90ac74a1ab54c4182a" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
|
||||||
|
"rust.vim": { "branch": "master", "commit": "889b9a7515db477f4cb6808bef1769e53493c578" },
|
||||||
|
"vim-fugitive": { "branch": "master", "commit": "cbe9dfa162c178946afa689dd3f42d4ea8bf89c1" },
|
||||||
|
"vim-llvm": { "branch": "master", "commit": "c5d6c6a9ef21df2a32aad0f3b5ca5389f92d06d1" },
|
||||||
|
"vim-nix": { "branch": "master", "commit": "1e8d3cc4d74f40fb384cd1739739543fe117ff61" },
|
||||||
|
"vim-toml": { "branch": "main", "commit": "d36caa6b1cf508a4df1c691f915572fc02143258" },
|
||||||
|
"vim-vsnip": { "branch": "master", "commit": "be277461265f1e5c7db470aa479f30956597ea9e" },
|
||||||
|
"vimtex": { "branch": "master", "commit": "cbb20643b7bfe721902dac5760bf0d4889fb5f7e" }
|
||||||
|
}
|
68
entropy/nvim/lua/completion.lua
Normal file
68
entropy/nvim/lua/completion.lua
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
-- Set up nvim-cmp.
|
||||||
|
local cmp = require'cmp'
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
-- completion = cmp.config.window.bordered(),
|
||||||
|
-- documentation = cmp.config.window.bordered(),
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
|
||||||
|
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
|
||||||
|
['<Tab>'] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 'c' }),
|
||||||
|
['<S-Tab>'] = cmp.mapping(cmp.mapping.select_prev_item(), { 'i', 'c' }),
|
||||||
|
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
|
||||||
|
['<C-y>'] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
|
||||||
|
['<C-e>'] = cmp.mapping({
|
||||||
|
i = cmp.mapping.abort(),
|
||||||
|
c = cmp.mapping.close(),
|
||||||
|
}),
|
||||||
|
['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently elected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
|
}),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'nvim_lsp' },
|
||||||
|
{ name = 'nvim_lsp_signature_help' },
|
||||||
|
{ name = 'vsnip' }, -- For vsnip users.
|
||||||
|
}, {
|
||||||
|
{ name = 'buffer' },
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Set configuration for specific filetype.
|
||||||
|
cmp.setup.filetype('gitcommit', {
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
|
||||||
|
}, {
|
||||||
|
{ name = 'buffer' },
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||||
|
cmp.setup.cmdline({ '/', '?' }, {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = {
|
||||||
|
{ name = 'buffer' }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||||
|
cmp.setup.cmdline(':', {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'path' }
|
||||||
|
}, {
|
||||||
|
{ name = 'cmdline' }
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Set up lspconfig.
|
||||||
|
--local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
|
||||||
|
--require('lspconfig')['<YOUR_LSP_SERVER>'].setup {
|
||||||
|
--capabilities = capabilities
|
||||||
|
--}
|
71
entropy/nvim/lua/lsp-setup.lua
Normal file
71
entropy/nvim/lua/lsp-setup.lua
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
-- Mappings.
|
||||||
|
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
||||||
|
local opts = { noremap=true, silent=true }
|
||||||
|
vim.api.nvim_set_keymap('n', ',e', '<cmd>lua vim.diagnostic.open_float()<CR>', opts)
|
||||||
|
vim.api.nvim_set_keymap('n', 'ge', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts)
|
||||||
|
vim.api.nvim_set_keymap('n', 'gE', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts)
|
||||||
|
vim.api.nvim_set_keymap('n', ',q', '<cmd>lua vim.diagnostic.setloclist()<CR>', opts)
|
||||||
|
|
||||||
|
-- Use an on_attach function to only map the following keys
|
||||||
|
-- after the language server attaches to the current buffer
|
||||||
|
local on_attach = function(client, bufnr)
|
||||||
|
-- Enable completion triggered by <c-x><c-o>
|
||||||
|
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||||
|
|
||||||
|
-- Mappings.
|
||||||
|
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', 's', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'i', ',s', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', ',wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', ',wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', ',wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', ',D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', ',rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', ',qf', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', ',F', '<cmd>lua vim.lsp.buf.format { async = true }<CR>', opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||||
|
-- map buffer local keybindings when the language server attaches
|
||||||
|
local servers = { 'clangd', 'rust_analyzer', 'nil_ls' }
|
||||||
|
for _, lsp in pairs(servers) do
|
||||||
|
require('lspconfig')[lsp].setup {
|
||||||
|
on_attach = on_attach,
|
||||||
|
flags = {
|
||||||
|
-- This will be the default in neovim 0.7+
|
||||||
|
debounce_text_changes = 150,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
require('lspconfig').clangd.setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
cmd = {
|
||||||
|
"clangd",
|
||||||
|
--"--enable-config",
|
||||||
|
"--background-index",
|
||||||
|
"--pch-storage=memory",
|
||||||
|
"--clang-tidy",
|
||||||
|
"--all-scopes-completion",
|
||||||
|
"--completion-style=detailed",
|
||||||
|
"--pretty",
|
||||||
|
"--header-insertion=never",
|
||||||
|
--"-j=4",
|
||||||
|
"--header-insertion-decorators",
|
||||||
|
},
|
||||||
|
filetypes = {"c", "cpp", "objc", "objcpp"},
|
||||||
|
--root_dir = root_pattern("compile_commands.json", "compile_flags.txt", ".git"),
|
||||||
|
init_option = { fallbackFlags = { "-std=c++latest" } }
|
||||||
|
}
|
||||||
|
|
||||||
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
|
||||||
|
require('lspconfig').pyright.setup {
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
70
entropy/nvim/lua/plugins.lua
Normal file
70
entropy/nvim/lua/plugins.lua
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
return require('lazy').setup({
|
||||||
|
-- theme
|
||||||
|
-- use {'morhetz/gruvbox', config = function() vim.cmd.colorscheme("gruvbox") end }
|
||||||
|
{ 'luisiacc/gruvbox-baby', config = function() vim.cmd.colorscheme("gruvbox-baby") end },
|
||||||
|
-- use 'drewtempelmeyer/palenight.vim'
|
||||||
|
{ 'stevedylandev/flexoki-nvim', name = 'flexoki', enabled = false, lazy = true},
|
||||||
|
|
||||||
|
{ 'nvim-tree/nvim-web-devicons', lazy = true },
|
||||||
|
{ 'nvim-lualine/lualine.nvim', dependencies = { 'nvim-tree/nvim-web-devicons' } },
|
||||||
|
{ 'akinsho/bufferline.nvim', version = "*", dependencies = 'nvim-tree/nvim-web-devicons' },
|
||||||
|
|
||||||
|
'scrooloose/nerdcommenter',
|
||||||
|
'sbdchd/neoformat',
|
||||||
|
|
||||||
|
{ 'stevearc/oil.nvim', dependencies = 'nvim-tree/nvim-web-devicons', config = function() require('oil').setup() end },
|
||||||
|
|
||||||
|
-- fuzzy file finder
|
||||||
|
{ 'junegunn/fzf', build = function() vim.fn['fzf#install'](0) end },
|
||||||
|
'junegunn/fzf.vim',
|
||||||
|
|
||||||
|
-- utils for other plugins
|
||||||
|
{ "nvim-lua/plenary.nvim", lazy = true },
|
||||||
|
|
||||||
|
-- On-demand loading for languages
|
||||||
|
{ 'rust-lang/rust.vim', ft = "rust" },
|
||||||
|
{ 'cespare/vim-toml', ft = "toml" },
|
||||||
|
{ 'neovimhaskell/haskell-vim', ft = "haskell" },
|
||||||
|
{ 'jalvesaq/Nvim-R', branch = "stable", ft = "r" },
|
||||||
|
'rhysd/vim-llvm',
|
||||||
|
{ 'Civitasv/cmake-tools.nvim', dependencies = "nvim-lua/plenary.nvim" },
|
||||||
|
{ 'lf-lang/lingua-franca.vim' },
|
||||||
|
-- TODO: Setup omnifunc for autocomplete!
|
||||||
|
{ 'anekos/hledger-vim' },
|
||||||
|
-- use 'keith/swift.vim'
|
||||||
|
|
||||||
|
-- Post-install/update hook with neovim command
|
||||||
|
{ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' },
|
||||||
|
|
||||||
|
-- LSP plugins
|
||||||
|
'neovim/nvim-lspconfig',
|
||||||
|
'p00f/clangd_extensions.nvim',
|
||||||
|
'hrsh7th/cmp-nvim-lsp',
|
||||||
|
'hrsh7th/cmp-buffer',
|
||||||
|
'hrsh7th/cmp-path',
|
||||||
|
'hrsh7th/cmp-cmdline',
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
'hrsh7th/cmp-nvim-lsp-signature-help',
|
||||||
|
-- snippet engine
|
||||||
|
'hrsh7th/vim-vsnip',
|
||||||
|
|
||||||
|
'tpope/vim-fugitive',
|
||||||
|
'lervag/vimtex',
|
||||||
|
'editorconfig/editorconfig-vim',
|
||||||
|
'LnL7/vim-nix'
|
||||||
|
|
||||||
|
|
||||||
|
-- 'jasonccox/vim-wayland-clipboard'
|
||||||
|
-- use 'vim-syntastic/syntastic'
|
||||||
|
-- use 'vim-airline/vim-airline'
|
||||||
|
-- use 'airblade/vim-gitgutter'
|
||||||
|
-- use 'justinmk/vim-sneak'
|
||||||
|
-- use 'lervag/vimtex'
|
||||||
|
-- use 'editorconfig/editorconfig-vim'
|
||||||
|
-- use 'LnL7/vim-nix'
|
||||||
|
-- use 'xevz/vim-squirrel'
|
||||||
|
-- use 'preservim/nerdtree'
|
||||||
|
--
|
||||||
|
-- -- ale language server client
|
||||||
|
-- use 'dense-analysis/ale'
|
||||||
|
})
|
Loading…
Reference in a new issue