4 Commits

Author SHA1 Message Date
0929cece74 Removed unused code and languages
Commented code removed, also removed languages like rust and
javascript that I do not use.
2023-10-02 22:12:16 +02:00
f04fd3e314 quicknotes.md expanded 2023-10-02 22:05:55 +02:00
22d29b811a Update quicknotes.md
Formatting
2023-08-08 21:29:11 +00:00
3be06b91df Add quicknotes.md
Creation of quicknotes.md to simplify remembering what I did in the past
2023-08-08 21:27:47 +00:00
2 changed files with 29 additions and 44 deletions

57
kakrc
View File

@@ -1,7 +1,7 @@
# Load plug.kak # Load plug.kak
source "%val{config}/plugins/plug.kak/rc/plug.kak" source "%val{config}/plugins/plug.kak/rc/plug.kak"
plug "alexherbo2/auto-pairs.kak"
plug "andreyorst/plug.kak" noload plug "andreyorst/plug.kak" noload
# plug kak-lsp
plug "kak-lsp/kak-lsp" do %{ plug "kak-lsp/kak-lsp" do %{
cargo build --release --locked cargo build --release --locked
cargo install --force --path . cargo install --force --path .
@@ -22,50 +22,28 @@ plug "kak-lsp/kak-lsp" do %{
define-command ee -docstring 'go to current error/warning from lsp' %{ lsp-find-error --include-warnings; lsp-find-error --previous --include-warnings } define-command ee -docstring 'go to current error/warning from lsp' %{ lsp-find-error --include-warnings; lsp-find-error --previous --include-warnings }
define-command lsp-restart -docstring 'restart lsp server' %{ lsp-stop; lsp-start } define-command lsp-restart -docstring 'restart lsp server' %{ lsp-stop; lsp-start }
hook global WinSetOption filetype=(c|cpp|sh|cc|rust|javascript|typescript|go|python) %{ hook global WinSetOption filetype=(c|cpp|sh|python) %{
set-option window lsp_auto_highlight_references true set-option window lsp_auto_highlight_references true
set-option window lsp_hover_anchor false set-option window lsp_hover_anchor false
map window insert <a-l> lsp-next-location
lsp-auto-hover-enable lsp-auto-hover-enable
echo -debug "Enabling LSP for filtetype %opt{filetype}" echo -debug "Enabling LSP for filtetype %opt{filetype}"
lsp-enable-window lsp-enable-window
} }
hook global WinSetOption filetype=(rust) %{
set window lsp_server_configuration rust.clippy_preference="on"
}
hook global WinSetOption filetype=rust %{
hook window BufWritePre .* %{
evaluate-commands %sh{
test -f rustfmt.toml && printf lsp-formatting-sync
}
}
}
map global user l %{:enter-user-mode lsp<ret>} -docstring "LSP mode"
map global insert <tab> '<a-;>:try lsp-snippets-select-next-placeholders catch %{ execute-keys -with-hooks <lt>tab> }<ret>' -docstring 'Select next snippet placeholder'
map global object a '<a-semicolon>lsp-object<ret>' -docstring 'LSP any symbol'
map global object <a-a> '<a-semicolon>lsp-object<ret>' -docstring 'LSP any symbol'
map global object e '<a-semicolon>lsp-object Function Method<ret>' -docstring 'LSP function or method'
map global object k '<a-semicolon>lsp-object Class Interface Struct<ret>' -docstring 'LSP class interface or struct'
map global object d '<a-semicolon>lsp-diagnostic-object --include-warnings<ret>' -docstring 'LSP errors and warnings'
map global object D '<a-semicolon>lsp-diagnostic-object<ret>' -docstring 'LSP errors'
hook global KakEnd .* lsp-exit hook global KakEnd .* lsp-exit
} }
# Substitute c-n with tab # Substitute c-n with tab
#hook global InsertCompletionShow .* %{ hook global InsertCompletionShow .* %{
# try %{ try %{
# execute-keys -draft 'h<a-K>\h<ret>' execute-keys -draft 'h<a-K>\h<ret>'
# map window insert <tab> <c-n> map window insert <tab> <c-n>
# map window insert <s-tab> <c-p> map window insert <s-tab> <c-p>
# hook -once -always window InsertCompletionHide .* %{ hook -once -always window InsertCompletionHide .* %{
# map window insert <tab> <tab> map window insert <tab> <tab>
# map window insert <s-tab> <s-tab> map window insert <s-tab> <s-tab>
# } }
# } }
#} }
# enable auto pair closing # enable auto pair closing
enable-auto-pairs enable-auto-pairs
# yaml linter # yaml linter
@@ -95,15 +73,6 @@ set global tabstop 4
add-highlighter global/ number-lines add-highlighter global/ number-lines
add-highlighter global/ wrap add-highlighter global/ wrap
plug "andreyorst/kaktree" config %{
hook global WinSetOption filetype=kaktree %{
remove-highlighter buffer/numbers
remove-highlighter buffer/matching
remove-highlighter buffer/wrap
remove-highlighter buffer/show-whitespaces
}
kaktree-enable
}
# system clipboard usermode # system clipboard usermode
map global user y '<a-|>xclip -in -selection clipboard >&- 2>&-<ret>' \ map global user y '<a-|>xclip -in -selection clipboard >&- 2>&-<ret>' \
-docstring 'Copy selected text to system clipboard' -docstring 'Copy selected text to system clipboard'

16
quicknotes.md Normal file
View File

@@ -0,0 +1,16 @@
### Commands used when setting up `kak-lsp`. Need to tidy up this and create a proper README.md
[kak-lsp Github](https://github.com/kak-lsp/kak-lsp)
[plug.kak Github](https://github.com/andreyorst/plug.kak)
`$ sudo yum install cargo`
`$ sudo yum install clangd`
`$ sudo yum install clang-tools`
`$ sudo yum install llvm`
`$ sudo yum install clang-tools-extra`
`$ git clone https://github.com/andreyorst/plug.kak.git $HOME/.config/kak/plugins/plug.kak`
`$ export PATH=$PATH:/home/doddo/.cargo/bin`
### Issues
- For some reason, kak-lsp does not seem to compile with the last version of Rust
- Fall back to download static precompiled `kak-lsp`
- Need to refactor the whole kakrc to make it more readable