dotfiles

Ruby list directory with Dir['*'] including dotfiles but not . and

允我心安 提交于 2019-12-09 14:31:07
问题 How do I get Dir['*'] to include dotfiles, e.g., .gitignore , but not . and .. ? I.e., is there a better way to do: `ls -A`.split "\n" perhaps with Dir ? The following solutions are close but both include . & .. : Dir.glob('*', File::FNM_DOTMATCH) Dir['{.*,*}'] So, the following works: Dir.glob('*', File::FNM_DOTMATCH) - ['.', '..'] But, is there still a better way to do this? I'm wondering this to fix line 9 of a Meteor Homebrew Formula. 回答1: You can't with Dir[], but you can with Dir.glob,

One git for multiple folders in differents places

梦想的初衷 提交于 2019-12-06 07:14:19
I think this subject was asked before, but I didn't find anything interesting to work with. I read this Can I store the .git folder outside the files I want tracked? and Single Git repo with directories in multiple locations try to play with it, but didn't find the way to achieve this well. The goal of this, is to store backup preferences for applications and dotfiles. But the strucuture of files look to somethink like this -- /Users/Jeremy/Library/Application\ Support/Sublime\ Text\ 3/Packages/User ------ Theme ------ Snippet ------ Preferences.sublime-settings -- -- /Users/Jeremy/.gitconfig

vim - how to remove netrw?

隐身守侯 提交于 2019-12-05 13:22:09
I was testing https://github.com/skwp/dotfiles ) and unfortunately it did install a lot of things I do not want. For example, right now (with empty .vimrc) when I open vim I get " ============================================================================ " Netrw Directory Listing (netrw v149) " /Users/user/.vim/bundle " Sorted by name " Sort sequence: [\/]$,\<core\%(\.\d\+\)\=\>,\.h$,\.c$,\.cpp$,\~\=\*$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$ " Quick Help: <F1>:help -:go up dir D:delete R:rename s:sort-by x:exec " ============================================================================

Ruby list directory with Dir['*'] including dotfiles but not . and

…衆ロ難τιáo~ 提交于 2019-12-03 23:35:57
How do I get Dir['*'] to include dotfiles, e.g., .gitignore , but not . and .. ? I.e., is there a better way to do: `ls -A`.split "\n" perhaps with Dir ? The following solutions are close but both include . & .. : Dir.glob('*', File::FNM_DOTMATCH) Dir['{.*,*}'] So, the following works: Dir.glob('*', File::FNM_DOTMATCH) - ['.', '..'] But, is there still a better way to do this? I'm wondering this to fix line 9 of a Meteor Homebrew Formula . You can't with Dir[] , but you can with Dir.glob , which Dir[] calls: Dir.glob("*", File::FNM_DOTMATCH) You can get rid of the . & .. easily: Dir.glob("*",

Should I use quotes in environment path names?

我是研究僧i 提交于 2019-12-03 08:26:30
问题 I'm in the process of cleaning up all my config files in an attempt to make them as readable as possible. I've been looking for a style guide on the use of quotes while exporting paths in, for example, a ~/.bashrc file: export PATH="/users/me/path:$PATH" vs export PATH=/users/me/path:$PATH The Google shell style guide suggests avoiding quotes for path names. In contrast, a lot of the popular dotfiles repos (such as Zach Holman's here) use quotes. Are there any situations when it is an

What is a .un~ file or or why does Vim in the Terminal make the .un~ file?

泪湿孤枕 提交于 2019-12-02 14:35:10
I've noticed I have some dotfiles that end with .un~ , for example I have a .vividchalk.vim.un~ , but I'm not sure where that came from. It seems like they are created when I use Vim in the Terminal. What are these files? Can have them remove themselves when I close the file I'm editing? TheEwook When you edit and save files, Vim creates a file with the same name as the original file and an un~ extension at the end. Vim 7.3 contains a new feature persistent undo, that is, undo information won't be lost when quitting Vim and be stored in a file that ends with .un~ . You have set the undofile

Is It A Bad Practice to List Ruby Version in Both Gemfile and .ruby-version Dotfile?

▼魔方 西西 提交于 2019-11-29 06:06:45
问题 My latest Rails project is more or less and experiment for me to break lots of things and learn in the process. I have the latest version of Ruby specified in my gemfile: ruby '2.2.3' And I also have a .ruby-version dotfile in the project, with the following contents: 2.2.3 Other than the obvious duplication, what is wrong with this? What is the purpose of both conventions? If I should only have one convention for listing my Ruby version, why should I have one (Gemfile) over the other

How do I track “dot” configuration files in my home directory with git?

时光毁灭记忆、已成空白 提交于 2019-11-28 23:46:40
I have a number of "dot" files in my home directory that I'd like to track with git - e.g. .pryrc , .zshrc , etc. I want to have a remote repository for these files so that a) there is an easy way to recover my configuration settings should I lose my machine for any reason; and b) to safely track any changes made to the files in the event I screw something up when configuring changes. I initially set up a git repository in the home directory to track them, with a .gitignore file configured to ignore every file except specific, whitelisted file names. However, I realized I'm not crazy about

How to use Github to manage dotfiles?

只愿长相守 提交于 2019-11-28 22:30:25
问题 I stored my dotfiles in github, with lots pains, because of no automation. I have to update it myself. Is there a way that can auto install/update/sync dotfiles? I mean in a fresh server, I download dotfiles and exec a install script to copy dotfiles to local. After some time, I can exec a updateToRemote script to push local changes to remote repo, and on another server, I can exec a updateToLocal script to pull remote changes to local. Something like that. 回答1: The main source of information

How can I grep hidden files?

一世执手 提交于 2019-11-28 03:52:56
I am searching through a Git repository and would like to include the .git folder. grep does not include this folder if I run grep -r search * What would be a grep command to include this folder? Please refer to the solution at the end of this post as a better alternative to what you're doing. You can explicitly include hidden files (a directory is also a file). grep -r search * .* The * will match all files except hidden ones and .* will match only hidden files. However this will fail if there are either no non-hidden files or no hidden files in a given directory. You could of course