Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "custom setups" section #24

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

gwenzek
Copy link

@gwenzek gwenzek commented Jul 20, 2020

The idea is to collect a bunch of resources How to use Sublime for doing X.
Sublime generally need some setup when you start working seriously with one language/programming stack.
Having those guides will help new ST users to get started with a new project.

This PR adds:

Let's discuss what's would be the best place to put those guides :-)

I cleaned up Julia guide to focus on Julia exclusively. I'm not sure about some the Zeal configuration files it seems to be outdated.
Pages mentionning plugins may tend to be obsolete faster than the rest of the documentation because the plugins API tend to evolve faster than core ST.
So maybe those pages should have a proeminent timestamp or versions of the mentioned plugins.

What are you thoughts on this ?

EDIT: maybe there should be some guidelines for authors of those guides. Things I tried to apply to myself:

  • Make the guide incremental:
    Don't start by asking the user to install 5 plugins and then explain how they are used. Start minimalist and add features/plugins progressively.
  • Explicit your workflow from the start, so that people can see if they something they want to use.
  • Explicit the OS used, ST is cross-platform, but some plugins need extra configuration for specific OS.
  • Encourage the use of command palette instead of menus.

It would also be helpful if we could assume the readers know about Package Contrrol, Command Palette, ...

@gwenzek
Copy link
Author

gwenzek commented Jul 20, 2020

Also I just read Contributing.md so there is a few formatting that I need to do, but I'm happy to have the rest of the discussion already.

EDIT: formatting ok :-)

@PetrKryslUCSD
Copy link
Contributor

This looks good. I agree that the number of plugins discussed can be reduced.

@gwenzek
Copy link
Author

gwenzek commented Jul 21, 2020

@PetrKryslUCSD I think the plugins you listed are good, but maybe they should be listed elsewhere.
Otherwise people not interested in Julia won't see them.
I tried to focus on just your Julia workflow with the REPL integration.

EDIT: I previoulsy said Lua where I meant Julia. (Damn, so many programming languages to learn !)

@PetrKryslUCSD
Copy link
Contributor

PetrKryslUCSD commented Jul 21, 2020 via email

@FichteFoll
Copy link
Member

So maybe those pages should have a proeminent timestamp or versions of the mentioned plugins.

According to the vue docs, the "Last Updated" texts at the end of every page should contain a timestamp of when that page was last updated, but in my quick tests on the live site, all of them had the same timestamp, despite the input handlers page being the last one to receive updates. Seems like it's not working properly.

maybe there should be some guidelines for authors of those guides

Definitely, but let's see what works first. Thanks for writing down your thoughts already, though, as that will surely be a good starting point.

It would also be helpful if we could assume the readers know about Package Contrrol, Command Palette, ...

The command palette should be known at this point in the guide as it is explained in the Basics section. You can reference the page where it is explained, if you want to, but only once preferrably. Package Control is only mentioned in the installing packages section, which is not prominent enough in my taste, but I have a local todo item to improve that at least. You shouldn't have to deal with it in a page describing a certain environment.

@@ -0,0 +1,16 @@
---
title: Introduction
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should read "Example Setups" and the folder name should reflect the name of this section.

docs/guide/setup-examples/julia.md Outdated Show resolved Hide resolved
I like having my source code on the left
and a terminal running Julia REPL on the right.
This setup will allow you to have the terminal inside Sublime
and to have commands that send code under your cursor to the REPL.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A screenshot showing this would be nice.

docs/guide/setup-examples/julia.md Show resolved Hide resolved
docs/guide/setup-examples/julia.md Outdated Show resolved Hide resolved

## Credits

Thanks to Petr Krysl, Paul Soderlind, @mbauman.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbauman doesn't really help without a namespace or a URL. Is this a handle on Twitter, Github or some other random site?

docs/guide/setup-examples/remote_dev.md Outdated Show resolved Hide resolved
docs/guide/setup-examples/remote_dev.md Outdated Show resolved Hide resolved
docs/guide/setup-examples/remote_dev.md Outdated Show resolved Hide resolved
Comment on lines 24 to 29
AddKeysToAgent yes
UseKeychain yes
ControlPath ~/.ssh/ssh-%r@%h:%p
ControlMaster auto
ServerAliveInterval 240
Port 22
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these options are optional and unless they are required, users shouldn't be asked to copy random congifuration options into their setup that they don't need or understand. That's my ideal, at least.

AddKeysToAgent is debatable and more useful than the others (and especially the default), so that can probably remain.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my case I need the ControlPath, ControlMaster because I have 2-factor authentication.
I split the instructions in two, and added more details

Copy link
Member

@FichteFoll FichteFoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for moving these pages over to the Community Docs project. This is definitely going in the right direction. I just left a couple comments on things I'd like to discuss or that should be changed.

docs/guide/setup-examples/remote_dev.md Outdated Show resolved Hide resolved
SFTP is a Sublime Text package that will allow you to keep in sync files
on your laptop and on a server.

Install https://packagecontrol.io/packages/SFTP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing period. Should probably also be an ordered list.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what you meant. I made the installation instructions a list.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's almost what I meant (unordered instead of ordered), but workable for now.

docs/guide/setup-examples/remote_dev.md Outdated Show resolved Hide resolved
docs/guide/setup-examples/remote_dev.md Outdated Show resolved Hide resolved
docs/guide/setup-examples/remote_dev.md Show resolved Hide resolved
docs/guide/setup-examples/remote_dev.md Outdated Show resolved Hide resolved
Note that it still takes a few seconds to run
so if you start a job on your server just after pulling,
you may end up running code from the old branch.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As another alternative, inotifywait could be used to schedule an rsync run when files are changed. I have the following script in my path

#!/bin/sh
FORMAT=$(echo -e "\n\033[1;33m ==> %w%f written\033[0m")
"$@"
while inotifywait -qre close_write --format "$FORMAT" .
do
    "$@"
done

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so do you need to run this command every time you start working on your project ?
it doesn't seems fool-proof.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct, but I find it reasonable to explicitly start a monitoring sync process like rsync. Anyway, that was just an additional idea.

@FichteFoll
Copy link
Member

Oh, you also need to add the pages to .vuepress/config.js so they will be added to the sidebar. I can also do that if you don't want to deal with reading vuepress documentation.

@gwenzek gwenzek requested a review from FichteFoll August 3, 2020 21:34
@gwenzek
Copy link
Author

gwenzek commented Aug 3, 2020

Thanks for the review, I improved the "remote development" guide further.

I'm not sure what to do next for the Julia one. There are some parts that I believe could be simplified,
but given I'm neither a Windows user nor aJulia user, I'm not sure I'm the best person to do that.
In particular I'm not sure you need to create a fake ST executable to have Julia opening in the Git Bash rather than in the Windows shell (CMD).

The idea was to show what a language specific guide could look like, but maybe it should be move to separate PR to clean it more.

Copy link
Member

@FichteFoll FichteFoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good changes here. Please address the remaining comments (and the few I added here) and we can go ahead and merge.

In the file `USER\Terminus.sublime-settings`,
chose your favorite shell.

customize the Linux shell of the Windows Subsystem for Linux,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete sentence.

to upload the whole folder to your server.

To keep the remote code always a mirror of the code on your laptop,
you want to automatically run `rsync_git` when you checkout a branch:

```sh
echo "source ~/.zshrc; rsync_git" > .git/post-checkout
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be noted that hooks executed according to their shebang line and I'm not sure if they use $SHELL as the default if none exists. Since you're sourcing your zshrc, you'd probably want it to be interpreted by zsh.

Note that it still takes a few seconds to run
so if you start a job on your server just after pulling,
you may end up running code from the old branch.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct, but I find it reasonable to explicitly start a monitoring sync process like rsync. Anyway, that was just an additional idea.

Comment on lines +123 to +124
title: 'Example Setups',
path: '/guide/setup-examples/',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These names are still out of sync.

@bkoski
Copy link

bkoski commented Jun 27, 2021

@gwenzek - introduced #54 that ideally would build on this "Example Setups" framework, if it's possible to tidy up and merge this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants