From 6ddc5199a1f2df439473b96027c2aea6a5190fa9 Mon Sep 17 00:00:00 2001 From: tiyn Date: Thu, 27 Feb 2025 02:22:46 +0100 Subject: [PATCH 1/2] linux/vim: removed vim coc due to being outdated --- wiki/linux/vim/c-language.md | 40 ------------------ wiki/linux/vim/coc.md | 82 ------------------------------------ wiki/linux/vim/golang.md | 43 ------------------- wiki/linux/vim/nim.md | 28 ------------ wiki/linux/vim/python.md | 24 ----------- wiki/linux/vim/vhdl.md | 28 ------------ wiki/linux/vim/vim-plug.md | 35 --------------- wiki/linux/vim/vim.md | 22 ---------- 8 files changed, 302 deletions(-) delete mode 100644 wiki/linux/vim/c-language.md delete mode 100644 wiki/linux/vim/coc.md delete mode 100644 wiki/linux/vim/golang.md delete mode 100644 wiki/linux/vim/nim.md delete mode 100644 wiki/linux/vim/python.md delete mode 100644 wiki/linux/vim/vhdl.md delete mode 100644 wiki/linux/vim/vim-plug.md delete mode 100644 wiki/linux/vim/vim.md diff --git a/wiki/linux/vim/c-language.md b/wiki/linux/vim/c-language.md deleted file mode 100644 index e5bbc18..0000000 --- a/wiki/linux/vim/c-language.md +++ /dev/null @@ -1,40 +0,0 @@ -# C in Vim - -C is a common programming language. -In this article we will focus on making vim support c and use vim as an ide for -c. - -## Autocompletion - -### Coc - -To enable autocompletion for [coc](coc.md) you need to install `ccls`. -After that you need to add the following lines to your coc config file. - -```json -{ - "languageserver": { - "ccls": { - "command": "ccls", - "filetypes": [ - "c", - "cpp", - "objc", - "objcpp" - ], - "rootPatterns": [ - ".ccls", - "compile_commands.json", - ".vim/", - ".git/", - ".hg/" - ], - "initializationOptions": { - "cache": { - "diretory": "/tmp/ccls" - } - } - } - } -} -``` diff --git a/wiki/linux/vim/coc.md b/wiki/linux/vim/coc.md deleted file mode 100644 index 516db6a..0000000 --- a/wiki/linux/vim/coc.md +++ /dev/null @@ -1,82 +0,0 @@ -# Coc in Vim - -[Conquer of completion](https://github.com/neoclide/coc.nvim) enables full -language server protocol support for neovim. -It is written specifically for neovim. - -The coc config file is located in `.config/nvim/coc-settings.json`. - -## Installation - -- Install `nodejs` -- Install [vim-plug](vim-plug.md) -- Add coc.vim to your init.vim - - Add `Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'}` - to your Plug-Section - -## Base config - -Add the base configuration to your vim config file. - -```vimscript -" neoclide/coc.nvim -inoremap - \ pumvisible() ? "\" : - \ check_back_space() ? "\" : - \ coc#refresh() -inoremap pumvisible() ? "\" : "\" - -function! s:check_back_space() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' -endfunction - -if has('nvim') - inoremap coc#refresh() -else - inoremap coc#refresh() -endif - -inoremap pumvisible() ? coc#_select_confirm() - \: "\u\\=coc#on_enter()\" - -nmap gd (coc-definition) -nmap gy (coc-type-definition) -nmap gi (coc-implementation) -nmap gr (coc-references) -nnoremap K :call show_documentation() - -function! s:show_documentation() - if (index(['vim','help'], &filetype) >= 0) - execute 'h '.expand('') - elseif (coc#rpc#ready()) - call CocActionAsync('doHover') - else - execute '!' . &keywordprg . " " . expand('') - endif -endfunction - -autocmd CursorHold * silent call CocActionAsync('highlight') - -nmap (coc-rename) - -xmap f (coc-format-selected) -nmap f (coc-format-selected) - -augroup mygroup - autocmd! - autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') - autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') -augroup end -``` - -## Extensions - -Extensions can be added to the vim config aswell. -A basic example for adding a few extensions is: - -```vimscript -let g:coc_global_extensions = [ - \ ] -``` - diff --git a/wiki/linux/vim/golang.md b/wiki/linux/vim/golang.md deleted file mode 100644 index 14738bc..0000000 --- a/wiki/linux/vim/golang.md +++ /dev/null @@ -1,43 +0,0 @@ -# GoLang in Vim - -GoLang is a common programming language. -In this article we will focus on making vim support Go and use vim as an ide -for it. -This guide is based on a guide from -[octetz.com](https://octetz.com/docs/2019/2019-04-24-vim-as-a-go-ide/). - -## Build, Test, Run, Docs, Debug, Format - -To enable most of the basic functions of an IDE you need to install `vim-go` via -`vim plug`. -For this add `Plug 'fatih/vim-go' " better support for golang` in your plug section -in the `init.vim` file. -Then run `:PlugInstall` and `:GoInstallBinaries` inside `nvim`. -Finally add `let g:go_def_mapping_enabled = 0` to your `init.vim` to make sure -the mapping `gd` will be used by `coc` and its language server. - -## Autocompletion - -### Coc - -To enable autocompletion for [coc](coc.md) you need to install `ccls`. -After that you need to add the following lines to your coc config file. - -```json -{ - "languageserver": { - "golang": { - "command": "gopls", - "rootPatterns": [ - "go.mod", - ".vim/", - ".git/", - ".hg/" - ], - "filetypes": [ - "go" - ] - } - } -} -``` diff --git a/wiki/linux/vim/nim.md b/wiki/linux/vim/nim.md deleted file mode 100644 index 735c17f..0000000 --- a/wiki/linux/vim/nim.md +++ /dev/null @@ -1,28 +0,0 @@ -# Nim in Vim - -[Nim](https://nim-lang.org) is a statically typed compiled systems programming. - -## Autocompletion - -### Coc - -To enable autocompletion for [coc](coc.md) you need to install `nimlsp` -(`nimble install nimlsp`). -After that you need to add the following lines to your coc config file. - -```json -{ - "languageserver": { - "nim": { - "command": "nimlsp", - "filetypes": ["nim"], - "trace.server": "verbose" - } - } -} -``` - -### Highlighting - -To enable highlighting you can install a -[vim plugin by zah](https://github.com/zah/nim.vim). diff --git a/wiki/linux/vim/python.md b/wiki/linux/vim/python.md deleted file mode 100644 index d1334f3..0000000 --- a/wiki/linux/vim/python.md +++ /dev/null @@ -1,24 +0,0 @@ -# Python in Vim - -Python is a common programming language. -In this article we will focus on making vim support python and use vim as an -ide for it. - -## Autocompletion - -### Coc - -To enable autocompletion for [coc](coc.md) you need to install the coc-package -`coc-python`. Do that by adding it to the extension section of your `init.vim`. - -## Formatting - -Install `autopep8` to your system. -Then add `autocmd FileType python setlocal formatprg=autopep8\ -` and -`autocmd FileType python noremap gggqG` to your -`init.vim` to reformat on F8. - -## Line length - -To set your python buffers to show column 80 add -`autocmd BufEnter,FileType python set colorcolumn=80` to your `init.vim`. diff --git a/wiki/linux/vim/vhdl.md b/wiki/linux/vim/vhdl.md deleted file mode 100644 index fe9f50d..0000000 --- a/wiki/linux/vim/vhdl.md +++ /dev/null @@ -1,28 +0,0 @@ -# VHDL in Vim - -VHDL is a hardware description language. -In this article we will focus on making vim support VHDL. - -## Linting - -### Coc - -To enable linting and other language server features for [coc](coc.md) you need -to install [hdl-checker](https://github.com/suoto/hdl_checker). -After that you need to add the following lines to your coc config file. - -```json -{ - "hdlChecker": { - "command": "hdl_checker", - "args": [ - "--lsp" - ], - "filetypes": [ - "vhdl", - "verilog", - "systemverilog" - ] - } -} -``` diff --git a/wiki/linux/vim/vim-plug.md b/wiki/linux/vim/vim-plug.md deleted file mode 100644 index be56e2f..0000000 --- a/wiki/linux/vim/vim-plug.md +++ /dev/null @@ -1,35 +0,0 @@ -# Vim-Plug - -[Vim-Plug](https://github.com/junegunn/vim-plug) is a minimalist plugin manager. - -## Installation - -You can add the following lines to your vim config file to make sure vim-plug is -installed with the correct folder-structure. - -```vimscript -if ! filereadable(expand('~/.config/nvim/autoload/plug.vim')) - echo "Downloading junegunn/vim-plug to manage plugins..." - silent !mkdir -p ~/.config/nvim/autoload/ - silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ~/.config/nvim/autoload/plug.vim - autocmd VimEnter * PlugInstall -endif -``` - -Below is an example plugin section. - -```vimscript -call plug#begin('~/.local/share/nvim/plugged') -Plug 'airblade/vim-gitgutter' -Plug 'tpope/vim-surround' -Plug 'uiiaoo/java-syntax.vim' , {'for': 'java'} -call plug#end() -``` - -## Important commands - -- `:PlugInstall` - install plugins specified in the Plug section -- `:PlugClean` - remove plugins that are not specified in the Plug section - -For both of these command remember to write the file and reload the buffer if -you just added a new plugin or removed one. diff --git a/wiki/linux/vim/vim.md b/wiki/linux/vim/vim.md deleted file mode 100644 index dba3f9d..0000000 --- a/wiki/linux/vim/vim.md +++ /dev/null @@ -1,22 +0,0 @@ -# Vim - -[Vim](https://github.com/vim/vim) is a texteditor. -A good alternative to baseline Vim is Neovim. -[Neovim](https://github.com/neovim/neovim) is based on Vim and focused -on extensibility and usability. -The configuration file is stored in `.config/nvim/init.vim` -On GitHub [Vim-Galore](https://github.com/mhinz/vim-galore) gives extensive guides and tips on using -Vim. - -## Plug-In - -There are a bunch of different options for managing plug-ins. - -- [Vim-plug](vim-plug.md) - -## Autocompletion - -An important feature for writing text and especially code is autocompletion. -For Neovim there are a few options. - -- [Conquer of completion](coc.md) From 033ad68dfbb941543b1c661beb7ebaaad871fee3 Mon Sep 17 00:00:00 2001 From: tiyn Date: Thu, 27 Feb 2025 04:47:54 +0100 Subject: [PATCH 2/2] linux: added hardware entry --- wiki/linux/hardware.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 wiki/linux/hardware.md diff --git a/wiki/linux/hardware.md b/wiki/linux/hardware.md new file mode 100644 index 0000000..6216478 --- /dev/null +++ b/wiki/linux/hardware.md @@ -0,0 +1,15 @@ +# Hardware + +This entry focusses on various hardware components of a desktop PC or a laptop. + +## Battery + +The battery of a notebook can be inspected by using the `upower` command. +To use it the tool needs to be installed. +In most [Linux](/wiki/linux.md) distributions this is bundled in a package of the same name. +A usage example is shown in the following command. +It will show the state, voltage, percentage and many other information about a given battery. + +```sh +upower -i /org/freedesktop/UPower/devices/battery_BAT0 +```