[WIP] CentOS9 support for tacker installer
CentOS/RHEL/Rocky Linux 9 have been added instead of 8 to the supported Linux distros in devstack[1]. So, support CentOS9 for the installer. [1] https://docs.openstack.org/devstack/latest/ Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com> Change-Id: I2edcbc2ebe48a6ca4b3f6e69bc36b4253c41205b
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
---
|
||||
- name: put yum repo for k8s
|
||||
become: yes
|
||||
template: src=templates/kubernetes.repo.j2
|
||||
dest=/etc/yum.repos.d/kubernetes.repo
|
||||
mode=755
|
||||
|
||||
- name: install k8s
|
||||
become: yes
|
||||
dnf: name=kubeadm update_cache=yes
|
||||
@@ -1,21 +0,0 @@
|
||||
---
|
||||
- include: basic_pkgs.yml
|
||||
- include: set_path_env.yml
|
||||
- include: git_config.yml
|
||||
|
||||
- include: python3_specific_vers.yml
|
||||
|
||||
- include: vim_extra_plugins.yml
|
||||
when: use_vim_extra_plugins == true
|
||||
|
||||
- include: kubernetes.yml
|
||||
|
||||
- include: ovn.yml
|
||||
|
||||
- include: devstack.yml
|
||||
|
||||
- include: setup_tacker.yml
|
||||
when: use_tacker == true
|
||||
|
||||
- include: extra_tools.yml
|
||||
when: use_extra_tools == true
|
||||
@@ -1,7 +0,0 @@
|
||||
[kubernetes]
|
||||
name=Kubernetes
|
||||
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
repo_gpgcheck=1
|
||||
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
- name: install basic packages
|
||||
become: yes
|
||||
yum: name={{ item }} update_cache=yes
|
||||
dnf: name={{ item }} update_cache=yes
|
||||
with_items:
|
||||
- python3
|
||||
- python3-devel
|
||||
@@ -0,0 +1,23 @@
|
||||
- name: deactivate gpgcheck
|
||||
become: yes
|
||||
lineinfile:
|
||||
path: /etc/yum.conf
|
||||
regexp: '^gpgcheck='
|
||||
line: 'gpgcheck=0'
|
||||
|
||||
- name: activate PATH for sudo
|
||||
become: yes
|
||||
lineinfile:
|
||||
path: /etc/sudoers
|
||||
state: present
|
||||
insertbefore: '^Defaults\s+secure_path ='
|
||||
line: 'Defaults env_keep += PATH'
|
||||
|
||||
- name: deactivate secure_path for sudo
|
||||
become: yes
|
||||
lineinfile:
|
||||
path: /etc/sudoers
|
||||
state: present
|
||||
backrefs: yes
|
||||
regexp: '(^Defaults\s+secure_path = .*$)'
|
||||
line: '#\1'
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
- name: install extra packages
|
||||
become: yes
|
||||
yum: name={{ item }}
|
||||
dnf: name={{ item }}
|
||||
with_items:
|
||||
- jq
|
||||
- lnav
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
- name: put yum repo for k8s
|
||||
become: yes
|
||||
template: src=templates/kubernetes.repo.j2
|
||||
dest=/etc/yum.repos.d/kubernetes.repo
|
||||
mode=755
|
||||
|
||||
- name: set selinux as permissive mode
|
||||
become: yes
|
||||
shell: setenforce 0
|
||||
|
||||
- name: set selinux as permissive mode
|
||||
become: yes
|
||||
shell: sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
|
||||
|
||||
- name: install k8s
|
||||
become: yes
|
||||
shell: yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes
|
||||
|
||||
- name: activate kubelet
|
||||
become: yes
|
||||
shell: systemctl enable --now kubelet
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
- include: deactivate_gpgcheck.yml
|
||||
#- include: basic_pkgs.yml
|
||||
#- include: set_path_env.yml
|
||||
#- include: git_config.yml
|
||||
#
|
||||
##- include: python3_specific_vers.yml
|
||||
#
|
||||
#- include: vim_extra_plugins.yml
|
||||
# when: use_vim_extra_plugins == true
|
||||
#
|
||||
#- include: neovim.yml
|
||||
#- include: kubernetes.yml
|
||||
#
|
||||
##- include: ovn.yml
|
||||
#
|
||||
#- include: devstack.yml
|
||||
#
|
||||
#- include: setup_tacker.yml
|
||||
# when: use_tacker == true
|
||||
#
|
||||
#- include: extra_tools.yml
|
||||
# when: use_extra_tools == true
|
||||
@@ -0,0 +1,51 @@
|
||||
---
|
||||
- name: install neovim
|
||||
become: yes
|
||||
unarchive:
|
||||
src=https://github.com/neovim/neovim/releases/download/stable/nvim-linux64.tar.gz
|
||||
dest=/usr/local
|
||||
remote_src=yes
|
||||
|
||||
- name: set PATH for '.local/bin'
|
||||
lineinfile:
|
||||
line="export PATH=/usr/local/nvim-linux64/bin:$PATH"
|
||||
dest={{ ansible_env.HOME }}/.bashrc
|
||||
|
||||
- name: install latest nodejs for nvim coc
|
||||
become: yes
|
||||
shell: curl -sL install-node.vercel.app | sudo bash -s -- --yes
|
||||
|
||||
- name: install latest yarn for nvim coc
|
||||
become: yes
|
||||
npm:
|
||||
name: yarn
|
||||
global: yes
|
||||
|
||||
- name: create nvim config dir
|
||||
file:
|
||||
path={{ ansible_env.HOME }}/.config/nvim/lua/{{ item }}
|
||||
state=directory
|
||||
with_items:
|
||||
- core
|
||||
- plugins
|
||||
|
||||
- name: upload init.lua
|
||||
template:
|
||||
src=templates/nvim/{{ item }}
|
||||
dest={{ ansible_env.HOME }}/.config/nvim/{{ item }}
|
||||
mode=664
|
||||
with_items:
|
||||
- init.lua
|
||||
- lua/plugins-setup.lua
|
||||
- lua/core/options.lua
|
||||
- lua/core/colorscheme.lua
|
||||
- lua/core/keymaps.lua
|
||||
- lua/core/keymaps-coc.lua
|
||||
- lua/plugins/telescope.lua
|
||||
- lua/plugins/comment.lua
|
||||
- lua/plugins/lualine.lua
|
||||
- lua/plugins/nvim-tree.lua
|
||||
- lua/plugins/nvim-cmp.lua
|
||||
- lua/plugins/autopairs.lua
|
||||
- lua/plugins/treesitter.lua
|
||||
- lua/plugins/gitsigns.lua
|
||||
@@ -1,13 +1,13 @@
|
||||
---
|
||||
- name: install ovn via centos-openstack
|
||||
become: yes
|
||||
yum: name={{ item }} update_cache=yes
|
||||
dnf: name={{ item }} update_cache=yes
|
||||
with_items:
|
||||
- centos-release-openstack-victoria
|
||||
- centos-release-openstack-zed
|
||||
|
||||
- name: install ovn
|
||||
become: yes
|
||||
yum: name={{ item }} update_cache=yes
|
||||
dnf: name={{ item }} update_cache=yes
|
||||
with_items:
|
||||
- openvswitch
|
||||
- openvswitch-ovn-common
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
- name: install python3 other than default version
|
||||
become: yes
|
||||
yum: name={{ item }}
|
||||
dnf: name={{ item }}
|
||||
with_items:
|
||||
- python38
|
||||
- python38-devel
|
||||
@@ -1,22 +1,34 @@
|
||||
---
|
||||
- name: install epel-release for snapd
|
||||
become: yes
|
||||
dnf: name=epel-release
|
||||
|
||||
- name: install snapd
|
||||
become: yes
|
||||
dnf: name=snapd
|
||||
|
||||
- name: enable snapd via systemctl
|
||||
become: yes
|
||||
shell: systemctl enable --now snapd.socket
|
||||
|
||||
- name: create dir for plug.vim
|
||||
file: path={{ ansible_env.HOME }}/.vim/autoload state=directory
|
||||
|
||||
- name: download plug.vim
|
||||
get_url: url=https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||
dest={{ ansible_env.HOME }}/.vim/autoload/plug.vim
|
||||
shell: wget https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -P {{ ansible_env.HOME }}/.vim/autoload/
|
||||
|
||||
- name: vimrc
|
||||
template: src=templates/vimrc.j2 dest={{ ansible_env.HOME }}/.vimrc
|
||||
mode=664
|
||||
|
||||
- name: install exuberant-ctags
|
||||
become: yes
|
||||
yum: name=ctags
|
||||
# TODO(yasufum):
|
||||
#- name: install universal-ctags
|
||||
# become: yes
|
||||
# snap: name=universal-ctags
|
||||
|
||||
- name: install npm
|
||||
become: yes
|
||||
yum: name=npm
|
||||
dnf: name=npm
|
||||
|
||||
- name: install bash-language-server
|
||||
become: yes
|
||||
@@ -27,7 +39,7 @@
|
||||
# required for python-language-server
|
||||
- name: install gcc-c++
|
||||
become: yes
|
||||
yum: name=gcc-c++
|
||||
dnf: name=gcc-c++
|
||||
|
||||
- name: install python-language-server
|
||||
become: yes
|
||||
@@ -0,0 +1,7 @@
|
||||
[kubernetes]
|
||||
name=Kubernetes
|
||||
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
|
||||
enabled=1
|
||||
gpgcheck=0
|
||||
repo_gpgcheck=0
|
||||
gpgkey=https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
|
||||
@@ -0,0 +1,15 @@
|
||||
require("plugins-setup")
|
||||
|
||||
require("core.options")
|
||||
require("core.colorscheme")
|
||||
require("core.keymaps")
|
||||
require("core.keymaps-coc")
|
||||
|
||||
require("plugins.telescope")
|
||||
require("plugins.comment")
|
||||
require("plugins.lualine")
|
||||
require("plugins.nvim-tree")
|
||||
require("plugins.nvim-cmp")
|
||||
require("plugins.autopairs")
|
||||
require("plugins.treesitter")
|
||||
require("plugins.gitsigns")
|
||||
@@ -0,0 +1,5 @@
|
||||
local status, _ = pcall(vim.cmd, "colorscheme nightfly")
|
||||
if not status then
|
||||
print("Colorsheme not found!")
|
||||
return
|
||||
end
|
||||
@@ -0,0 +1,174 @@
|
||||
local keyset = vim.keymap.set
|
||||
-- Autocomplete
|
||||
function _G.check_back_space()
|
||||
local col = vim.fn.col('.') - 1
|
||||
return col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') ~= nil
|
||||
end
|
||||
|
||||
-- Use Tab for trigger completion with characters ahead and navigate
|
||||
-- NOTE: There's always a completion item selected by default, you may want to enable
|
||||
-- no select by setting `"suggest.noselect": true` in your configuration file
|
||||
-- NOTE: Use command ':verbose imap <tab>' to make sure Tab is not mapped by
|
||||
-- other plugins before putting this into your config
|
||||
local opts = {silent = true, noremap = true, expr = true, replace_keycodes = false}
|
||||
keyset("i", "<TAB>", 'coc#pum#visible() ? coc#pum#next(1) : v:lua.check_back_space() ? "<TAB>" : coc#refresh()', opts)
|
||||
keyset("i", "<S-TAB>", [[coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"]], opts)
|
||||
|
||||
-- Make <CR> to accept selected completion item or notify coc.nvim to format
|
||||
-- <C-g>u breaks current undo, please make your own choice
|
||||
keyset("i", "<cr>", [[coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"]], opts)
|
||||
|
||||
-- Use <c-j> to trigger snippets
|
||||
keyset("i", "<c-j>", "<Plug>(coc-snippets-expand-jump)")
|
||||
-- Use <c-space> to trigger completion
|
||||
keyset("i", "<c-space>", "coc#refresh()", {silent = true, expr = true})
|
||||
|
||||
-- Use `[g` and `]g` to navigate diagnostics
|
||||
-- Use `:CocDiagnostics` to get all diagnostics of current buffer in location list
|
||||
keyset("n", "[g", "<Plug>(coc-diagnostic-prev)", {silent = true})
|
||||
keyset("n", "]g", "<Plug>(coc-diagnostic-next)", {silent = true})
|
||||
|
||||
-- GoTo code navigation
|
||||
keyset("n", "gd", "<Plug>(coc-definition)", {silent = true})
|
||||
keyset("n", "gy", "<Plug>(coc-type-definition)", {silent = true})
|
||||
keyset("n", "gi", "<Plug>(coc-implementation)", {silent = true})
|
||||
keyset("n", "gr", "<Plug>(coc-references)", {silent = true})
|
||||
|
||||
|
||||
-- Use K to show documentation in preview window
|
||||
function _G.show_docs()
|
||||
local cw = vim.fn.expand('<cword>')
|
||||
if vim.fn.index({'vim', 'help'}, vim.bo.filetype) >= 0 then
|
||||
vim.api.nvim_command('h ' .. cw)
|
||||
elseif vim.api.nvim_eval('coc#rpc#ready()') then
|
||||
vim.fn.CocActionAsync('doHover')
|
||||
else
|
||||
vim.api.nvim_command('!' .. vim.o.keywordprg .. ' ' .. cw)
|
||||
end
|
||||
end
|
||||
keyset("n", "K", '<CMD>lua _G.show_docs()<CR>', {silent = true})
|
||||
|
||||
|
||||
-- Highlight the symbol and its references on a CursorHold event(cursor is idle)
|
||||
vim.api.nvim_create_augroup("CocGroup", {})
|
||||
vim.api.nvim_create_autocmd("CursorHold", {
|
||||
group = "CocGroup",
|
||||
command = "silent call CocActionAsync('highlight')",
|
||||
desc = "Highlight symbol under cursor on CursorHold"
|
||||
})
|
||||
|
||||
|
||||
-- Symbol renaming
|
||||
keyset("n", "<leader>rn", "<Plug>(coc-rename)", {silent = true})
|
||||
|
||||
|
||||
-- Formatting selected code
|
||||
keyset("x", "<leader>f", "<Plug>(coc-format-selected)", {silent = true})
|
||||
keyset("n", "<leader>f", "<Plug>(coc-format-selected)", {silent = true})
|
||||
|
||||
|
||||
-- Setup formatexpr specified filetype(s)
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = "CocGroup",
|
||||
pattern = "typescript,json",
|
||||
command = "setl formatexpr=CocAction('formatSelected')",
|
||||
desc = "Setup formatexpr specified filetype(s)."
|
||||
})
|
||||
|
||||
-- Update signature help on jump placeholder
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
group = "CocGroup",
|
||||
pattern = "CocJumpPlaceholder",
|
||||
command = "call CocActionAsync('showSignatureHelp')",
|
||||
desc = "Update signature help on jump placeholder"
|
||||
})
|
||||
|
||||
-- Apply codeAction to the selected region
|
||||
-- Example: `<leader>aap` for current paragraph
|
||||
local opts = {silent = true, nowait = true}
|
||||
keyset("x", "<leader>a", "<Plug>(coc-codeaction-selected)", opts)
|
||||
keyset("n", "<leader>a", "<Plug>(coc-codeaction-selected)", opts)
|
||||
|
||||
-- Remap keys for apply code actions at the cursor position.
|
||||
keyset("n", "<leader>ac", "<Plug>(coc-codeaction-cursor)", opts)
|
||||
-- Remap keys for apply code actions affect whole buffer.
|
||||
keyset("n", "<leader>as", "<Plug>(coc-codeaction-source)", opts)
|
||||
-- Remap keys for applying codeActions to the current buffer
|
||||
keyset("n", "<leader>ac", "<Plug>(coc-codeaction)", opts)
|
||||
-- Apply the most preferred quickfix action on the current line.
|
||||
keyset("n", "<leader>qf", "<Plug>(coc-fix-current)", opts)
|
||||
|
||||
-- Remap keys for apply refactor code actions.
|
||||
keyset("n", "<leader>re", "<Plug>(coc-codeaction-refactor)", { silent = true })
|
||||
keyset("x", "<leader>r", "<Plug>(coc-codeaction-refactor-selected)", { silent = true })
|
||||
keyset("n", "<leader>r", "<Plug>(coc-codeaction-refactor-selected)", { silent = true })
|
||||
|
||||
-- Run the Code Lens actions on the current line
|
||||
keyset("n", "<leader>cl", "<Plug>(coc-codelens-action)", opts)
|
||||
|
||||
|
||||
-- Map function and class text objects
|
||||
-- NOTE: Requires 'textDocument.documentSymbol' support from the language server
|
||||
keyset("x", "if", "<Plug>(coc-funcobj-i)", opts)
|
||||
keyset("o", "if", "<Plug>(coc-funcobj-i)", opts)
|
||||
keyset("x", "af", "<Plug>(coc-funcobj-a)", opts)
|
||||
keyset("o", "af", "<Plug>(coc-funcobj-a)", opts)
|
||||
keyset("x", "ic", "<Plug>(coc-classobj-i)", opts)
|
||||
keyset("o", "ic", "<Plug>(coc-classobj-i)", opts)
|
||||
keyset("x", "ac", "<Plug>(coc-classobj-a)", opts)
|
||||
keyset("o", "ac", "<Plug>(coc-classobj-a)", opts)
|
||||
|
||||
|
||||
-- Remap <C-f> and <C-b> to scroll float windows/popups
|
||||
---@diagnostic disable-next-line: redefined-local
|
||||
local opts = {silent = true, nowait = true, expr = true}
|
||||
keyset("n", "<C-f>", 'coc#float#has_scroll() ? coc#float#scroll(1) : "<C-f>"', opts)
|
||||
keyset("n", "<C-b>", 'coc#float#has_scroll() ? coc#float#scroll(0) : "<C-b>"', opts)
|
||||
keyset("i", "<C-f>",
|
||||
'coc#float#has_scroll() ? "<c-r>=coc#float#scroll(1)<cr>" : "<Right>"', opts)
|
||||
keyset("i", "<C-b>",
|
||||
'coc#float#has_scroll() ? "<c-r>=coc#float#scroll(0)<cr>" : "<Left>"', opts)
|
||||
keyset("v", "<C-f>", 'coc#float#has_scroll() ? coc#float#scroll(1) : "<C-f>"', opts)
|
||||
keyset("v", "<C-b>", 'coc#float#has_scroll() ? coc#float#scroll(0) : "<C-b>"', opts)
|
||||
|
||||
|
||||
-- Use CTRL-S for selections ranges
|
||||
-- Requires 'textDocument/selectionRange' support of language server
|
||||
keyset("n", "<C-s>", "<Plug>(coc-range-select)", {silent = true})
|
||||
keyset("x", "<C-s>", "<Plug>(coc-range-select)", {silent = true})
|
||||
|
||||
|
||||
-- Add `:Format` command to format current buffer
|
||||
vim.api.nvim_create_user_command("Format", "call CocAction('format')", {})
|
||||
|
||||
-- " Add `:Fold` command to fold current buffer
|
||||
vim.api.nvim_create_user_command("Fold", "call CocAction('fold', <f-args>)", {nargs = '?'})
|
||||
|
||||
-- Add `:OR` command for organize imports of the current buffer
|
||||
vim.api.nvim_create_user_command("OR", "call CocActionAsync('runCommand', 'editor.action.organizeImport')", {})
|
||||
|
||||
-- Add (Neo)Vim's native statusline support
|
||||
-- NOTE: Please see `:h coc-status` for integrations with external plugins that
|
||||
-- provide custom statusline: lightline.vim, vim-airline
|
||||
vim.opt.statusline:prepend("%{coc#status()}%{get(b:,'coc_current_function','')}")
|
||||
|
||||
-- Mappings for CoCList
|
||||
-- code actions and coc stuff
|
||||
---@diagnostic disable-next-line: redefined-local
|
||||
local opts = {silent = true, nowait = true}
|
||||
-- Show all diagnostics
|
||||
keyset("n", "<space>a", ":<C-u>CocList diagnostics<cr>", opts)
|
||||
-- Manage extensions
|
||||
keyset("n", "<space>e", ":<C-u>CocList extensions<cr>", opts)
|
||||
-- Show commands
|
||||
keyset("n", "<space>c", ":<C-u>CocList commands<cr>", opts)
|
||||
-- Find symbol of current document
|
||||
keyset("n", "<space>o", ":<C-u>CocList outline<cr>", opts)
|
||||
-- Search workspace symbols
|
||||
keyset("n", "<space>s", ":<C-u>CocList -I symbols<cr>", opts)
|
||||
-- Do default action for next item
|
||||
keyset("n", "<space>j", ":<C-u>CocNext<cr>", opts)
|
||||
-- Do default action for previous item
|
||||
keyset("n", "<space>k", ":<C-u>CocPrev<cr>", opts)
|
||||
-- Resume latest coc list
|
||||
keyset("n", "<space>p", ":<C-u>CocListResume<cr>", opts)
|
||||
@@ -0,0 +1,30 @@
|
||||
vim.g.mapleader = " " -- Make sure to set `mapleader` before lazy so your mappings are correct.
|
||||
|
||||
vim.api.nvim_set_keymap('t', '<Escape>', '<C-\\><C-n>', {silent = true})
|
||||
|
||||
vim.api.nvim_create_autocmd({'TermOpen'}, {
|
||||
command = 'startinsert',
|
||||
})
|
||||
vim.api.nvim_create_autocmd({'TermOpen'}, {
|
||||
command = 'set norelativenumber',
|
||||
})
|
||||
vim.api.nvim_create_autocmd({'TermOpen'}, {
|
||||
command = 'set nonumber',
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command(
|
||||
'T', 'sp | wincmd j | resize 20 | terminal <args>', { nargs = '*' })
|
||||
vim.api.nvim_set_keymap('n', 'T', ':T <cr>', { noremap = true })
|
||||
|
||||
vim.api.nvim_create_user_command(
|
||||
'TS', 'vs | wincmd j | resize 100 | terminal <args>', { nargs = '*' })
|
||||
vim.api.nvim_set_keymap('n', 'TS', ':TS <cr>', { noremap = true })
|
||||
|
||||
-- nvim-tree
|
||||
vim.api.nvim_set_keymap('n', '<C-n>', ':NvimTreeToggle <cr>', {silent = true})
|
||||
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
||||
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
|
||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
|
||||
@@ -0,0 +1,58 @@
|
||||
local opt = vim.opt
|
||||
|
||||
-- line numbers
|
||||
opt.relativenumber = true
|
||||
opt.number = true
|
||||
|
||||
-- tabs and indentation
|
||||
opt.tabstop = 2
|
||||
opt.shiftwidth = 2
|
||||
opt.expandtab = true
|
||||
opt.autoindent = true
|
||||
|
||||
-- line wrapping
|
||||
opt.wrap = true
|
||||
|
||||
-- search settings
|
||||
opt.ignorecase = true
|
||||
opt.smartcase = true
|
||||
|
||||
-- cursor line
|
||||
opt.cursorline = true
|
||||
-- appearance
|
||||
opt.termguicolors = true
|
||||
opt.background = "dark"
|
||||
opt.signcolumn = "yes"
|
||||
|
||||
-- backspace
|
||||
opt.backspace = "indent,eol,start"
|
||||
|
||||
-- clipboard
|
||||
opt.clipboard:append("unnamedplus")
|
||||
|
||||
-- split windows
|
||||
opt.splitright = true
|
||||
opt.splitbelow = true
|
||||
|
||||
opt.iskeyword:append("-")
|
||||
|
||||
-- nvim-tree
|
||||
-- disable netrw at the very start of your init.lua (strongly advised)
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
-- set termguicolors to enable highlight groups
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
-- Coc options
|
||||
-- Some servers have issues with backup files, see #649
|
||||
vim.opt.backup = false
|
||||
vim.opt.writebackup = false
|
||||
|
||||
-- Having longer updatetime (default is 4000 ms = 4s) leads to noticeable
|
||||
-- delays and poor user experience
|
||||
vim.opt.updatetime = 300
|
||||
|
||||
-- Always show the signcolumn, otherwise it would shift the text each time
|
||||
-- diagnostics appeared/became resolved
|
||||
vim.opt.signcolumn = "yes"
|
||||
@@ -0,0 +1,80 @@
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local plugins = {
|
||||
{ "neoclide/coc.nvim", branch = "release", build = "yarn install --frozen-lockfile" },
|
||||
|
||||
{ "bluz71/vim-nightfly-colors", name = "nightfly", lazy = true, priority = 1000 },
|
||||
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua", version = "*",
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
require("nvim-tree").setup {}
|
||||
end,
|
||||
},
|
||||
|
||||
-- fuzzy finding
|
||||
{
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.1',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' }
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "make",
|
||||
},
|
||||
|
||||
-- completion
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
}
|
||||
},
|
||||
|
||||
-- snippet
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"rafamadriz/friendly-snippets",
|
||||
},
|
||||
|
||||
-- treesitter
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
run = function()
|
||||
require("nvim-treesitter.install").update({ with_sync = true })
|
||||
end,
|
||||
},
|
||||
|
||||
-- auto closing
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
"windwp/nvim-ts-autotag",
|
||||
},
|
||||
|
||||
"lewis6991/gitsigns.nvim",
|
||||
|
||||
"nvim-lualine/lualine.nvim",
|
||||
|
||||
"numToStr/Comment.nvim",
|
||||
|
||||
"tpope/vim-surround",
|
||||
|
||||
"vim-scripts/ReplaceWithRegister",
|
||||
}
|
||||
|
||||
require("lazy").setup(plugins)
|
||||
@@ -0,0 +1,30 @@
|
||||
-- import nvim-autopairs safely
|
||||
local autopairs_setup, autopairs = pcall(require, "nvim-autopairs")
|
||||
if not autopairs_setup then
|
||||
return
|
||||
end
|
||||
|
||||
-- configure autopairs
|
||||
autopairs.setup({
|
||||
check_ts = true, -- enable treesitter
|
||||
ts_config = {
|
||||
lua = { "string" }, -- don't add pairs in lua string treesitter nodes
|
||||
javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes
|
||||
java = false, -- don't check treesitter on java
|
||||
},
|
||||
})
|
||||
|
||||
-- import nvim-autopairs completion functionality safely
|
||||
local cmp_autopairs_setup, cmp_autopairs = pcall(require, "nvim-autopairs.completion.cmp")
|
||||
if not cmp_autopairs_setup then
|
||||
return
|
||||
end
|
||||
|
||||
-- import nvim-cmp plugin safely (completions plugin)
|
||||
local cmp_setup, cmp = pcall(require, "cmp")
|
||||
if not cmp_setup then
|
||||
return
|
||||
end
|
||||
|
||||
-- make autopairs and completion work together
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
@@ -0,0 +1,6 @@
|
||||
local status, comment = pcall(require, "Comment")
|
||||
if not status then
|
||||
return
|
||||
end
|
||||
|
||||
comment.setup()
|
||||
@@ -0,0 +1,8 @@
|
||||
-- import gitsigns plugin safely
|
||||
local setup, gitsigns = pcall(require, "gitsigns")
|
||||
if not setup then
|
||||
return
|
||||
end
|
||||
|
||||
-- configure/enable gitsigns
|
||||
gitsigns.setup()
|
||||
@@ -0,0 +1,6 @@
|
||||
local status, lualine = pcall(require, "lualine")
|
||||
if not status then
|
||||
return
|
||||
end
|
||||
|
||||
lualine.setup()
|
||||
@@ -0,0 +1,36 @@
|
||||
local cmp_status, cmp = pcall(require, "cmp")
|
||||
if not cmp_status then
|
||||
return
|
||||
end
|
||||
|
||||
local luasnip_status, luasnip = pcall(require, "luasnip")
|
||||
if not luasnip_status then
|
||||
return
|
||||
end
|
||||
|
||||
-- load friendly-snippets
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
||||
|
||||
vim.opt.completeopt = "menu,menuone,noselect"
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-j>"] = cmp.mapping.select_next_item(),
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "luasnip" },
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
}),
|
||||
})
|
||||
@@ -0,0 +1,14 @@
|
||||
local status, tree = pcall(require, "nvim-tree")
|
||||
if not status then
|
||||
return
|
||||
end
|
||||
|
||||
tree.setup({
|
||||
sort_by = "case_sensitive",
|
||||
renderer = {
|
||||
group_empty = true,
|
||||
},
|
||||
filters = {
|
||||
dotfiles = true,
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,33 @@
|
||||
local telescope_setup, telescope = pcall(require, "telescope")
|
||||
if not telescope_setup then
|
||||
return
|
||||
end
|
||||
|
||||
local actions_setup, actions = pcall(require, "telescope.actions")
|
||||
if not actions_setup then
|
||||
return
|
||||
end
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
}
|
||||
}
|
||||
},
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true,
|
||||
override_generic_sorter = true,
|
||||
override_file_sorter = true,
|
||||
case_mode = "smart_case",
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
-- To get fzf loaded and working with telescope, you need to call
|
||||
-- load_extension, somewhere after setup function:
|
||||
require('telescope').load_extension('fzf')
|
||||
@@ -0,0 +1,29 @@
|
||||
-- import nvim-treesitter plugin safely
|
||||
local status, treesitter = pcall(require, "nvim-treesitter.configs")
|
||||
if not status then
|
||||
return
|
||||
end
|
||||
|
||||
-- configure treesitter
|
||||
treesitter.setup({
|
||||
-- enable syntax highlighting
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
-- enable indentation
|
||||
indent = { enable = true },
|
||||
-- enable autotagging (w/ nvim-ts-autotag plugin)
|
||||
autotag = { enable = true },
|
||||
-- ensure these language parsers are installed
|
||||
ensure_installed = {
|
||||
"awk", "bash", "comment", "css", "diff", "dockerfile",
|
||||
"git_rebase", "gitattributes", "gitcommit", "gitignore",
|
||||
"go", "gomod", "gosum", "graphql",
|
||||
"help", "html", "http", "ini", "javascript", "jq", "json", "lua",
|
||||
"make", "markdown", "markdown_inline", "mermaid", "ninja",
|
||||
"python", "regex", "rst", "ruby", "sql", "svelte",
|
||||
"terraform", "toml", "typescript", "tsx", "vim", "vue", "yaml",
|
||||
},
|
||||
-- auto install above language parsers
|
||||
auto_install = true,
|
||||
})
|
||||
@@ -23,8 +23,14 @@
|
||||
roles:
|
||||
- ubuntu-focal/compute
|
||||
|
||||
- name: centos-stream8 controller node
|
||||
hosts: centos-stream8.controller
|
||||
- name: centos-stream9 controller node
|
||||
hosts: centos-stream9.controller
|
||||
remote_user: stack
|
||||
roles:
|
||||
- centos-stream8/controller
|
||||
- centos-stream9/controller
|
||||
|
||||
- name: centos-stream9 compute node
|
||||
hosts: centos-stream9.compute
|
||||
remote_user: stack
|
||||
roles:
|
||||
- centos-stream9/compute
|
||||
|
||||
Reference in New Issue
Block a user