~hedy/dotfiles

ca4788b86670093fe00657554a794b97d66a56e5 — hedy 4 months ago 5d56e2f
Add helix ๐ŸŽ‰
A .config/helix/config.toml => .config/helix/config.toml +73 -0
@@ 0,0 1,73 @@
theme = "custom_gh_contrast"

[editor]
line-number = "relative"
bufferline = "multiple"
color-modes = true
auto-completion = false
completion-trigger-len = 1
insert-final-newline = false
scroll-lines = 1
scrolloff = 0
idle-timeout = 1000

# Features
[editor.file-picker]
hidden = false

# UI
[editor.cursor-shape]
insert = "bar"
normal = "block"

[editor.whitespace.render]
tab = "all"
nbsp = "all"

[editor.whitespace.characters]
space = "ยท"
nbsp = "โฝ"
tab = "โ†’"
tabpad = " "

[editor.indent-guides]
render = true

[editor.statusline]
left = ["mode", "spinner", "file-name", "read-only-indicator", "file-modification-indicator"]
center = ["register"]
right = ["diagnostics", "selections", "position-percentage", "file-encoding", "file-line-ending"]
mode.normal = "N"
mode.insert = "I"
mode.select = "S"

# KEYBINDINGS
[keys.normal]
G = [ "goto_last_line", "goto_line_end" ]

"\\" = "shell_keep_pipe"
"$" = [ "select_mode", "goto_line_end", "normal_mode" ]
"0" = [ "select_mode", "goto_line_start", "normal_mode" ]

"C" = [ "select_mode", "goto_line_end", "normal_mode", "change_selection" ]
"C-/" = "toggle_comments"
"C-c" = "copy_selection_on_next_line"

"D" = [ "select_mode", "goto_line_end", "normal_mode", "delete_selection" ]

"A-`" = "switch_case"
"~" = "switch_to_uppercase" # shift-`

[keys.normal.space]
w = ":write"
q = ":quit-all"
x = ":write-quit-all"

# Emacs
[keys.insert]
"C-a" = [ "goto_line_start" ]
"C-e" = [ "goto_line_end", "move_char_right" ]
"C-p" = "move_visual_line_up"
"C-n" = "move_visual_line_down"
"C-b" = "move_char_left"
"C-f" = "move_char_right"

A .config/helix/languages.toml => .config/helix/languages.toml +8 -0
@@ 0,0 1,8 @@
[[language]]
name = "cpp"
language-servers = []
formatter = { command = "clang-format", args = ["--fallback-style=Google"] }

# doesn't work!
[language-servers.clangd]
args = ["-std=c++17"]

A .config/helix/themes/custom_gh_contrast.toml => .config/helix/themes/custom_gh_contrast.toml +7 -0
@@ 0,0 1,7 @@

inherits = "github_dark_high_contrast"

[palette]
"fg.muted" = "#9ea1a3"

# hi

M .config/nvim/lua/plugins/competitest.lua => .config/nvim/lua/plugins/competitest.lua +5 -2
@@ 5,7 5,7 @@ vim.api.nvim_create_autocmd(
     command = "setl signcolumn=no" }
)

function CPConfig()
function _G.CPConfig()
  -- Allows opening of terminal in directory of current file (to avoid
  -- submitting code to the wrong problem!)
  -- This has since been moved to global config


@@ 20,7 20,7 @@ end
vim.api.nvim_create_autocmd(
   { "BufRead" },
   { pattern = "*/projects/cp/*",
     callback = CPConfig }
     callback = _G.CPConfig }
)

local function get_pieces(task)


@@ 45,6 45,9 @@ local function get_pieces(task)
    if edu ~= nil then
      round = "edu"..round  -- edu000
    end
    if not div then
        div = ""
    end
    div = "div"..div  -- div3
  end
  problem = task.name  -- A. Name of Task

A .config/nvim/snippets/cpp.snippets => .config/nvim/snippets/cpp.snippets +48 -0
@@ 0,0 1,48 @@
snippet for
    for(int ${1:i}=0; ${1:i}<${2:n}; ++${1:i}) {
        ${0:$VISUAL}
    }

snippet read2
    int ${1:n}, ${2:m}; cin >> ${1:n} >> ${1:m};

snippet readvec
    Vi ${1:A};
    for(int i=0; i<${2:n}; ++i) {
        int x; cin >> x;
        A.push_back(x);
    }

snippet FR
    ${1:A}.begin(), ${1:A}.end()

snippet pb
    push_back

snippet cout
    cout << ${0:$VISUAL};

snippet print
    cout << ${0:$VISUAL};

snippet coute
    cout << ${0:$VISUAL} << endl;

snippet println
    cout << ${0:$VISUAL} << endl;

snippet println2
    cout << ${1} << ${2} << endl;

snippet func
    ${1:int} ${2:solve}(${3:Vi &A}) {
        ${0:$VISUAL}
    }

snippet init
    #include <bits/stdc++.h>
    using namespace std;
    
    int main() {
        ${0:$VISUAL}
    }