diff options
| author | hc <hc@email.ch> | 2024-09-26 02:08:43 +0800 |
|---|---|---|
| committer | hc <hc@email.ch> | 2024-09-26 02:08:43 +0800 |
| commit | 5639ff2ae3fb7a7796ca78646f86f8346f120c2b (patch) | |
| tree | ae37ec62352e72ffa303a211398fa7eff63765ba /setup.sh | |
| parent | a2f703ec02bc1589a540b67b9c82683043c622b2 (diff) | |
change all to vanilla vim, mroe stable
Diffstat (limited to 'setup.sh')
| -rwxr-xr-x | setup.sh | 76 |
1 files changed, 10 insertions, 66 deletions
| @@ -12,81 +12,25 @@ sudo dnf install -y nc autossh tmux htop tar bmon gzip tree wget curl mlocate na | |||
| 12 | #pip install jupyterlab python-swiftclient | 12 | #pip install jupyterlab python-swiftclient |
| 13 | sudo dnf update -y | 13 | sudo dnf update -y |
| 14 | 14 | ||
| 15 | #install nvim | 15 | cat << EOF > /etc/vimrc |
| 16 | sudo dnf groupinstall -y "Development Tools" | ||
| 17 | sudo dnf install -y cmake | ||
| 18 | cd ~ | ||
| 19 | git clone https://github.com/neovim/neovim | ||
| 20 | cd neovim | ||
| 21 | make CMAKE_BUILD_TYPE=RelWithDebInfo | ||
| 22 | sudo make install | ||
| 23 | cd ~ | ||
| 24 | |||
| 25 | #install lunarvim | ||
| 26 | sudo dnf install -y git make python3 python3-pip nodejs gcc-c++ | ||
| 27 | curl https://sh.rustup.rs -sSf | sh -s -- -y | ||
| 28 | source "$HOME/.cargo/env" | ||
| 29 | sudo dnf group install -y "Development Tools" | ||
| 30 | yes | bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/install.sh) | ||
| 31 | cat << EOF > ~/.config/lvim/config.lua | ||
| 32 | lvim.plugins = { | ||
| 33 | { | ||
| 34 | "folke/tokyonight.nvim", | ||
| 35 | lazy = false, | ||
| 36 | priority = 1000, | ||
| 37 | opts = {}, | ||
| 38 | } | ||
| 39 | } | ||
| 40 | |||
| 41 | vim.cmd([[ | ||
| 42 | augroup netcat_clipboard | 16 | augroup netcat_clipboard |
| 43 | au! | 17 | au! |
| 44 | au TextYankPost * call system("openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 p.0nom.ch 5023", @") | 18 | au TextYankPost * call system("openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 p.0nom.ch 5023", @") |
| 45 | |||
| 46 | augroup END | 19 | augroup END |
| 47 | ]]) | ||
| 48 | |||
| 49 | -- Enable line wrapping | ||
| 50 | vim.wo.wrap = true | ||
| 51 | 20 | ||
| 52 | -- Optional: Make wrapped lines easier to read by indenting them | 21 | " Enable line wrapping |
| 53 | vim.wo.breakindent = true | 22 | set wrap |
| 54 | vim.wo.breakindentopt = "shift:2" | ||
| 55 | 23 | ||
| 56 | -- Navigate to the next tab, shift-l, prev shift-h | 24 | " Optional: Make wrapped lines easier to read by indenting them |
| 57 | vim.api.nvim_set_keymap('n', '<S-l>', ':BufferLineCycleNext<CR>', { noremap = true, silent = true }) | 25 | set breakindent |
| 58 | vim.api.nvim_set_keymap('n', '<S-h>', ':BufferLineCyclePrev<CR>', { noremap = true, silent = true }) | 26 | set breakindentopt=shift:2 |
| 59 | 27 | ||
| 60 | vim.api.nvim_create_autocmd("BufWritePost", { | 28 | set list |
| 61 | pattern = "*.cpp", | 29 | set listchars=tab:>- |
| 62 | command = "!g++ % -o %< && chmod +x %<" | 30 | set autoindent |
| 63 | }) | 31 | set number |
| 64 | EOF | 32 | EOF |
| 65 | 33 | ||
| 66 | -- Fix for vim.tbl_add_reverse_lookup deprecation | ||
| 67 | -- Replace any usage of vim.tbl_add_reverse_lookup with: | ||
| 68 | local function add_reverse_lookup(tbl) | ||
| 69 | local result = {} | ||
| 70 | for k, v in pairs(tbl) do | ||
| 71 | result[k] = v | ||
| 72 | result[v] = k | ||
| 73 | end | ||
| 74 | return result | ||
| 75 | end | ||
| 76 | |||
| 77 | -- Fix for vim.treesitter.get_parser warning | ||
| 78 | -- Wrap any usage of vim.treesitter.get_parser with a pcall: | ||
| 79 | local function safe_get_parser(bufnr, lang) | ||
| 80 | local ok, parser = pcall(vim.treesitter.get_parser, bufnr, lang) | ||
| 81 | if ok then | ||
| 82 | return parser | ||
| 83 | else | ||
| 84 | -- Handle the error or return nil | ||
| 85 | return nil | ||
| 86 | end | ||
| 87 | end | ||
| 88 | |||
| 89 | |||
| 90 | # add check fro each component | 34 | # add check fro each component |
| 91 | 35 | ||
| 92 | # then git clone work directory, or git clone altogether | 36 | # then git clone work directory, or git clone altogether |
