Switch some stuff neovim stuff to a lua script

Still haven't figured out a grip of other things though..
This commit is contained in:
Aaron Bieber 2021-08-08 08:12:30 -06:00
parent ad26a74370
commit 321dd1502e
3 changed files with 74 additions and 35 deletions

View File

@ -1,24 +1,11 @@
call plug#begin('~/.vim/plugged')
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
Plug 'LnL7/vim-nix'
Plug 'airblade/vim-gitgutter'
Plug 'fatih/vim-go'
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
Plug 'w0rp/ale'
Plug 'ziglang/zig.vim'
Plug 'leafgarland/typescript-vim'
Plug 'vim-ruby/vim-ruby'
Plug 'prabirshrestha/async.vim' " Needed for vim-lsp
Plug 'prabirshrestha/vim-lsp' " Language server protocol support
call plug#end()
nmap <Leader>bi :PlugInstall<CR>
nmap <Leader>bu :PlugUpdate<CR>
nmap <Leader>bc :PlugClean<CR>
nmap <Leader>bi :PaqInstall<CR>
nmap <Leader>bu :PaqUpdate<CR>
nmap <Leader>bc :PaqClean<CR>
noremap <silent> <Leader>g :GitGutterBufferToggle<CR>
" Open files in horizontal split
@ -35,21 +22,6 @@ command! -bang -nargs=? -complete=dir Files
\ call fzf#vim#files(<q-args>, {'options': ['--no-color']}, <bang>0)
nmap <C-p> :Files<cr>
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
set encoding=utf8
set t_Co=256
syntax off
set nocp
filetype plugin indent on
set completeopt=longest,menuone
au BufNewFile,BufRead *.html set tabstop=4 softtabstop=0 expandtab shiftwidth=2 smarttab
au BufNewFile,BufRead *.js set tabstop=4 softtabstop=0 expandtab shiftwidth=2 smarttab
au BufNewFile,BufRead *.lua set tabstop=4 softtabstop=0 expandtab shiftwidth=2 smarttab
au BufNewFile,BufRead *.rb set tabstop=4 softtabstop=0 expandtab shiftwidth=2 smarttab
au BufNewFile,BufRead *.yml set tabstop=4 softtabstop=0 expandtab shiftwidth=2 smarttab
highlight OverLength ctermfg=red
match OverLength /\%79v.\+/

52
.config/nvim/init.lua Normal file
View File

@ -0,0 +1,52 @@
local execute = vim.api.nvim_command
local fn = vim.fn
local map = vim.api.nvim_set_keymap
local o = vim.o
local install_path = fn.stdpath('data')..'/site/pack/paqs/start/paq-nvim/'
if fn.empty(fn.glob(install_path)) > 0 then
print('Installing paq...')
fn.system({'git', 'clone', '--depth=1', 'https://github.com/savq/paq-nvim.git', install_path})
print('paq installed to ' .. install_path)
execute 'packadd paq-nvim'
end
require("paq") {
"savq/paq-nvim";
"LnL7/vim-nix";
"airblade/vim-gitgutter";
"fatih/vim-go";
"junegunn/fzf";
"junegunn/fzf.vim";
"neovim/nvim-lspconfig";
"ziglang/zig.vim";
"hrsh7th/nvim-compe";
}
require("compe").setup {
enabled = true;
autocomplete = true;
source = {
path = true;
buffer = true;
calc = true;
nvim_lsp = true;
nvim_lua = true;
vsnip = true;
ultisnips = true;
luasnip = true;
};
}
local lspc = require("lspconfig")
lspc.gopls.setup {};
vim.cmd("syntax off");
vim.cmd("source ~/.config/nvim/dumb.vim");
o.hlsearch = true;
vim.api.nvim_set_keymap("i", "<CR>", "compe#confirm({ 'keys': '<CR>', 'select': v:true })", { expr = true })

15
.config/nvim/old.vim Normal file
View File

@ -0,0 +1,15 @@
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
set encoding=utf8
set t_Co=256
syntax off
set nocp
filetype plugin indent on
set completeopt=longest,menuone
au BufNewFile,BufRead *.html set tabstop=4 softtabstop=0 expandtab shiftwidth=2 smarttab
au BufNewFile,BufRead *.js set tabstop=4 softtabstop=0 expandtab shiftwidth=2 smarttab
au BufNewFile,BufRead *.lua set tabstop=4 softtabstop=0 expandtab shiftwidth=2 smarttab
au BufNewFile,BufRead *.rb set tabstop=4 softtabstop=0 expandtab shiftwidth=2 smarttab
au BufNewFile,BufRead *.yml set tabstop=4 softtabstop=0 expandtab shiftwidth=2 smarttab