Add neoformatter and format lua files
This commit is contained in:
parent
2e004f2295
commit
b9d1194133
6 changed files with 35 additions and 38 deletions
|
@ -1,5 +1,6 @@
|
||||||
local map = function(type, key, value)
|
local map = function(type, key, value)
|
||||||
vim.fn.nvim_buf_set_keymap(0, type, key, value, {noremap = true, silent = true})
|
vim.fn.nvim_buf_set_keymap(0, type, key, value,
|
||||||
|
{noremap = true, silent = true})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Open/close nerdtree
|
-- Open/close nerdtree
|
||||||
|
|
|
@ -2,48 +2,50 @@ local fn = vim.fn
|
||||||
local cmd = vim.cmd
|
local cmd = vim.cmd
|
||||||
|
|
||||||
-- Install packer if it's not yet installed
|
-- Install packer if it's not yet installed
|
||||||
local install_path = fn.stdpath('data')..'/site/pack/packer/opt/packer.nvim'
|
local install_path = fn.stdpath('data') .. '/site/pack/packer/opt/packer.nvim'
|
||||||
local packer_not_installed = fn.empty(fn.glob(install_path))
|
local packer_not_installed = fn.empty(fn.glob(install_path))
|
||||||
|
|
||||||
if packer_not_installed > 0 then
|
if packer_not_installed > 0 then
|
||||||
print('Packer is not installed, cloning it now...')
|
print('Packer is not installed, cloning it now...')
|
||||||
cmd ('silent !git clone https://github.com/wbthomason/packer.nvim ' .. install_path)
|
cmd('silent !git clone https://github.com/wbthomason/packer.nvim ' ..
|
||||||
|
install_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Configure packer
|
-- Configure packer
|
||||||
cmd 'packadd packer.nvim'
|
cmd 'packadd packer.nvim'
|
||||||
require('packer').startup(function()
|
require('packer').startup(function()
|
||||||
|
|
||||||
-- The plugin manager itself
|
-- The plugin manager itself
|
||||||
use {'wbthomason/packer.nvim', opt = true}
|
use {'wbthomason/packer.nvim', opt = true}
|
||||||
|
|
||||||
-- Colorscheme
|
-- Colorscheme
|
||||||
use 'joshdick/onedark.vim'
|
use 'joshdick/onedark.vim'
|
||||||
|
|
||||||
-- Custom status and tabline
|
-- Custom status and tabline
|
||||||
use 'vim-airline/vim-airline'
|
use 'vim-airline/vim-airline'
|
||||||
|
|
||||||
-- Tree explorer
|
-- Tree explorer
|
||||||
use 'scrooloose/nerdtree'
|
use 'scrooloose/nerdtree'
|
||||||
|
|
||||||
-- Fuzzy finder
|
-- Fuzzy finder
|
||||||
use 'junegunn/fzf'
|
use 'junegunn/fzf'
|
||||||
use 'junegunn/fzf.vim'
|
use 'junegunn/fzf.vim'
|
||||||
|
|
||||||
-- Do stuff as sudo
|
-- Do stuff as sudo
|
||||||
use 'lambdalisue/suda.vim'
|
use 'lambdalisue/suda.vim'
|
||||||
|
|
||||||
-- Configs for built-in LSP
|
-- Configs for built-in LSP
|
||||||
use 'neovim/nvim-lspconfig'
|
use 'neovim/nvim-lspconfig'
|
||||||
|
|
||||||
-- Completion framework
|
-- Completion framework
|
||||||
use 'nvim-lua/completion-nvim'
|
use 'nvim-lua/completion-nvim'
|
||||||
|
|
||||||
-- Treesitter syntax highlight
|
-- Treesitter syntax highlight
|
||||||
use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' }
|
use {'nvim-treesitter/nvim-treesitter', run = ':TSUpdate'}
|
||||||
|
|
||||||
|
-- Formatter plugin
|
||||||
|
use 'sbdchd/neoformat'
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Install plugins if packer was not installed
|
-- Install plugins if packer was not installed
|
||||||
if packer_not_installed > 0 then
|
if packer_not_installed > 0 then cmd 'PackerInstall' end
|
||||||
cmd 'PackerInstall'
|
|
||||||
end
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ local o = vim.o
|
||||||
|
|
||||||
o.showmode = false
|
o.showmode = false
|
||||||
o.laststatus = 2
|
o.laststatus = 2
|
||||||
g["airline#extensions#tabline#enabled"]= 1
|
g["airline#extensions#tabline#enabled"] = 1
|
||||||
g.airline_powerline_fonts = 1
|
g.airline_powerline_fonts = 1
|
||||||
g.airline_section_warning = ''
|
g.airline_section_warning = ''
|
||||||
g.airline_section_error = ''
|
g.airline_section_error = ''
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
local cmd = vim.cmd
|
local cmd = vim.cmd
|
||||||
|
|
||||||
require 'lspconfig'.rust_analyzer.setup{}
|
require'lspconfig'.rust_analyzer.setup {}
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
require'nvim-treesitter.configs'.setup {
|
require'nvim-treesitter.configs'.setup {
|
||||||
ensure_installed = 'maintained',
|
ensure_installed = 'maintained',
|
||||||
highlight = {
|
highlight = {enable = true},
|
||||||
enable = true
|
indent = {enable = true},
|
||||||
},
|
incremental_selection = {enable = true}
|
||||||
indent = {
|
|
||||||
enable = true
|
|
||||||
},
|
|
||||||
incremental_selection = {
|
|
||||||
enable = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue