almost done converting init.vim to init.lua, just need to install nvim-completion

This commit is contained in:
tomit4 2022-04-23 09:44:23 -07:00
parent f371d214c1
commit e48c506796
3 changed files with 83 additions and 13 deletions

View file

@ -1,9 +1,9 @@
-- main init.lua configurations
keymap = vim.api.nvim_set_keymap
-- Nvim_Tree configuration:
-- -- setup with all defaults
-- Enable ColorScheme
vim.cmd[[colorscheme nord]]
-- Nvim_Tree configuration: -- setup with all defaults
-- each of these are documented in `:help nvim-tree.OPTION_NAME`
require'nvim-tree'.setup { -- BEGIN_DEFAULT_OPTS
auto_reload_on_write = true,
@ -118,6 +118,11 @@ require'nvim-tree'.setup { -- BEGIN_DEFAULT_OPTS
},
} -- END_DEFAULT_OPTS for Nvim_Tree
-- Lua Line color configuration
require('lualine').setup({
options = { theme = 'nord' }
})
-- Automatically closes Nvim tree if last window open
vim.cmd[[autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif]]
@ -148,6 +153,52 @@ vim.g.NERDSpaceDelims= 1
vim.g.termguicolors = true
vim.g.nosplitright = true
-- do not close the markdown preview tab when switching to other buffers
vim.g.mkdp_auto_close = 0
-- set relative number
vim.opt.number = true
vim.opt.cursorcolumn = true
-- vim.opt.cursor = true
vim.opt.mouse = 'a'
vim.opt.autoindent = true
vim.opt.smarttab = true
vim.opt.ignorecase = true
vim.opt.cindent = true
vim.opt.tabstop = 8
vim.opt.softtabstop = 0
vim.opt.shiftwidth = 4
-- always uses spaces instead of tab characters
vim.opt.expandtab = true
-- if hidden is not set, TextEdit might fail.
vim.opt.hidden = true
-- Set the height of the status line down at the bottom
vim.opt.cmdheight = 1
-- Set the amount of characters you get back from status/error messages
vim.opt.updatetime = 300
-- always show signcolumns
vim.opt.signcolumn = 'yes'
-- Fix Splitting
vim.opt.splitbelow = true
vim.opt.splitright = true
-- Vertically center document when entering Insert mode
vim.cmd[[autocmd InsertEnter * norm zz]]
-- Removes trailing spaces
vim.cmd[[function TrimWhiteSpace()
%s/\s*$//
''
endfunction]]
--Removes trailing spaces on save
vim.cmd[[autocmd FileWritePre * call TrimWhiteSpace()]]
vim.cmd[[autocmd FileAppendPre * call TrimWhiteSpace()]]
vim.cmd[[autocmd FilterWritePre * call TrimWhiteSpace()]]
vim.cmd[[autocmd BufWritePre * call TrimWhiteSpace()]]
-- Enable Comments with Italics (below selected colorscheme)
vim.cmd[[highlight Comment cterm=italic gui=italic]]
-- do not close the markdown preview tab when switching to other buffers
-- vim.g.mkdp_auto_close = 0

View file

@ -1,3 +1,6 @@
-- remap leader key
vim.g.mapleader = ","
-- remap Nvim_Tree toggle to CTRL+B
keymap('n', '<c-b>', '<c-w>:NvimTreeToggle<CR>', {})
@ -24,3 +27,16 @@ keymap('n', '<c-x>', '<c-w>:nohl<CR>', {silent = true})
-- Toggle Multi-Cursor with j or k
vim.cmd[[nmap <C-j> <C-Down>]]
vim.cmd[[nmap <C-k> <C-Up>]]
-- Escape Insert Mode with ii
keymap('i', 'ii', '<Esc>', {})
-- Insert a console.log()
vim.cmd[[ inoremap cll console.log()<esc>i]]
-- Alias replace all to shift + S
vim.cmd[[nnoremap S :%s///gI<Left><Left><Left><Left>]]
-- j/k will move virtual lines (lines that wrap)
vim.cmd[[noremap <silent> <expr> j (v:count == 0 ? 'gj' : 'j')]]
vim.cmd[[noremap <silent> <expr> k (v:count == 0 ? 'gk' : 'k')]]

View file

@ -1,23 +1,26 @@
-- Packages installed using 'packer', install using :PackerSync
-- call Plug for MarkDownPreview
-- vim.cmd[[call plug#begin('~/.vim/plugged') Plug 'iamcco/markdown-preview.nvim', {'do': { -> mkdp#util#install() }}]]
require('packer').startup(function()
use 'wbthomason/packer.nvim'
use 'kyazdani42/nvim-web-devicons' -- for file icons
use 'kyazdani42/nvim-tree.lua'
use {'nvim-lualine/lualine.nvim', requires = { 'kyazdani42/nvim-web-devicons', opt = true }}
use 'shaunsingh/nord.nvim'
use 'psliwka/vim-smoothie'
-- use 'mattn/emmet-vim'
-- use 'ap/vim-css-color'
-- use 'airblade/vim-gitgutter'
-- use 'ctrlpvim/ctrlp.vim' -- fuzzy find files
-- use 'junegunn/fzf'--{ 'do': { -> fzf#install() } }
use 'ctrlpvim/ctrlp.vim' -- fuzzy find files
-- use {'junegunn/fzf', run = ':call fzf#installo()'}--{ 'do': { -> fzf#install() } }
use 'preservim/nerdcommenter'
-- use 'Yggdroot/indentLine'
-- use 'sheerun/vim-polyglot'
use 'Yggdroot/indentLine'
use 'mg979/vim-visual-multi'-- {'branch': 'master'}
use {'iamcco/markdown-preview.nvim', run = ':call mkdp#util#install'} -- {'do': { -> mkdp#util#install() }}
use 'luochen1990/rainbow'
-- use 'simeji/winresizer'
use 'simeji/winresizer'
use '907th/vim-auto-save'
-- use 'itchyny/lightline.vim'
-- use 'jremmen/vim-ripgrep'
use 'jremmen/vim-ripgrep'
end)