Git Product home page Git Product logo

dotfiles's People

Contributors

guywithacube avatar

dotfiles's Issues

Configure `showbreak` with accordance to `list` for easy copy-and-pasting

When switching between set number and set nonumber, reconfigure showbreak such that it is easy to simply copy and paste straight from vim.

In other words, when line numbers are enabled, show the line breaks. When line numbers are disabled, hide the line breaks.

This gist provides potential inspiration:

au OptionSet number :if v:option_new | set showbreak= |
                   \ else | set showbreak=↪ |
                   \ endif

Source `bash` scripts based on filename presedence

"One off" bash scripts for machine-specific configurations may need to be sourced in a specific sequence.

Consider adopting a pattern where script sourcing order is determined by filename. This comment provides an example of a possible implementation.

If this change is reasonable, it would need to be included here:

dotfiles/bash/bashrc

Lines 183 to 187 in bdef96b

# Private / machine specific
for file in "$BASH_DIR"/private.d/*.sh; do
# shellcheck source=/dev/null
[ -r "$file" ] && [ -f "$file" ] && source "$file"
done

Refactor non-portable usage of `set-hook -R session-created`

Currently, "automatically configuring" the TERM environment variable in tmux relies on the session-created hook.

Calling set-hook -R session-created when tmux does not have any sessions has different functionality between tmux 3.2a and tmux 3.3a. This may occur when set-hook -R session-created is directly from tmux.conf.

tmux 3.2a

Invoking tmux new-session results in:

server exited unexpectedly

The ending of tmux-server-24242.log is as follows:

1673642800.543227 cmd_parse_build_commands: set-hook -R session-created
1673642800.543232 cmd_find_best_session: 0 sessions to try
1673642800.543237 cmdq_next <global>: [set-hook/0x7fca8380e320] (0), flags 0
1673642800.543244 cmdq_fire_command <global>: (1537) set-hook -R session-created
1673642800.543248 cmd_find_best_session: 0 sessions to try
1673642800.543252 cmd_find_current_client: no target, return 0x0
1673642800.543255 cmd_find_best_session: 0 sessions to try
1673642800.543259 cmd_find_current_client: no target, return 0x0
1673642800.543263 cmd_find_best_session: 0 sessions to try
1673642800.543267 cmd_find_target: target none, type pane, item 0x7fca8380e320, flags QUIET,CANFAIL
1673642800.543271 cmd_find_best_session: 0 sessions to try
1673642800.543275 cmd_find_target: error
1673642800.543279 format_defaults: c=none
1673642800.543283 format_defaults: s=none
1673642800.543286 format_defaults: wl=none
1673642800.543290 format_defaults: wp=none
1673642800.543294 format_expand1: expanding format: session-created
1673642800.543298 format_expand1: result is: session-created

tmux 3.3a

Invoking tmux new-session operates as expected. The relevant tmux server log has nothing substantial.


Ideally, these dotfiles should be as portable as possible. So, it would be nice to find a solution that works on any version of tmux.

`flush_to_history` increments history indices tremendously

I was attempting to remove a command from my bash history but was presented with a peculiar error message:

user@machine:~
$ history -d 220041
-bash: history: 220041: history position out of range

Upon further investigation, I determined this is due to how flush_to_history works.

flush_to_history aims to "sync" bash history between all bash sessions.

dotfiles/bash/bashrc

Lines 131 to 138 in bdef96b

# Flush to history file after every command
# https://askubuntu.com/a/80380
# https://stackoverflow.com/a/36669770
function flush_to_history() {
history -a
history -r
}
prompt_command_array+=("flush_to_history")

While this appears to work, history indices increment by significantly more than one between commands:

user@machine:~
$ echo "example command"
example command
user@machine:~
$ echo "another example command"
another example command
user@machine:~
$ echo "hello world"; history | tail -n 3
hello world
40010  echo "example command"
40011  echo "another example command"
40012  echo "hello world"; history | tail -n 3
user@machine:~
$ echo "goodbye world"; history | tail -n 3
goodbye world
45016  echo "another example command"
45017  echo "hello world"; history | tail -n 3
45018  echo "goodbye world"; history | tail -n 3

This exact issue appears to be described in a comment on the resource from which the flush_to_history function was derived.

Determine if there is a possibility to continue "syncing" the bash histories between sessions without needlessly incrementing history indices.

Remove NERDTree plugin

Explore possibilities of removing the NERDTree plugin.

This article, entitled "Vim: you don't need NERDtree or (maybe) netrw" makes a rather compelling argument.

Refactor `listchars` definitions for compatibility

I am encountering issues with how listchars are defined when using older versions of vim. It would be nice if the vim configuration files were as portable as reasonably possible.

Defining listchars using escaped hexadecimal or Unicode codes was introduced via vim/vim#9006, which corresponds to patch-8.2.3522.

Additionally, displaying "leading spaces" via the listchars lead was introduced via vim/vim#7772 which corresponds to patch-8.2.2454.

Perhaps adding the relevant has("patch-X.Y.ZZZZ") checks would be of benefit?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.