add neovim config

This commit is contained in:
joelchrono12 2024-02-16 18:49:25 -06:00
parent d0cb66a72e
commit 254b42d5d9
Signed by: chrono
GPG Key ID: E23D9C7FA57497A6
24 changed files with 148 additions and 28 deletions

View File

@ -22,7 +22,7 @@
" Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
"
" " On-demand loading
" Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
" Plug 'preservim/nerdtree', { 'on': 'NERDTreeToggle' }
" Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
"
" " Using a non-default branch

View File

@ -242,6 +242,8 @@ function! plug#begin(...)
let home = s:path(s:plug_fnamemodify(s:plug_expand(a:1), ':p'))
elseif exists('g:plug_home')
let home = s:path(g:plug_home)
elseif has('nvim')
let home = stdpath('data') . '/plugged'
elseif !empty(&rtp)
let home = s:path(split(&rtp, ',')[0]) . '/plugged'
else
@ -350,7 +352,7 @@ function! plug#end()
endif
let lod = { 'ft': {}, 'map': {}, 'cmd': {} }
if exists('g:did_load_filetypes')
if get(g:, 'did_load_filetypes', 0)
filetype off
endif
for name in g:plugs_order
@ -405,7 +407,7 @@ function! plug#end()
for [map, names] in items(lod.map)
for [mode, map_prefix, key_prefix] in
\ [['i', '<C-O>', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']]
\ [['i', '<C-\><C-O>', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']]
execute printf(
\ '%snoremap <silent> %s %s:<C-U>call <SID>lod_map(%s, %s, %s, "%s")<CR>',
\ mode, map, map_prefix, string(map), string(names), mode != 'i', key_prefix)
@ -2619,26 +2621,34 @@ function! s:preview_commit()
let sha = matchstr(getline('.'), '^ \X*\zs[0-9a-f]\{7,9}')
if empty(sha)
return
let name = matchstr(getline('.'), '^- \zs[^:]*\ze:$')
if empty(name)
return
endif
let title = 'HEAD@{1}..'
let command = 'git diff --no-color HEAD@{1}'
else
let title = sha
let command = 'git show --no-color --pretty=medium '.sha
let name = s:find_name(line('.'))
endif
let name = s:find_name(line('.'))
if empty(name) || !has_key(g:plugs, name) || !isdirectory(g:plugs[name].dir)
return
endif
if exists('g:plug_pwindow') && !s:is_preview_window_open()
execute g:plug_pwindow
execute 'e' sha
execute 'e' title
else
execute 'pedit' sha
execute 'pedit' title
wincmd P
endif
setlocal previewwindow filetype=git buftype=nofile nobuflisted modifiable
setlocal previewwindow filetype=git buftype=nofile bufhidden=wipe nobuflisted modifiable
let batchfile = ''
try
let [sh, shellcmdflag, shrd] = s:chsh(1)
let cmd = 'cd '.plug#shellescape(g:plugs[name].dir).' && git show --no-color --pretty=medium '.sha
let cmd = 'cd '.plug#shellescape(g:plugs[name].dir).' && '.command
if s:is_win
let [batchfile, cmd] = s:batchfile(cmd)
endif
@ -2764,9 +2774,9 @@ function! s:snapshot(force, ...) abort
1
let anchor = line('$') - 3
let names = sort(keys(filter(copy(g:plugs),
\'has_key(v:val, "uri") && !has_key(v:val, "commit") && isdirectory(v:val.dir)')))
\'has_key(v:val, "uri") && isdirectory(v:val.dir)')))
for name in reverse(names)
let sha = s:git_revision(g:plugs[name].dir)
let sha = has_key(g:plugs[name], 'commit') ? g:plugs[name].commit : s:git_revision(g:plugs[name].dir)
if !empty(sha)
call append(anchor, printf("silent! let g:plugs['%s'].commit = '%s'", name, sha))
redraw

@ -1 +1 @@
Subproject commit fc85a6f07c2cd694be93496ffad75be126240068
Subproject commit aa29fbe481a4603e92240e6b0622aca97348532b

@ -1 +1 @@
Subproject commit 24347d43c066fb8e60206c4be3fa6432fa7d3e8a
Subproject commit 7b9e1ef0a1399907c51d23b6080b94a5aba4a654

@ -1 +1 @@
Subproject commit 0c40bb889262bd275d15de62f2a719c2bccd004b
Subproject commit 323b7c31c617b153d12095e9fd9648f2fda2b646

@ -0,0 +1 @@
Subproject commit 95cb75e21d11206dad4bd3895c99459bdaa13dd1

@ -1 +1 @@
Subproject commit 7f5d35a65510083ea5c2d0941797244b9963d4a9
Subproject commit fa0263d456dd43f5926484d1c4c7022dfcb21ba9

@ -1 +1 @@
Subproject commit 2b5b1f777f0583ffb39086d6c16f39e6e37459c0
Subproject commit e1f033164931797a67b68089995c8078415f9d7d

@ -0,0 +1 @@
Subproject commit 1c6b455c0445b8bc1c4c16ba569a43c6348411cc

@ -1 +1 @@
Subproject commit 98cc4a2d64ca67cccbf5b5cf47c682ebadaaff58
Subproject commit e361a44230860d616f799a337bc58f5218ab6e9c

@ -1 +1 @@
Subproject commit 0748955e9e8d9770b44f2bec8456189430b37d9d
Subproject commit f13f5dfbb784deddbc1d8195f34dfd9ec73e2295

@ -1 +1 @@
Subproject commit b6b5ffe31a195a3077338d7a506b905e4a51590f
Subproject commit 57b77747694ea5676c3ca0eeaf9567dc499730c0

@ -0,0 +1 @@
Subproject commit f247ee700b569ed43f39320413a13ba9b0aef0db

@ -1 +0,0 @@
Subproject commit 91b67e3ca2d7bc66544724f9c702265c564a1f2e

@ -1 +0,0 @@
Subproject commit 97cf3e6e638f936187d5f6e9b5eb1bdf0a4df256

@ -1 +1 @@
Subproject commit 49cc58573e746d02024110d9af99e95994ea4b72
Subproject commit 59659093581aad2afacedc81f009ed6a4bfad275

@ -1 +1 @@
Subproject commit 0550762a69a2ef13d9f723c9478155dbc6ad7ddb
Subproject commit e2e7ad7cb03049896bafda28481f252a2aa8d5bb

@ -1 +1 @@
Subproject commit d1cde72d9ba5b8e811df7bb28b2606685453f375
Subproject commit d748a46be5195256f6b2c767ef32de87b05ae8f7

@ -1 +1 @@
Subproject commit 526cffde2cb013ae337cdf48e244bb15881ab7ce
Subproject commit 5d0a7462871c8465b735f0954d19217e37144c68

@ -1 +0,0 @@
Subproject commit ec87af6b69387abb3c4449ce8c4040d2d00d745e

@ -1 +1 @@
Subproject commit 9555a3e6e5bcf285ec181b7fc983eea90500feb4
Subproject commit 4ff8de2ac93431ee6d85a9e04177012752e6abdc

View File

@ -0,0 +1,99 @@
--" Call all plugins from a different file script.
source $HOME/.config/nvim/vim-plug/plugins.vim
--"syntax on
--"set encoding=utf-8
--"set tabstop=4 softtabstop=4
--"set shiftwidth=4
--"set expandtab
vim.opt.guicursor=
vim.optnowrap
vim.opt.nohlsearch
vim.opt.scrolloff=10
vim.opt.mouse=a
vim.opt.number relativenumber
vim.opt.colorcolumn=80
vim.opt.signcolumn=yes
vim.opt.smartcase
vim.opt.incsearch
--" Example config in VimScript
--"let g:tokyonight_style = "night"
--"let g:tokyonight_italic_functions = 1
--"let g:tokyonight_sidebars = [ "qf", "vista_kind", "terminal", "packer" ]
--"" Change the "hint" color to the "orange" color, and make the "error" color bright red
--"let g:tokyonight_colors = {
--"\ 'hint': 'orange',
--"\ 'error': '#ff0000'
--"\ }
colorscheme tokyonight-night
let g:lightline = {
\ 'colorscheme': 'tokyonight',
\ }
--"highlight ColorColumn ctermbg=blue guibg=lightgrey
highlight Comment cterm=italic gui=italic
highlight htmlBold gui=bold guifg=#af0000 ctermfg=green
highlight htmlItalic gui=italic guifg=#ff8700 ctermfg=blue
--" support front matter of various format
let g:vim_markdown_frontmatter = 1 " for YAML format
let g:vim_markdown_toml_frontmatter = 1 " for TOML format
let g:vim_markdown_json_frontmatter = 1 " for JSON format
let mapleader = " "
--"noremap j h
--"noremap k j
--"noremap l k
--"noremap ñ l
--"noremap k gj
--"noremap l gk
set nocompatible
if has("autocmd")
filetype plugin indent on
endif
nmap <C-n> :NERDTreeToggle<CR>
nmap <C-t> :wrap
vmap <C-k> <plug>NERDCommenterToggle
nmap <C-k> <plug>NERDCommenterToggle
--" Spellchecking and switch to spanish
map <F6> :setlocal spell! spelllang=es<CR>
map <F7> :set spelllang=es <CR>
--" Turn on Goyo for readibility and writing
nmap <F10> :Goyo <CR>
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
--" Map control - backspace to delete work in insert mode
inoremap <C-w> <C-\><C-o>dB
inoremap <C-BS> <C-\><C-o>db
--"Remember to install xclip or something
vnoremap <C-c> "+y
vnoremap <C-S-v> "+P
--"Markdown configuration
augroup MarkdownConfiguration
autocmd BufNewFile,BufRead *.md set linebreak breakindent wrap
autocmd BufNewFile,BufRead *.md nnoremap j gj
autocmd BufNewFile,BufRead *.md nnoremap k gk
--"autocmd BufNewFile,BufRead *.md Goyo
augroup END
nmap <leader>gh :diffget //3<CR>
nmap <leader>gu :diffget //2<CR>
nmap <leader>gs :G<CR>
--" GoTo code navigation.
--"nmap <silent> gd <Plug>(coc-definition)
--"nmap <silent> gy <Plug>(coc-type-definition)
--"nmap <silent> gi <Plug>(coc-implementation)
--"nmap <silent> gr <Plug>(coc-references)

View File

@ -69,13 +69,16 @@ nmap <F10> :Goyo <CR>
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
" Map control - backspace to delete work in insert mode
inoremap <C-w> <C-\><C-o>dB
inoremap <C-BS> <C-\><C-o>db
"Remember to install xclip or something
vnoremap <C-c> "+y
vnoremap <C-S-v> "+P
"Markdown configuration
augroup MarkdownConfiguration
autocmd BufNewFile,BufRead *.md set linebreak breakindent wrap
@ -89,6 +92,14 @@ nmap <leader>gh :diffget //3<CR>
nmap <leader>gu :diffget //2<CR>
nmap <leader>gs :G<CR>
" Create a Markdown-link structure for the current word or visual selection with
" leader 3. Paste in the URL later. Or use leader 4 to insert the current
" system clipboard as an URL.
nnoremap <Leader>3 ciw[<C-r>"]()<Esc>
vnoremap <Leader>3 c[<C-r>"]()<Esc>
nnoremap <Leader>4 ciw[<C-r>"](<Esc>"*pli)<Esc>
vnoremap <Leader>4 c[<C-r>"](<Esc>"*pli)<Esc>
" GoTo code navigation.
"nmap <silent> gd <Plug>(coc-definition)
"nmap <silent> gy <Plug>(coc-type-definition)

View File

@ -38,7 +38,7 @@ call plug#begin('~/.config/nvim/autoload/plugged')
Plug 'scrooloose/nerdcommenter'
"Starting to learn go
Plug 'fatih/vim-go'
Plug 'masukomi/vim-markdown-folding'
"Plug 'masukomi/vim-markdown-folding'
"Plug 'vim-airline/vim-airline'
"Plug 'vim-airline/vim-airline-themes'
Plug 'editorconfig/editorconfig-vim'