diff --git a/.gitignore b/.gitignore index fac7a65..408ac6d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ sub/zsh/zshrc.d/* sub/vim/tmp/ sub/nvim/plugin +sub/nvim/tmp/ diff --git a/Makefile b/Makefile index c14bbbf..eca5564 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ nvim: ln -s $(PWD)/sub/nvim ~/.config/nvim ln -s $(PWD)/functions/vim_askpass_helper ~/.local/bin git clone --depth 1 https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim - nvim +PackerCompile +PackerClean +PackerInstall +PackerUpdate +qall + nvim +PackerCompile +PackerClean +PackerInstall +PackerUpdate +PackerUpdate +qall ssh: cat $(PWD)/sub/ssh/config >> ~/.ssh/config diff --git a/sub/nvim/after/plugin/colorscheme.lua b/sub/nvim/after/plugin/colorscheme.lua index 10fccee..4b64ef0 100644 --- a/sub/nvim/after/plugin/colorscheme.lua +++ b/sub/nvim/after/plugin/colorscheme.lua @@ -1,3 +1,5 @@ +local status, autosave = pcall(require, "gruvbox") +if (not status) then return end vim.api.nvim_exec('colorscheme gruvbox', true) diff --git a/sub/nvim/after/plugin/rainbow.lua b/sub/nvim/after/plugin/rainbow.lua index e7d2027..0994efc 100644 --- a/sub/nvim/after/plugin/rainbow.lua +++ b/sub/nvim/after/plugin/rainbow.lua @@ -1,10 +1,13 @@ +if (packer_plugins["vim-rainbow"] and packer_plugins["vim-rainbow"].loaded) then + return +end vim.api.nvim_exec([[ let g:rainbow_active = 1 ]], true) vim.api.nvim_create_autocmd('FileType', - { - pattern = {"*"}, - command = 'RainbowToggle' - }) + { + pattern = {"*"}, + command = 'RainbowToggle' + }) diff --git a/sub/nvim/lua/base/base.lua b/sub/nvim/lua/base/base.lua index e4a9d75..1a682af 100644 --- a/sub/nvim/lua/base/base.lua +++ b/sub/nvim/lua/base/base.lua @@ -47,22 +47,24 @@ vim.opt.swapfile = false vim.opt.undofile = true vim.opt.history = 1000 vim.opt.undoreload = 1000 -vim.opt.backupdir = '~/.vim/tmp/backup/' -vim.opt.undodir = '~/.vim/tmp/undo/' -vim.opt.directory = '~/.vim/tmp/swap/' + +local prefix = vim.env.XDG_CONFIG_HOME or vim.fn.expand("~/.config") + +vim.opt.undodir = { prefix .. "/nvim/tmp/.undo//"} +vim.opt.backupdir = {prefix .. "/nvim/tmp/.backup//"} +vim.opt.directory = { prefix .. "/nvim/tmp/.swp//"} vim.api.nvim_exec([[ -function! MakeDirIfNoExists(path) - if !isdirectory(expand(a:path)) - call mkdir(expand(a:path), "p") - endif -endfunction + function! MakeDirIfNoExists(path) + if !isdirectory(expand(a:path)) + call mkdir(expand(a:path), "p") + endif + endfunction - -" make this dirs if no exists previously -silent! call MakeDirIfNoExists(&undodir) -silent! call MakeDirIfNoExists(&backupdir) -silent! call MakeDirIfNoExists(&directory) + " make this dirs if no exists previously + silent! call MakeDirIfNoExists(&undodir) + silent! call MakeDirIfNoExists(&backupdir) + silent! call MakeDirIfNoExists(&directory) ]], true) vim.opt.ffs = 'unix,mac' diff --git a/sub/nvim/lua/base/plugins.lua b/sub/nvim/lua/base/plugins.lua index 4948373..033394f 100644 --- a/sub/nvim/lua/base/plugins.lua +++ b/sub/nvim/lua/base/plugins.lua @@ -9,7 +9,7 @@ return require('packer').startup(function(use) requires = { 'kyazdani42/nvim-web-devicons', opt = true } } - use 'morhetz/gruvbox' + use 'ellisonleao/gruvbox.nvim' use 'tpope/vim-surround' use 'tpope/vim-commentary' use 'ap/vim-css-color' @@ -35,7 +35,7 @@ return require('packer').startup(function(use) use { 'nvim-telescope/telescope.nvim', - requires = { 'nvim-telescope/telescope-fzf-native.nvim', run = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build', opt = false } + requires = { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make', opt = false } } use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' }