feat(config): nvim
This commit is contained in:
parent
ab93bfa16d
commit
3fa491d7a4
10 changed files with 291 additions and 0 deletions
3
config/nvim/init.lua
Normal file
3
config/nvim/init.lua
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
require('options')
|
||||||
|
require('plugin')
|
||||||
|
require('colorscheme')
|
118
config/nvim/init.vim.bp
Normal file
118
config/nvim/init.vim.bp
Normal file
|
@ -0,0 +1,118 @@
|
||||||
|
set nocompatible " be iMproved, required
|
||||||
|
filetype off " required
|
||||||
|
|
||||||
|
syntax on
|
||||||
|
|
||||||
|
" set the runtime path to include Vundle and initialize
|
||||||
|
set rtp+=~/.vim/bundle/Vundle.vim
|
||||||
|
call vundle#begin()
|
||||||
|
|
||||||
|
" let Vundle manage Vundle, required
|
||||||
|
Plugin 'VundleVim/Vundle.vim'
|
||||||
|
|
||||||
|
" Plugins
|
||||||
|
Plugin 'godlygeek/tabular'
|
||||||
|
" Plugin 'preservim/vim-markdown'
|
||||||
|
Plugin 'vim-pandoc/vim-pandoc'
|
||||||
|
Plugin 'vim-pandoc/vim-pandoc-syntax'
|
||||||
|
Plugin 'WolfgangMehner/latex-support'
|
||||||
|
Plugin 'http://github.com/tpope/vim-surround' " Surrounding ysw)
|
||||||
|
Plugin 'https://github.com/preservim/nerdtree' " NerdTree
|
||||||
|
Plugin 'https://github.com/tpope/vim-commentary' " For Commenting gcc & gc
|
||||||
|
Plugin 'https://github.com/vim-airline/vim-airline' " Status bar
|
||||||
|
Plugin 'https://github.com/ap/vim-css-color' " CSS Color Preview
|
||||||
|
Plugin 'https://github.com/rafi/awesome-vim-colorschemes' " Retro Scheme
|
||||||
|
Plugin 'https://github.com/ryanoasis/vim-devicons' " Developer Icons
|
||||||
|
Plugin 'https://github.com/tc50cal/vim-terminal' " Vim Terminal
|
||||||
|
Plugin 'https://github.com/preservim/tagbar' " Tagbar for code navigation
|
||||||
|
Plugin 'https://github.com/neoclide/coc.nvim' " Autocompletions
|
||||||
|
" Plugin 'https://github.com/terryma/vim-multiple-cursors' " CTRL + N for multiple cursors
|
||||||
|
Plugin 'https://github.com/mattn/emmet-vim' " Emmet support
|
||||||
|
Plugin 'rubixninja314/vim-mcfunction' " mcfunction
|
||||||
|
" Plugin 'sirver/ultisnips'
|
||||||
|
" let g:UltiSnipsExpandTrigger = '<tab>'
|
||||||
|
" let g:UltiSnipsJumpForwardTrigger = '<tab>'
|
||||||
|
" let g:UltiSnipsJumpBackwardTrigger = '<s-tab>'
|
||||||
|
"Plugin 'lervag/vimtex'
|
||||||
|
" let g:tex_flavor='latex'
|
||||||
|
" let g:vimtex_view_method='zathura'
|
||||||
|
" let g:vimtex_quickfix_mode=0
|
||||||
|
" set conceallevel=1
|
||||||
|
" let g:tex_conceal='abdmg'
|
||||||
|
Plugin 'catppuccin/vim' " theme
|
||||||
|
Plugin 'vimpostor/vim-prism' " theme
|
||||||
|
Plugin 'elixir-editors/vim-elixir' " elixir
|
||||||
|
Plugin 'mhinz/vim-mix-format' " elixir format
|
||||||
|
Plugin 'neovim/nvim-lspconfig' " elixir language server
|
||||||
|
|
||||||
|
call vundle#end() " required
|
||||||
|
filetype plugin indent on " required
|
||||||
|
|
||||||
|
:colorscheme prism
|
||||||
|
|
||||||
|
:set number relativenumber
|
||||||
|
:set autoindent
|
||||||
|
:set tabstop=4
|
||||||
|
:set shiftwidth=4
|
||||||
|
:set smarttab
|
||||||
|
:set softtabstop=4
|
||||||
|
:set mouse=a
|
||||||
|
|
||||||
|
nnoremap <C-Left> :tabprevious<CR>
|
||||||
|
nnoremap <C-Right> :tabnext<CR>
|
||||||
|
nnoremap <C-j> :tabprevious<CR>
|
||||||
|
nnoremap <C-k> :tabnext<CR>
|
||||||
|
nnoremap <C-q> :tabclose<CR>
|
||||||
|
|
||||||
|
nnoremap <C-f> :NERDTreeFocus<CR>
|
||||||
|
nnoremap <C-n> :NERDTree<CR>
|
||||||
|
nnoremap <C-t> :NERDTreeToggle<CR>
|
||||||
|
|
||||||
|
nmap <F8> :TagbarToggle<CR>
|
||||||
|
|
||||||
|
:set completeopt-=preview " For No Previews
|
||||||
|
|
||||||
|
let g:NERDTreeDirArrowExpandable="+"
|
||||||
|
let g:NERDTreeDirArrowCollapsible="~"
|
||||||
|
|
||||||
|
let g:airline_powerline_fonts = 1
|
||||||
|
|
||||||
|
if !exists('g:airline_symbols')
|
||||||
|
let g:airline_symbols = {}
|
||||||
|
endif
|
||||||
|
|
||||||
|
" airline symbols
|
||||||
|
let g:airline_left_sep = ''
|
||||||
|
let g:airline_left_alt_sep = ''
|
||||||
|
let g:airline_right_sep = ''
|
||||||
|
let g:airline_right_alt_sep = ''
|
||||||
|
let g:airline_symbols.branch = ''
|
||||||
|
let g:airline_symbols.readonly = ''
|
||||||
|
let g:airline_symbols.linenr = ''
|
||||||
|
|
||||||
|
" Custom Commands
|
||||||
|
"" LateX
|
||||||
|
:command Ttp !pdflatex %:t
|
||||||
|
|
||||||
|
"" JS/TS/Node
|
||||||
|
:command NpmInstall !npm install
|
||||||
|
:command TscWatch !npm run ts-watch
|
||||||
|
:command NodemonStart !npm run start
|
||||||
|
|
||||||
|
"" Git
|
||||||
|
:command -nargs=1 -bar GitignoreCreate !curl https://www.toptal.com/developers/gitignore/api/<args> | tee -a .gitignore
|
||||||
|
:command -nargs=* GitCommit !git commit -m "<args>"
|
||||||
|
:command -nargs=* GitCommitAll !git commit -am "<args>"
|
||||||
|
:command GitAddAll !git add * && git add .*
|
||||||
|
:command GitStatus !git status
|
||||||
|
:command GitPush !git push
|
||||||
|
|
||||||
|
inoremap <expr> <Tab> pumvisible() ? coc#_select_confirm() : "<Tab>"
|
||||||
|
|
||||||
|
set shell=/bin/bash
|
||||||
|
|
||||||
|
" Highlight
|
||||||
|
augroup twig_ft
|
||||||
|
au!
|
||||||
|
autocmd BufNewFile,BufRead *.mcfunction set syntax=mcfunction
|
||||||
|
augroup END
|
11
config/nvim/lazy-lock.json
Normal file
11
config/nvim/lazy-lock.json
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" },
|
||||||
|
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||||
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "7f0bf635082bb9b7d2b37766054526a6ccafdb85" },
|
||||||
|
"mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" },
|
||||||
|
"monokai.nvim": { "branch": "master", "commit": "b8bd44d5796503173627d7a1fc51f77ec3a08a63" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "f0c6ccf43997a1c7e9ec4aea36ffbf2ddd9f15ef" },
|
||||||
|
"vim-elixir": { "branch": "master", "commit": "6dff29176eb35e025bc94b262bf6d4e517e11f7d" },
|
||||||
|
"vim-mix-format": { "branch": "master", "commit": "01a31ef82aa52697d589574da50723980eeae456" }
|
||||||
|
}
|
7
config/nvim/lua/colorscheme.lua
Normal file
7
config/nvim/lua/colorscheme.lua
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
local colorscheme = 'monokai_pro'
|
||||||
|
|
||||||
|
local is_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
|
||||||
|
if not is_ok then
|
||||||
|
vim.notify('colorscheme ' .. colorscheme .. ' not found!')
|
||||||
|
return
|
||||||
|
end
|
22
config/nvim/lua/options.lua
Normal file
22
config/nvim/lua/options.lua
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
vim.opt.completeopt = {'menu', 'menuone', 'noselect'}
|
||||||
|
|
||||||
|
vim.opt.tabstop = 4 -- number of visual spaces per TAB
|
||||||
|
vim.opt.softtabstop = 4 -- number of spacesin tab when editing
|
||||||
|
vim.opt.shiftwidth = 4 -- insert 4 spaces on a tab
|
||||||
|
vim.opt.expandtab = true -- tabs are spaces, mainly because of python
|
||||||
|
|
||||||
|
vim.opt.number = true -- show absolute number
|
||||||
|
vim.opt.relativenumber = true -- add numbers to each line on the left side
|
||||||
|
vim.opt.cursorline = true -- highlight cursor line underneath the cursor horizontally
|
||||||
|
vim.opt.splitbelow = true -- open new vertical split bottom
|
||||||
|
vim.opt.splitright = true -- open new horizontal splits right
|
||||||
|
|
||||||
|
vim.opt.incsearch = true -- search as characters are entered
|
||||||
|
vim.opt.ignorecase = true -- ignore case in searches by default
|
||||||
|
vim.opt.smartcase = true -- but make it case sensitive if an uppercase is entered
|
||||||
|
|
||||||
|
vim.filetype.add({
|
||||||
|
extension = {
|
||||||
|
heex = 'eelixir'
|
||||||
|
}
|
||||||
|
})
|
18
config/nvim/lua/plugin.lua
Normal file
18
config/nvim/lua/plugin.lua
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not (vim.uv or 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)
|
||||||
|
|
||||||
|
-- This is also a good place to setup other settings (vim.opt)
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = "\\"
|
||||||
|
|
||||||
|
require("lazy").setup("plugins")
|
84
config/nvim/lua/plugins/blink.lua
Normal file
84
config/nvim/lua/plugins/blink.lua
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"saghen/blink.cmp",
|
||||||
|
-- optional: provides snippets for the snippet source
|
||||||
|
dependencies = { "rafamadriz/friendly-snippets" },
|
||||||
|
|
||||||
|
-- Use a release tag to download pre-built binaries
|
||||||
|
version = "*",
|
||||||
|
-- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
|
||||||
|
-- build = 'cargo build --release',
|
||||||
|
-- If you use nix, you can build from source using the latest nightly rust with:
|
||||||
|
-- build = 'nix run .#build-plugin',
|
||||||
|
|
||||||
|
opts = {
|
||||||
|
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
|
||||||
|
-- 'super-tab' for mappings similar to VSCode (tab to accept)
|
||||||
|
-- 'enter' for enter to accept
|
||||||
|
-- 'none' for no mappings
|
||||||
|
--
|
||||||
|
-- All presets have the following mappings:
|
||||||
|
-- C-space: Open menu or open docs if already open
|
||||||
|
-- C-n/C-p or Up/Down: Select next/previous item
|
||||||
|
-- C-e: Hide menu
|
||||||
|
-- C-k: Toggle signature help (if signature.enabled = true)
|
||||||
|
--
|
||||||
|
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||||
|
keymap = {
|
||||||
|
-- Each keymap may be a list of commands and/or functions
|
||||||
|
preset = "enter",
|
||||||
|
-- Select completions
|
||||||
|
["<Up>"] = { "select_prev", "fallback" },
|
||||||
|
["<Down>"] = { "select_next", "fallback" },
|
||||||
|
["<Tab>"] = { "select_next", "fallback" },
|
||||||
|
["<S-Tab>"] = { "select_prev", "fallback" },
|
||||||
|
-- Scroll documentation
|
||||||
|
["<C-b>"] = { "scroll_documentation_up", "fallback" },
|
||||||
|
["<C-f>"] = { "scroll_documentation_down", "fallback" },
|
||||||
|
-- Show/hide signature
|
||||||
|
["<C-k>"] = { "show_signature", "hide_signature", "fallback" },
|
||||||
|
},
|
||||||
|
|
||||||
|
appearance = {
|
||||||
|
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||||
|
-- Adjusts spacing to ensure icons are aligned
|
||||||
|
nerd_font_variant = "mono",
|
||||||
|
},
|
||||||
|
|
||||||
|
sources = {
|
||||||
|
-- `lsp`, `buffer`, `snippets`, `path`, and `omni` are built-in
|
||||||
|
-- so you don't need to define them in `sources.providers`
|
||||||
|
default = { "lsp", "path", "snippets", "buffer" },
|
||||||
|
|
||||||
|
-- Sources are configured via the sources.providers table
|
||||||
|
},
|
||||||
|
|
||||||
|
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||||
|
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
|
||||||
|
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||||
|
--
|
||||||
|
-- See the fuzzy documentation for more information
|
||||||
|
fuzzy = { implementation = "prefer_rust_with_warning" },
|
||||||
|
completion = {
|
||||||
|
-- The keyword should only match against the text before
|
||||||
|
keyword = { range = "prefix" },
|
||||||
|
menu = {
|
||||||
|
-- Use treesitter to highlight the label text for the given list of sources
|
||||||
|
draw = {
|
||||||
|
treesitter = { "lsp" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- Show completions after typing a trigger character, defined by the source
|
||||||
|
trigger = { show_on_trigger_character = true },
|
||||||
|
documentation = {
|
||||||
|
-- Show documentation automatically
|
||||||
|
auto_show = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Signature help when tying
|
||||||
|
signature = { enabled = true },
|
||||||
|
},
|
||||||
|
opts_extend = { "sources.default" },
|
||||||
|
}
|
||||||
|
}
|
3
config/nvim/lua/plugins/colorscheme.lua
Normal file
3
config/nvim/lua/plugins/colorscheme.lua
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
return {
|
||||||
|
"tanvirtin/monokai.nvim"
|
||||||
|
}
|
4
config/nvim/lua/plugins/elixir.lua
Normal file
4
config/nvim/lua/plugins/elixir.lua
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
return {
|
||||||
|
"elixir-editors/vim-elixir",
|
||||||
|
"mhinz/vim-mix-format"
|
||||||
|
}
|
21
config/nvim/lua/plugins/lsp.lua
Normal file
21
config/nvim/lua/plugins/lsp.lua
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
config = function()
|
||||||
|
local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
|
lspconfig.pylsp.setup({})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{ "mason-org/mason.nvim", opts = {} },
|
||||||
|
{
|
||||||
|
"mason-org/mason-lspconfig.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"mason-org/mason.nvim",
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
ensure_installed = { "pylsp", "elixirls" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue